﻿:root {
    --font: 'Roboto', sans-serif;
    --tg-navy: #243f6a;
    --tg-navy-2: #365989;
    --tg-blue-soft: #7aadd0;
    --tg-orange: #375988;
    --tg-orange-2: #bc5812;
    --bg: #f4f1eb;
    --bg-2: #ece7df;
    --surface: rgba(255,255,255,.62);
    --surface-strong: rgba(255,255,255,.88);
    --surface-card: rgba(255,255,255,.84);
    --border: rgba(21, 31, 43, .08);
    --left-1: #243f6a;
    --left-2: #7aacc8;
    --text: #16202b;
    --text-soft: #5c6774;
    --text-muted: #8b95a0;
    --text-white-soft: rgba(255,255,255,.84);
    --input-bg: rgba(255,255,255,.88);
    --input-border: rgba(21, 31, 43, .10);
    --input-focus: rgba(54, 89, 137, .18);
    --primary: var(--tg-navy-2);
    --primary-2: #2e5282;
    --primary-soft: rgba(54, 89, 137, .10);
    --danger: #b03535;
    --danger-bg: #fff1f1;
    --warning: #375988;
    --warning-bg: #fff5ec;
    --success: #198754;
    --shadow-xl: 0 30px 80px rgba(0,0,0,.14);
    --shadow-lg: 0 18px 40px rgba(0,0,0,.10);
    --shadow-md: 0 12px 24px rgba(0,0,0,.08);
    --radius-xxl: 34px;
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 18px;
    --radius-sm: 14px;
}

html[data-theme="dark"] {
    --bg: #0c1218;
    --bg-2: #101821;
    --surface: rgba(13, 19, 27, .72);
    --surface-strong: rgba(16, 24, 33, .88);
    --surface-card: rgba(18, 27, 37, .86);
    --border: rgba(255,255,255,.08);
    --left-1: #1b3352;
    --left-2: #305580;
    --text: #edf3fa;
    --text-soft: #b9c5d2;
    --text-muted: #8c98a5;
    --text-white-soft: rgba(255,255,255,.80);
    --input-bg: rgba(255,255,255,.03);
    --input-border: rgba(255,255,255,.10);
    --input-focus: rgba(107, 153, 197, .24);
    --primary: #6b99c5;
    --primary-2: #3e6898;
    --primary-soft: rgba(107, 153, 197, .16);
    --danger: #ff8f8f;
    --danger-bg: rgba(176,53,53,.14);
    --warning: #ffb066;
    --warning-bg: rgba(217,106,29,.12);
    --shadow-xl: 0 30px 80px rgba(0,0,0,.34);
    --shadow-lg: 0 18px 40px rgba(0,0,0,.24);
    --shadow-md: 0 12px 24px rgba(0,0,0,.18);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font);
    color: var(--text);
    min-height: 100vh;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 12% 18%, rgba(31,78,134,.11), transparent 0 20%), radial-gradient(circle at 88% 84%, rgba(217,106,29,.08), transparent 0 16%), linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
    transition: background .25s ease;
}

.auth-shell {
    width: 100%;
    max-width: 1280px;
    min-height: 740px;
    display: grid;
    grid-template-columns: 1.04fr .96fr;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,.35);
    border-radius: var(--radius-xxl);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow: hidden;
}

.left-panel {
    position: relative;
    background: linear-gradient(145deg, var(--left-1), var(--left-2));
    color: #fff;
    padding: 46px 42px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

    .left-panel::before,
    .left-panel::after,
    .orb {
        content: "";
        position: absolute;
        border-radius: 50%;
        background: rgba(255,255,255,.07);
        pointer-events: none;
    }

    .left-panel::before {
        width: 340px;
        height: 340px;
        top: -110px;
        right: -110px;
    }

    .left-panel::after {
        width: 220px;
        height: 220px;
        left: -70px;
        bottom: -70px;
    }

.orb {
    width: 120px;
    height: 120px;
    right: 130px;
    top: 235px;
}

.left-content,
.left-footer {
    position: relative;
    z-index: 2;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 38px;
}

.brand-logo {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.12);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 16px 30px rgba(0,0,0,.12);
    flex-shrink: 0;
}

    .brand-logo svg,
    .brand-logo img {
        width: 44px;
        height: 44px;
        object-fit: contain;
        display: block;
    }

.brand-name {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.7px;
    line-height: 1;
}

.brand-sub {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-white-soft);
}

.hero-title {
    max-width: 540px;
    font-size: 50px;
    line-height: 1.02;
    font-weight: 800;
    letter-spacing: -1.6px;
    margin-bottom: 18px;
    text-transform: uppercase;
}

.hero-desc {
    max-width: 540px;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-white-soft);
    margin-bottom: 30px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 14px;
    max-width: 560px;
}

