
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    background-color: var(--cream);
}

.auth-page::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        url("https://images.unsplash.com/photo-1504148455328-c376907d081c?w=1800&q=80") center / cover no-repeat;
    filter: grayscale(0.15) saturate(0.85);
    opacity: 0.28;
}

.auth-page::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse at 50% 45%, color-mix(in srgb, var(--surface) 55%, transparent) 0%, color-mix(in srgb, var(--surface) 78%, transparent) 52%, rgba(43, 31, 23, 0.22) 100%),
        linear-gradient(180deg, rgba(217, 207, 188, 0.08), transparent 28%, transparent 72%, rgba(61, 44, 32, 0.1));
}

.login-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100%;
    max-width: 1000px;
    min-height: 580px;
    border-radius: 20px;
    overflow: hidden;
    margin: 24px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

.login-left {
    flex: 1;
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    background: var(--brown-dark);
}

.login-logo { display: flex; align-items: center; gap: 12px; }
.login-logo-icon {
    width: 46px;
    height: 46px;
    background: transparent;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    overflow: hidden;
}
.login-logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.login-logo-text h2 {
    font-family: Inter, Arial, sans-serif;
    font-size: 17px;
    color: #fff;
    line-height: 1.2;
}
.login-logo-text p { font-size: 12px; color: rgba(255, 255, 255, 0.55); }

.auth-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-ink);
    margin-bottom: 12px;
}

.login-left-content h1 {
    font-family: Inter, Arial, sans-serif;
    font-size: 44px;
    font-weight: 500;
    letter-spacing: -0.03em;
    color: #fff;
    line-height: 1.06;
    margin-bottom: 14px;
}
.login-left-content h1 em {
    font-style: normal;
    color: var(--gold);
}
.login-left-content p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.75;
    max-width: 36ch;
}

.login-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.login-stat {
    min-width: 0;
    padding: 0;
    background: none;
    border: none;
}
.login-stat h3 {
    font-family: var(--font-num);
    font-weight: 700;
    font-size: 22px;
    color: var(--gold);
}
.login-stat p {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2px;
}

.login-right {
    width: 440px;
    max-width: 100%;
    background: var(--surface);
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.login-right::-webkit-scrollbar { display: none; }

.login-tabs {
    position: relative;
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: var(--cream);
    margin-bottom: 26px;
    border: 1px solid var(--cream-dark);
}
.login-tabs-glider {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc((100% - 8px) / 2);
    background: var(--brown-mid);
    border-radius: 9px;
    box-shadow: var(--shadow-brown);
    pointer-events: none;
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}
.login-tabs[data-tab="register"] .login-tabs-glider {
    transform: translateX(100%);
}
.login-tabs a {
    position: relative;
    z-index: 1;
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: 9px;
    transition: color 0.28s ease;
}
.login-tabs a:hover { color: var(--ink-2); }
.login-tabs a.active {
    color: #fff;
    background: transparent;
    box-shadow: none;
}
.login-tabs a:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.login-left-copy { position: relative; min-height: 170px; }
.login-left-content {
    transition: opacity 0.4s ease, transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}
.login-left-content.is-active {
    opacity: 1;
    transform: none;
}
.login-left-content:not(.is-active) {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

.auth-switch {
    position: relative;
    overflow: hidden;
    transition: height 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.auth-track {
    display: flex;
    width: 200%;
    will-change: transform;
    transition: transform 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}
.auth-switch.is-register .auth-track {
    transform: translateX(-50%);
}
.auth-panel {
    width: 50%;
    flex: 0 0 50%;
    min-width: 0;
    box-sizing: border-box;
}
.auth-panel:not(.is-active) {
    pointer-events: none;
}
.login-tabs:not(:has(.login-tabs-glider)) a.active {
    background: var(--brown-mid);
    box-shadow: var(--shadow-brown);
}

@media (prefers-reduced-motion: reduce) {
    .login-tabs-glider,
    .login-left-content,
    .auth-switch,
    .auth-track {
        transition: none !important;
    }
}

.terms-hint { font-size: 12px; color: var(--text-muted); margin: 0 0 10px; }
.terms-hint.is-ready { color: var(--ok-ink); }
.terms-check.is-locked { opacity: 0.85; }
.terms-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--ink);
    margin: 4px 0 8px;
    line-height: 1.5;
}
.terms-check input {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--brown-mid);
    flex-shrink: 0;
}
.terms-check a {
    color: var(--ink-2);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.login-right h2 {
    font-family: Inter, Arial, sans-serif;
    font-size: 26px;
    color: var(--ink);
    margin-bottom: 6px;
}
.login-right .subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 22px;
    line-height: 1.5;
}
.login-right .alert { margin-bottom: 16px; }

