/* Login moderno — Treelan Cloud */
:root {
    --tl-login-bg: #0f3d5c;
    --tl-login-bg-soft: #1a5a7a;
    --tl-login-card: #ffffff;
    --tl-login-text: #1e293b;
    --tl-login-muted: #64748b;
    --tl-login-accent: #2a8fc7;
    --tl-login-accent-hover: #1f7ab0;
    --tl-login-border: #e2e8f0;
    --tl-login-error: #b91c1c;
    --tl-login-radius: 14px;
    --tl-login-shadow: 0 18px 50px rgba(15, 61, 92, 0.22);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body.tl-login-body {
    margin: 0;
    min-height: 100%;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    font-size: 15px;
    color: var(--tl-login-text);
    background: linear-gradient(145deg, var(--tl-login-bg) 0%, var(--tl-login-bg-soft) 55%, #2d7aa8 100%);
}

.tl-login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.tl-login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 32px;
}

.tl-login-shell {
    width: 100%;
    max-width: 980px;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    background: var(--tl-login-card);
    border-radius: var(--tl-login-radius);
    box-shadow: var(--tl-login-shadow);
    overflow: hidden;
}

.tl-login-form-panel,
.tl-login-brand {
    flex: 1 1 50%;
    min-width: 0;
    box-sizing: border-box;
}

.tl-login-brand {
    padding: 36px 32px 32px;
    background: linear-gradient(160deg, #f8fafc 0%, #eef4f9 100%);
    border-left: 1px solid var(--tl-login-border);
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tl-login-aside-head {
    flex: 0 0 auto;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--tl-login-border);
}

.tl-login-brand-body {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.tl-login-treelan-mark {
    display: block;
    max-width: 160px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.tl-login-form-brand {
    text-align: center;
    margin-bottom: 20px;
}

.tl-login-clinic-logo {
    max-width: 240px;
    max-height: 88px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: inline-block;
}

.tl-login-news {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--tl-login-border);
    border-radius: 10px;
    box-sizing: border-box;
}

.tl-login-news-empty {
    flex: 1 1 0;
    height: 100%;
    margin: 0;
    font-size: 0.85rem;
    color: var(--tl-login-muted);
    line-height: 1.45;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--tl-login-border);
    border-radius: 10px;
    box-sizing: border-box;
}

.tl-login-news-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tl-login-muted);
    margin: 0 0 10px;
}

.tl-login-news-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 0;
    min-height: 0;
    max-height: none !important;
    height: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.tl-login-news-item {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid var(--tl-login-border);
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.4;
}

.tl-login-news-item strong,
.tl-login-news-item-title {
    display: block;
    font-size: 0.875rem;
    color: #003366;
    margin-bottom: 6px;
    font-weight: 700;
    line-height: 1.35;
}

.tl-login-news-item-title p {
    margin: 0;
}

.tl-login-news-item time {
    display: block;
    font-size: 0.7rem;
    color: var(--tl-login-muted);
    margin-bottom: 4px;
}

.tl-login-news-text {
    display: block;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--tl-login-text);
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif,
        "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif;
}

.tl-login-news-text p {
    margin: 0.35rem 0;
}

.tl-login-news-text p:last-child {
    margin-bottom: 0;
}

.tl-login-news-text li > p {
    display: inline;
    margin: 0;
}

.tl-login-news-text ul {
    list-style: disc;
    margin: 0.35em 0 0.5em;
    padding-left: 1.25rem;
}

.tl-login-news-text ol {
    list-style: decimal;
    margin: 0.35em 0 0.5em;
    padding-left: 1.25rem;
}

.tl-login-news-text li {
    margin-bottom: 0.25em;
    padding-left: 0.15em;
}

.tl-login-news-text li strong,
.tl-login-news-text li b,
.tl-login-news-text li em,
.tl-login-news-text li i,
.tl-login-news-text li span {
    display: inline;
}

.tl-login-news-text li br {
    display: none;
}

.tl-login-news-text p[style*="text-align: center"],
.tl-login-news-text p[style*="text-align:center"],
.tl-login-news-text div[style*="text-align: center"],
.tl-login-news-text div[style*="text-align:center"] {
    text-align: center;
}

.tl-login-news-text p[style*="text-align: right"],
.tl-login-news-text p[style*="text-align:right"],
.tl-login-news-text div[style*="text-align: right"],
.tl-login-news-text div[style*="text-align:right"] {
    text-align: right;
}

