:root {
    --auth-primary: #2563eb;
    --auth-primary-dark: #1d4ed8;
    --auth-navy: #0f172a;
    --auth-text: #172033;
    --auth-muted: #64748b;
    --auth-border: #dbe4f0;
    --auth-surface: rgba(255, 255, 255, .94);
    --auth-success: #16a34a;
    --auth-danger: #dc2626;
    --auth-warning: #d97706;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body.auth-body {
    min-height: 100vh;
    margin: 0;
    color: var(--auth-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 10% 15%, rgba(37, 99, 235, .18), transparent 29%),
        radial-gradient(circle at 87% 18%, rgba(14, 165, 233, .16), transparent 26%),
        radial-gradient(circle at 55% 95%, rgba(79, 70, 229, .13), transparent 34%),
        linear-gradient(135deg, #eef5ff 0%, #f8fafc 48%, #edf3ff 100%);
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 18px;
    position: relative;
    overflow: hidden;
}

.auth-page::before,
.auth-page::after {
    content: "";
    position: fixed;
    border-radius: 999px;
    filter: blur(1px);
    pointer-events: none;
}

.auth-page::before {
    width: 430px;
    height: 430px;
    top: -180px;
    left: -150px;
    background: linear-gradient(135deg, rgba(37, 99, 235, .27), rgba(99, 102, 241, .08));
}

.auth-page::after {
    width: 390px;
    height: 390px;
    right: -145px;
    bottom: -170px;
    background: linear-gradient(135deg, rgba(14, 165, 233, .22), rgba(37, 99, 235, .08));
}

.auth-wrap {
    width: 100%;
    max-width: 1120px;
    position: relative;
    z-index: 2;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(390px, .9fr);
    min-height: 650px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .88);
    border-radius: 34px;
    background: rgba(255, 255, 255, .58);
    box-shadow: 0 35px 90px rgba(15, 23, 42, .18);
    backdrop-filter: blur(22px);
}

.auth-shell.auth-shell-wide {
    grid-template-columns: minmax(0, 1fr) minmax(470px, .92fr);
}

.auth-brand {
    position: relative;
    overflow: hidden;
    padding: 52px;
    color: #fff;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, .2), transparent 29%),
        linear-gradient(145deg, #0b1220 0%, #142c62 46%, #2563eb 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-brand::before,
.auth-brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .10);
}

.auth-brand::before {
    width: 270px;
    height: 270px;
    right: -90px;
    top: -100px;
}

.auth-brand::after {
    width: 210px;
    height: 210px;
    left: -80px;
    bottom: -80px;
}

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

.auth-logo {
    width: 78px;
    height: 78px;
    margin-bottom: 28px;
    border-radius: 24px;
    background: rgba(255, 255, 255, .97);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .21);
}

.auth-logo img { width: 64px; height: 64px; object-fit: contain; }
.auth-logo i { display: none; color: var(--auth-primary); font-size: 34px; }

.auth-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    background: rgba(255, 255, 255, .11);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.auth-brand-title {
    max-width: 570px;
    margin: 0 0 18px;
    font-size: clamp(35px, 4.2vw, 54px);
    line-height: 1.03;
    font-weight: 900;
    letter-spacing: -1.7px;
}

.auth-brand-text {
    max-width: 560px;
    margin: 0 0 34px;
    color: rgba(255, 255, 255, .80);
    font-size: 16px;
    line-height: 1.75;
}

.auth-features { display: grid; gap: 15px; max-width: 520px; }

.auth-feature {
    display: flex;
    align-items: center;
    gap: 13px;
    color: rgba(255, 255, 255, .92);
    font-size: 14px;
}

.auth-feature-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .15);
    background: rgba(255, 255, 255, .12);
}

.auth-brand-footer { color: rgba(255, 255, 255, .64); font-size: 12px; }

.auth-form-side {
    padding: 40px 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(248, 250, 252, .74);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 34px 31px;
    border: 1px solid rgba(255, 255, 255, .95);
    border-radius: 28px;
    background: var(--auth-surface);
    box-shadow: 0 24px 66px rgba(15, 23, 42, .12);
    backdrop-filter: blur(16px);
}

.auth-card.auth-card-wide { max-width: 475px; }

.auth-mobile-logo {
    display: none;
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(37, 99, 235, .16);
}

.auth-mobile-logo img { width: 59px; height: 59px; object-fit: contain; }