.login-right .form-group { margin-bottom: 16px; }
.login-right .form-group input {
    width: 100%;
    min-width: 0;
    background: var(--surface);
    padding: 12px 14px;
    font-size: 15px;
}

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
}

.auth-page .btn-primary {
    padding: 13px 18px;
    border-radius: 12px;
    font-size: 15px;
    letter-spacing: 0.01em;
    box-shadow: var(--shadow-brown);
}
.auth-page .btn-primary:hover {
    background: var(--brown-dark);
    box-shadow: 0 6px 14px rgba(61, 44, 32, 0.28);
}

.forgot-row { text-align: right; margin: -6px 0 16px; }
.forgot-row a {
    font-size: 13px;
    color: var(--ink-2);
    font-weight: 600;
    text-decoration: none;
}
.forgot-row a:hover { text-decoration: underline; }

.signin-link { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-muted); }
.signin-link a { color: var(--ink-2); font-weight: 600; text-decoration: none; }
.signin-link a:hover { text-decoration: underline; }

.back-home { text-align: center; margin-top: 12px; font-size: 13px; color: var(--text-muted); }
.back-home a {
    color: var(--ink-2);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.verify-icon {
    width: 56px;
    height: 56px;
    background: var(--cream);
    border: 1.5px solid var(--cream-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
}
.code-inputs { display: flex; gap: 8px; justify-content: center; margin: 20px 0; }
.code-inputs input {
    width: 42px;
    height: 50px;
    border: 1.5px solid var(--cream-dark);
    border-radius: 10px;
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    color: var(--ink);
    outline: none;
    background: var(--surface);
}
.code-inputs input:focus { border-color: var(--brown-mid); }
.code-inputs input.filled { border-color: var(--brown-mid); background: var(--cream); }

.resend-row { text-align: center; font-size: 13px; color: var(--text-muted); }
.resend-row a, .change-email { color: var(--ink-2); font-weight: 600; text-decoration: none; }
.email-hint {
    background: var(--cream);
    border: 1.5px solid var(--cream-dark);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 16px;
    line-height: 1.6;
}
.email-hint strong { color: var(--ink); }
.change-email { display: inline-block; margin-top: 12px; font-size: 13px; }
.timer-text { font-weight: 700; color: var(--ink-2); }
.field-error { font-size: 12px; color: var(--danger-ink); }

@media (max-width: 768px) {
    .login-wrapper {
        flex-direction: column;
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
        box-shadow: none;
    }
    .login-left { padding: 28px 22px; gap: 20px; min-height: 220px; }
    .login-left-content h1 { font-size: 26px; }
    .login-left-content p { max-width: none; }
    .login-right { width: 100%; padding: 28px 22px; }
}

@keyframes authCardIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}
.auth-page { padding: 16px; min-height: 100vh; min-height: 100dvh; }
.login-wrapper {
    height: min(680px, calc(100vh - 32px));
    height: min(680px, calc(100dvh - 32px));
    min-height: 0;
    max-width: 1040px;
    margin: 0;
    border-radius: 32px;
    animation: authCardIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-right h2 { font-size: 32px; margin-bottom: 4px; }
.login-right .subtitle { margin-bottom: 16px; }
.login-right .form-group { margin-bottom: 12px; }
.login-right .form-group label { margin-bottom: 6px; }
.login-right .form-group input { padding: 11px 14px; }
.auth-page .btn-primary { border-radius: 999px; padding: 12px 18px; }
.forgot-row { margin: 0 0 14px; }
.signin-link { margin-top: 12px; }
.back-home { margin-top: 6px; }

@media (min-width: 769px) {
    .login-left {
        position: relative;
        overflow: hidden;
        margin: 14px 0 14px 14px;
        padding: 34px 36px;
        border-radius: 24px;
        background:
            radial-gradient(ellipse 80% 55% at 12% 8%, rgba(217, 207, 188, 0.20), transparent 60%),
            repeating-linear-gradient(90deg, transparent 0 14px, rgba(255, 255, 255, 0.014) 14px 15px),
            linear-gradient(160deg, var(--brown-dark), var(--brown-dark));
    }
    .login-left::after {
        content: "";
        position: absolute;
        top: 0;
        right: -1px;
        bottom: 0;
        width: 46px;
        background: var(--surface);
        clip-path: polygon(100% 0, 100% 100%, 0 100%);
    }
    .login-right { width: 470px; padding: 32px 48px; }
}

@media (max-height: 760px) and (min-width: 769px) {
    .login-left { padding: 28px 30px; }
    .login-left-content h1 { font-size: 32px; }
    .login-right { padding: 24px 44px; }
    .login-right h2 { font-size: 26px; }
    .login-right .subtitle { margin-bottom: 12px; }
    .login-right .form-group { margin-bottom: 9px; }
    .login-right .form-group input { padding: 9px 14px; }
    .auth-page .btn-primary { padding: 11px 18px; }
    .signin-link { margin-top: 8px; }
}

@media (max-width: 768px) {
    .auth-page { padding: 0; }
    .login-wrapper { height: auto; min-height: 100vh; border-radius: 0; animation: none; }
    .login-left { flex: 0 0 auto; padding: 16px 20px; min-height: 0; gap: 0; }
    .login-left-copy,
    .login-stats { display: none; }
    .login-right { padding: 22px 20px 28px; }
}

@media (prefers-reduced-motion: reduce) {
    .login-wrapper { animation: none; }
}

.login-tabs { margin-bottom: 14px; padding: 3px; }
.login-tabs a { padding: 8px 8px; }
@media (max-height: 760px) and (min-width: 769px) {
    .login-tabs { margin-bottom: 10px; }
    .login-tabs a { padding: 6px 8px; }
}

.auth-track { align-items: flex-start; }
.auth-switch { flex-shrink: 0; }
.login-right { justify-content: safe center; }

.fp-steps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.fp-steps li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; color: rgba(255,255,255,.55); transition: background .2s; }
.fp-steps li strong { display: block; font-size: 14px; color: rgba(255,255,255,.75); font-weight: 600; }
.fp-steps li small { display: block; font-size: 12px; margin-top: 2px; line-height: 1.5; }
.fp-steps li.is-current { background: rgba(255,255,255,.08); box-shadow: inset 3px 0 0 var(--gold); }
.fp-steps li.is-current strong { color: #fff; }
.fp-steps li.is-current small { color: rgba(255,255,255,.75); }
.fp-step-dot {
    flex: 0 0 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; border: 1.5px solid rgba(255,255,255,.35); color: rgba(255,255,255,.75);
}
.fp-steps li.is-current .fp-step-dot { background: var(--gold); border-color: var(--gold); color: var(--on-gold); }
.fp-steps li.is-done .fp-step-dot { background: rgba(255,255,255,.15); border-color: transparent; color: var(--gold); }
.fp-secure { display: flex; align-items: center; gap: 8px; margin-top: 18px; font-size: 12px; color: rgba(255,255,255,.6); }
.fp-right { gap: 0; }
.fp-back { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--ink-2); text-decoration: none; margin-bottom: 18px; }
.fp-back:hover { color: var(--ink); }
.fp-progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.fp-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--brown-mid), var(--gold)); border-radius: inherit; transition: width .4s ease; }
.fp-stepnum { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin: 8px 0 18px; }
.fp-head { text-align: center; margin-bottom: 6px; }
.fp-head h2 { text-align: center; }
.fp-head .subtitle { text-align: center; max-width: 34ch; margin-left: auto; margin-right: auto; }
.fp-input-icon { position: relative; }
.fp-input-icon .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.fp-input-icon input { padding-left: 40px !important; }
.fp-tips { list-style: none; margin: 20px 0 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; gap: 8px; }
.fp-tips li { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
.fp-tips li .icon { flex: 0 0 auto; color: var(--ink-2); margin-top: 1px; }
.fp-tips a { color: var(--ink-2); font-weight: 600; }
@media (max-width: 768px) {
    .fp-steps, .fp-secure { display: none; }
}

.reg-step { border: 1.5px solid var(--cream-dark, var(--border)); border-radius: 14px; padding: 16px 16px 4px; margin: 0 0 14px; background: var(--surface); }
.reg-step-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.reg-step-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--brown-mid); color: #fff; font-weight: 800; font-size: 13px; }
.reg-step-head h3 { margin: 0; font-size: 15px; font-weight: 800; color: var(--ink); }
.reg-step-head p { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.reg-step .addr-group { margin: 0; }
.reg-step .addr-group legend { display: none; }
.reg-step .form-group { margin-bottom: 12px; }
.login-right .reg-step select {
    width: 100%; min-width: 0; height: auto; padding: 12px 36px 12px 14px; font-size: 15px; background-color: var(--surface);
    border: 1.5px solid var(--cream-dark, var(--border)); border-radius: 10px; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.login-right .reg-step select:disabled { background-color: var(--cream, var(--surface-2)); }
.login-right .reg-step input:focus, .login-right .reg-step select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(61, 44, 32, .18); outline: none; }
.reg-step .pw-rule { display: block; margin-top: 6px; font-size: 12px; color: var(--text-muted); }
@media (max-width: 520px) { .reg-step { padding: 14px 12px 2px; } }
.verify-ways { margin: 0 0 16px; padding: 12px 14px 12px 32px; background: var(--surface); border: 1.5px solid var(--cream-dark, var(--border)); border-radius: 12px; font-size: 13.5px; color: var(--ink); line-height: 1.6; text-align: left; }
.verify-ways li + li { margin-top: 4px; }