.tl-login-news-text a {
    color: var(--tl-login-accent);
    text-decoration: underline;
    word-break: break-word;
}

.tl-login-news-text p br,
.tl-login-news-text blockquote br {
    display: block;
    content: '';
    margin-top: 0.35em;
}

.tl-login-news-text a:hover {
    color: var(--tl-login-accent-hover);
}

.tl-login-news-text img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    margin: 0.5em auto;
    border-radius: 6px;
}

.tl-login-news-text h2,
.tl-login-news-text h3,
.tl-login-news-text h4 {
    margin: 0.4em 0 0.25em;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--tl-login-bg);
}

.tl-login-form-panel {
    padding: 36px 32px 28px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.tl-login-form-panel .tl-login-form-brand + h1 {
    margin-top: 0;
}

.tl-login-form-panel h1 {
    margin: 0 0 6px;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--tl-login-bg);
}

.tl-login-sub {
    margin: 0 0 24px;
    font-size: 0.9rem;
    color: var(--tl-login-muted);
}

.tl-login-alert {
    padding: 10px 12px;
    margin-bottom: 16px;
    border-radius: 8px;
    font-size: 0.88rem;
    background: #fef2f2;
    color: var(--tl-login-error);
    border: 1px solid #fecaca;
}

.tl-login-alert--success {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.tl-login-back {
    margin: 14px 0 0;
    text-align: center;
    font-size: 0.88rem;
}

.tl-login-back a {
    color: var(--tl-login-accent);
    text-decoration: none;
}

.tl-login-back a:hover {
    text-decoration: underline;
}

.tl-login-submit--link {
    display: block;
    text-align: center;
    text-decoration: none;
    line-height: 1.25;
    margin-top: 8px;
}

.tl-login-field {
    margin-bottom: 16px;
}

.tl-login-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--tl-login-text);
}

.tl-login-input-wrap {
    position: relative;
}

.tl-login-input-wrap input {
    width: 100%;
    padding: 11px 42px 11px 12px;
    font-size: 1rem;
    border: 1px solid var(--tl-login-border);
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.tl-login-input-wrap input:focus {
    outline: none;
    border-color: var(--tl-login-accent);
    box-shadow: 0 0 0 3px rgba(42, 143, 199, 0.2);
}

.tl-login-toggle-pw {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 6px 8px;
    line-height: 1;
    color: var(--tl-login-muted);
    border-radius: 6px;
}

.tl-login-toggle-pw:hover {
    color: var(--tl-login-accent);
    background: #f1f5f9;
}

.tl-login-toggle-pw svg {
    display: block;
    width: 20px;
    height: 20px;
}

.tl-login-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin-bottom: 16px;
    font-size: 0.85rem;
}

.tl-login-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--tl-login-text);
}

.tl-login-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--tl-login-accent);
}

.tl-login-forgot a {
    color: var(--tl-login-accent);
    text-decoration: none;
}

.tl-login-forgot a:hover {
    text-decoration: underline;
}

.tl-login-turnstile {
    margin-bottom: 18px;
    min-height: 65px;
}

.tl-login-submit {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: var(--tl-login-accent);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.tl-login-submit:hover {
    background: var(--tl-login-accent-hover);
}

.tl-login-footer {
    text-align: center;
    padding: 12px 16px 22px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.tl-login-footer p {
    margin: 0;
}

.tl-login-footer-powered {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.9);
}

.tl-login-footer-powered img {
    display: block;
    opacity: 0.95;
}

@media (max-width: 768px) {
    .tl-login-shell {
        flex-direction: column;
        max-width: 420px;
    }

    .tl-login-form-panel,
    .tl-login-brand {
        flex: 1 1 auto;
        width: 100%;
    }

    .tl-login-brand {
        border-left: none;
        border-top: 1px solid var(--tl-login-border);
        padding: 24px 20px;
        text-align: left;
        min-height: auto !important;
    }

    .tl-login-brand-body {
        flex: none;
        min-height: auto;
    }

    .tl-login-aside-head {
        text-align: center;
    }

    .tl-login-treelan-mark {
        margin: 0 auto;
    }

    .tl-login-form-brand {
        margin-bottom: 16px;
    }

    .tl-login-clinic-logo {
        margin: 0 auto;
    }

    .tl-login-news {
        flex: none;
    }

    .tl-login-news-list {
        flex: none;
        max-height: 200px;
    }

    .tl-login-form-panel {
        padding: 24px 20px;
    }
}
