:root {
    --auth-bg-start: #0f2438;
    --auth-bg-main: #102a43;
    --auth-bg-end: #1c3d5a;
    --auth-surface: #f8fbfc;
    --auth-card: #ffffff;
    --auth-text: #102a43;
    --auth-text-soft: #627d98;
    --auth-text-muted: #7b8794;
    --auth-border: #d9e2ec;
    --auth-brand-soft: rgba(255, 255, 255, 0.78);
    --auth-brand-muted: rgba(255, 255, 255, 0.66);
    --auth-brand-panel: rgba(255, 255, 255, 0.1);
    --auth-accent: #fb8500;
    --auth-accent-soft: #ffb703;
    --auth-danger-bg: #fee2e2;
    --auth-danger-border: #fecaca;
    --auth-danger-text: #991b1b;
    --auth-shadow: 0 28px 80px rgba(0, 0, 0, 0.26);
    --auth-radius-shell: 28px;
    --auth-radius-card: 18px;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body.auth-page {
    margin: 0;
    color: var(--auth-text);
    font-family: "Segoe UI", "Trebuchet MS", system-ui, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(255, 183, 3, 0.18), transparent 32%),
        radial-gradient(circle at bottom right, rgba(251, 133, 0, 0.18), transparent 28%),
        linear-gradient(160deg, var(--auth-bg-start) 0%, var(--auth-bg-main) 46%, var(--auth-bg-end) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

.auth-shell {
    width: 100%;
    max-width: 1120px;
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    overflow: hidden;
    border-radius: var(--auth-radius-shell);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: var(--auth-shadow);
    backdrop-filter: blur(18px);
}

.auth-shell--login-minimal {
    max-width: 460px;
    grid-template-columns: 1fr;
}

.auth-shell--compact {
    max-width: 560px;
    grid-template-columns: 1fr;
}

.auth-brand {
    padding: 56px 52px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 640px;
    position: relative;
    overflow: hidden;
}

.auth-shell--compact .auth-brand {
    min-height: auto;
    padding: 34px 30px 26px;
}

.auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 44%),
        radial-gradient(circle at 85% 20%, rgba(255, 183, 3, 0.2), transparent 24%),
        radial-gradient(circle at 18% 82%, rgba(251, 133, 0, 0.16), transparent 22%);
    pointer-events: none;
}

.auth-brand-content,
.auth-brand-footer {
    position: relative;
    z-index: 1;
}

.auth-brand-content--minimal {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 18px;
}

.auth-logo {
    width: 104px;
    max-width: 34vw;
    display: block;
    margin-bottom: 26px;
}

.auth-shell--compact .auth-logo {
    width: 86px;
    max-width: 30vw;
    margin-bottom: 18px;
}

.auth-brand-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--auth-brand-panel);
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.84rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 22px;
}

.auth-shell--compact .auth-brand-label {
    font-size: 0.8rem;
    margin-bottom: 16px;
}

.auth-brand-title {
    margin: 0;
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 0.95;
    letter-spacing: -0.03em;
    max-width: 7ch;
}

.auth-shell--compact .auth-brand-title {
    font-size: clamp(1.9rem, 6vw, 3rem);
    max-width: none;
}

.auth-brand-subtitle {
    margin: 18px 0 0;
    max-width: 32rem;
    color: var(--auth-brand-soft);
    font-size: 1rem;
    line-height: 1.65;
}

.auth-shell--compact .auth-brand-subtitle {
    margin-top: 14px;
    color: rgba(255, 255, 255, 0.76);
    line-height: 1.6;
}

.auth-brand-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--auth-brand-muted);
    font-size: 0.9rem;
}