.info-card {
    min-height: 128px;
    border-radius: 22px;
    padding: 18px 16px;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.info-value {
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 12px;
}

.info-text {
    font-size: 13px;
    line-height: 1.6;
    font-weight: 600;
    color: rgba(255,255,255,.82);
}

.left-footer {
    max-width: 560px;
    font-size: 13px;
    line-height: 1.85;
    color: rgba(255,255,255,.76);
}

.right-panel {
    position: relative;
    padding: 28px 34px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.top-actions {
    position: absolute;
    top: 22px;
    right: 22px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.top-btn {
    border: 1px solid var(--border);
    background: var(--surface-strong);
    color: var(--text);
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: .18s ease;
}

    .top-btn:hover {
        transform: translateY(-1px);
    }

.login-wrap {
    width: 100%;
    max-width: 470px;
}

.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 18px;
}

.login-title {
    font-size: 36px;
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -.9px;
    margin-bottom: 10px;
}

.login-desc {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-soft);
    margin-bottom: 28px;
}

.error-box {
    background: var(--danger-bg);
    border: 1px solid rgba(176,53,53,.18);
    color: var(--danger);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 18px;
    font-size: 13px;
    line-height: 1.65;
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    margin-bottom: 9px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.input-wrap {
    position: relative;
}

.form-control {
    width: 100%;
    height: 58px;
    border-radius: 18px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    padding: 0 16px;
    outline: none;
    transition: .18s ease;
}

    .form-control::placeholder {
        color: var(--text-muted);
    }

    .form-control:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 5px var(--input-focus);
        background: var(--surface-strong);
    }

.password-input {
    padding-right: 58px;
}

.icon-inline-btn {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--text-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: .18s ease;
}

    .icon-inline-btn:hover {
        background: rgba(127,127,127,.08);
        color: var(--text);
    }

.field-error {
    display: block;
    margin-top: 7px;
    color: var(--danger);
    font-size: 12px;
    line-height: 1.45;
}

.warning-note {
    display: none;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--warning-bg);
    color: var(--warning);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
}

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0 24px;
}

.remember-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-soft);
    font-size: 14px;
}

    .remember-wrap input[type="checkbox"] {
        width: 16px;
        height: 16px;
        accent-color: var(--primary);
        cursor: pointer;
    }

    .remember-wrap label {
        cursor: pointer;
    }

.link-btn {
    text-decoration: none;
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
}

    .link-btn:hover {
        text-decoration: underline;
    }

.btn-login {
    width: 100%;
    height: 58px;
    border: none;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .2px;
    cursor: pointer;
    box-shadow: 0 16px 34px rgba(54,89,137,.24);
    transition: .18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

    .btn-login:hover {
        transform: translateY(-1px);
        box-shadow: 0 20px 38px rgba(54,89,137,.28);
    }

    .btn-login:disabled {
        opacity: .86;
        cursor: wait;
        transform: none;
    }

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    animation: spin .8s linear infinite;
}

.btn-login.loading .spinner {
    display: inline-block;
}

.legal-note {
    margin-top: 18px;
    text-align: center;
    font-size: 12px;
    line-height: 1.8;
    color: var(--text-muted);
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    border: 0 !important;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1120px) {
    .auth-shell {
        grid-template-columns: 1fr;
        max-width: 560px;
        min-height: auto;
    }

    .left-panel {
        padding: 30px 28px 24px;
    }

    .hero-title {
        font-size: 34px;
    }

    .hero-desc {
        font-size: 15px;
        margin-bottom: 22px;
    }

    .info-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .right-panel {
        padding: 24px 28px 28px;
    }
}

@media (max-width: 720px) {
    body {
        padding: 12px;
        align-items: flex-start;
    }

    .auth-shell {
        border-radius: 22px;
        max-width: 100%;
    }

    .left-panel {
        padding: 24px 20px 20px;
    }

    .brand-row {
        margin-bottom: 20px;
    }

    .brand-logo {
        width: 52px;
        height: 52px;
    }

    .brand-name {
        font-size: 22px;
    }

    .hero-title {
        font-size: 26px;
        letter-spacing: -.8px;
    }

    .hero-desc {
        font-size: 13px;
        margin-bottom: 18px;
    }

    .info-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .info-card {
        min-height: auto;
        padding: 14px 12px;
    }

    .info-value {
        font-size: 18px;
        margin-bottom: 6px;
    }

    .info-text {
        font-size: 11px;
    }

    .left-footer {
        display: none;
    }

    .top-actions {
        position: static;
        margin-bottom: 14px;
        justify-content: flex-end;
    }

    .right-panel {
        padding: 16px 18px 22px;
    }

    .login-badge {
        font-size: 11px;
        padding: 7px 12px;
        margin-bottom: 12px;
    }

    .login-title {
        font-size: 26px;
    }

    .login-desc {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .form-control {
        height: 52px;
        font-size: 16px; /* prevents iOS zoom */
    }

    .btn-login {
        height: 52px;
    }

    .row-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 420px) {
    body {
        padding: 0;
        align-items: flex-start;
    }

    .auth-shell {
        border-radius: 0;
        min-height: 100vh;
        border: none;
        box-shadow: none;
    }

    .left-panel {
        padding: 20px 16px 16px;
    }

    .info-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .right-panel {
        padding: 14px 16px 20px;
    }
}