.auth-kicker {
    margin-bottom: 8px;
    color: var(--auth-primary);
    font-size: 12px;
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.auth-title {
    margin: 0 0 8px;
    color: #111827;
    font-size: 27px;
    line-height: 1.2;
    font-weight: 900;
    letter-spacing: -.7px;
    text-align: center;
}

.auth-subtitle {
    margin: 0 0 24px;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    padding: 13px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.5;
}

.auth-alert-danger { color: #991b1b; border: 1px solid #fecaca; background: #fef2f2; }
.auth-alert-success { color: #166534; border: 1px solid #bbf7d0; background: #f0fdf4; }
.auth-alert-warning { color: #92400e; border: 1px solid #fde68a; background: #fffbeb; }

.auth-label {
    margin-bottom: 7px;
    color: #243147;
    font-size: 13px;
    font-weight: 800;
}

.auth-input-wrap { position: relative; }

.auth-input-icon {
    position: absolute;
    z-index: 3;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 15px;
}

.auth-control {
    width: 100%;
    height: 52px;
    padding: 0 15px 0 44px;
    border: 1px solid var(--auth-border);
    border-radius: 16px;
    outline: none;
    color: #0f172a;
    background: #fff;
    font-size: 14px;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.auth-control::placeholder { color: #94a3b8; }

.auth-control:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 .22rem rgba(37, 99, 235, .13);
}

.auth-control.password-field { padding-right: 50px; }

.auth-toggle-password {
    position: absolute;
    z-index: 5;
    right: 9px;
    top: 50%;
    width: 36px;
    height: 36px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-toggle-password:hover { color: var(--auth-primary); background: #eff6ff; }

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 3px 0 22px;
}

.auth-check { display: flex; align-items: center; gap: 8px; }
.auth-check input { width: 16px; height: 16px; accent-color: var(--auth-primary); }
.auth-check label { color: var(--auth-muted); font-size: 13px; cursor: pointer; }

.auth-link {
    color: var(--auth-primary);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.auth-link:hover { color: var(--auth-primary-dark); text-decoration: underline; }

.auth-button {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 16px;
    color: #fff;
    font-size: 15px;
    font-weight: 900;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.auth-button:hover { transform: translateY(-1px); filter: saturate(1.08); }
.auth-button:active { transform: translateY(0); }

.auth-button-primary {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    box-shadow: 0 16px 34px rgba(37, 99, 235, .28);
}

.auth-button-success {
    background: linear-gradient(135deg, #16a34a, #15803d);
    box-shadow: 0 16px 34px rgba(22, 163, 74, .24);
}

.auth-secondary-action {
    margin-top: 21px;
    color: var(--auth-muted);
    font-size: 13px;
    text-align: center;
}

.auth-secondary-action a { color: var(--auth-primary); font-weight: 900; text-decoration: none; }
.auth-secondary-action a:hover { text-decoration: underline; }

.auth-security-note {
    display: flex;
    gap: 10px;
    margin-top: 21px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 17px;
    color: #64748b;
    background: #f8fafc;
    font-size: 12px;
    line-height: 1.55;
}

.auth-security-note i { color: #16a34a; font-size: 17px; }

.auth-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.password-meter { height: 6px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: #e2e8f0; }
.password-meter span { display: block; width: 0; height: 100%; border-radius: inherit; transition: width .2s ease, background .2s ease; }
.password-hint { margin-top: 7px; color: #64748b; font-size: 11px; }

.code-box {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.code-box input {
    height: 52px;
    padding: 0;
    border: 1px solid var(--auth-border);
    border-radius: 13px;
    outline: none;
    background: #fff;
    color: #0f172a;
    font-size: 21px;
    font-weight: 900;
    text-align: center;
}

.code-box input:focus { border-color: var(--auth-primary); box-shadow: 0 0 0 .18rem rgba(37, 99, 235, .12); }

.auth-step-list { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 20px; }
.auth-step-dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; }
.auth-step-dot.active { width: 24px; border-radius: 99px; background: var(--auth-primary); }

.auth-help { margin-top: 12px; color: #64748b; font-size: 11px; line-height: 1.5; text-align: center; }

@media (max-width: 991px) {
    .auth-wrap { max-width: 540px; }
    .auth-shell, .auth-shell.auth-shell-wide { display: block; min-height: auto; border-radius: 30px; }
    .auth-brand { display: none; }
    .auth-form-side { min-height: calc(100vh - 64px); padding: 22px; }
    .auth-card, .auth-card.auth-card-wide { max-width: 100%; }
    .auth-mobile-logo { display: flex; }
}

@media (max-width: 520px) {
    .auth-page { padding: 14px 10px; }
    .auth-form-side { padding: 12px; }
    .auth-card { padding: 27px 20px; border-radius: 24px; }
    .auth-grid-2 { grid-template-columns: 1fr; gap: 0; }
    .auth-options { align-items: flex-start; flex-direction: column; }
    .code-box { gap: 5px; }
    .code-box input { height: 48px; border-radius: 11px; font-size: 18px; }
}