.auth-card {
    background: var(--auth-surface);
    padding: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-shell--login-minimal .auth-card {
    padding: 34px 30px;
}

.auth-shell--compact .auth-card {
    padding: 30px;
    display: block;
}

.auth-panel {
    width: 100%;
    max-width: 420px;
}

.auth-shell--login-minimal .auth-panel {
    max-width: 100%;
}

.auth-panel-label {
    color: #486581;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.auth-panel-title {
    margin: 0;
    font-size: clamp(2rem, 5vw, 2.9rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
    color: var(--auth-text);
}

.auth-panel-text {
    margin: 14px 0 0;
    color: var(--auth-text-soft);
    line-height: 1.65;
    font-size: 1rem;
}

.auth-error {
    margin-top: 24px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--auth-danger-bg);
    color: var(--auth-danger-text);
    border: 1px solid var(--auth-danger-border);
    line-height: 1.45;
}

.auth-form {
    margin-top: 28px;
}

.auth-field {
    margin-bottom: 18px;
}

.auth-field label {
    display: block;
    margin-bottom: 10px;
    color: #243b53;
    font-size: 0.95rem;
    font-weight: 600;
}

.phone-field,
.code-field {
    position: relative;
}

.phone-prefix {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #486581;
    font-size: 1rem;
    font-weight: 700;
}

.auth-input {
    width: 100%;
    min-height: 58px;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-card);
    background: #fff;
    padding: 16px 18px;
    font-size: 1rem;
    color: var(--auth-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    appearance: none;
}

.auth-input::placeholder {
    color: #9fb3c8;
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 4px rgba(251, 133, 0, 0.16);
    transform: translateY(-1px);
}

.auth-input--phone {
    padding-left: 52px;
    font-size: 1.05rem;
}

.auth-input--code {
    min-height: 62px;
    font-size: clamp(1.4rem, 5vw, 1.8rem);
    font-weight: 800;
    text-align: center;
    letter-spacing: 0.38em;
    padding-right: 12px;
}

.auth-submit {
    width: 100%;
    min-height: 58px;
    border: none;
    border-radius: var(--auth-radius-card);
    background: linear-gradient(135deg, var(--auth-accent), var(--auth-accent-soft));
    color: var(--auth-text);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 18px 30px rgba(251, 133, 0, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 34px rgba(251, 133, 0, 0.28);
    filter: saturate(1.04);
}

.auth-submit:active {
    transform: translateY(0);
}

.auth-helper {
    margin-top: 16px;
    color: var(--auth-text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.auth-phone-card {
    padding: 16px 18px;
    border-radius: 18px;
    background: var(--auth-card);
    border: 1px solid var(--auth-border);
    margin-bottom: 22px;
}

.auth-phone-label {
    display: block;
    color: var(--auth-text-soft);
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.auth-phone-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--auth-text);
    word-break: break-all;
}

.auth-phone-hint {
    margin-top: 8px;
    color: var(--auth-text-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.auth-actions {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.auth-back {
    color: #486581;
    text-decoration: none;
    font-weight: 600;
}

.auth-back:hover {
    text-decoration: underline;
}

.auth-timer {
    color: #d64545;
    font-size: 0.92rem;
    font-weight: 700;
}

.auth-mobile-note {
    display: none;
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(16, 42, 67, 0.06);
    color: var(--auth-text-soft);
    font-size: 0.92rem;
    line-height: 1.5;
}

.auth-panel-logo {
    width: 72px;
    display: block;
    margin: 0 auto 22px;
}

@media (max-width: 920px) {
    .auth-shell {
        grid-template-columns: 1fr;
        max-width: 620px;
    }

    .auth-brand {
        min-height: auto;
        padding: 36px 28px 30px;
    }

    .auth-card {
        padding: 28px;
    }
}

@media (max-width: 560px) {
    body.auth-page {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
    }

    .auth-shell,
    .auth-shell--login-minimal,
    .auth-shell--compact {
        min-height: 100vh;
        border-radius: 0;
        border: none;
        box-shadow: none;
        background: transparent;
        backdrop-filter: none;
    }

    .auth-brand {
        padding: 28px 20px 24px;
    }

    .auth-logo {
        width: 82px;
        margin-bottom: 20px;
    }

    .auth-brand-label {
        font-size: 0.76rem;
        margin-bottom: 16px;
    }

    .auth-brand-content--minimal {
        gap: 14px;
    }

    .auth-brand-subtitle {
        font-size: 0.95rem;
    }

    .auth-card {
        padding: 22px 18px 30px;
        border-top-left-radius: 28px;
        border-top-right-radius: 28px;
    }

    .auth-shell--login-minimal .auth-card {
        padding: 28px 18px 30px;
    }

    .auth-panel-title,
    .auth-shell--compact .auth-brand-title {
        font-size: 1.9rem;
    }

    .auth-input,
    .auth-submit {
        min-height: 56px;
        font-size: 1rem;
    }

    .auth-input--code {
        letter-spacing: 0.28em;
    }

    .auth-helper,
    .auth-phone-hint,
    .auth-mobile-note {
        font-size: 0.9rem;
    }

    .auth-actions {
        align-items: flex-start;
        flex-direction: column-reverse;
    }

    .auth-mobile-note {
        display: block;
    }

    .auth-panel-logo {
        width: 64px;
        margin-bottom: 18px;
    }
}
