:root {
    --auth-navy: #082a43;
    --auth-navy-deep: #031d31;
    --auth-blue: #0477a8;
    --auth-blue-bright: #0f92c5;
    --auth-ice: #eef7fb;
    --auth-line: #dce8ef;
    --auth-text: #10283b;
    --auth-muted: #63798a;
    --auth-success: #177b56;
    --auth-danger: #b42318;
}

.auth-page {
    background: #f6fafc;
    color: var(--auth-text);
}

.auth-main {
    min-height: calc(100vh - 82px);
    padding: clamp(34px, 6vw, 82px) 24px;
    background:
        radial-gradient(circle at 8% 18%, rgba(15, 146, 197, .11), transparent 28%),
        radial-gradient(circle at 92% 82%, rgba(4, 119, 168, .09), transparent 26%),
        linear-gradient(180deg, #f8fbfd 0%, #f2f8fb 100%);
}

.auth-wrap {
    width: min(1160px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, .94fr) minmax(430px, .78fr);
    border: 1px solid rgba(204, 222, 232, .9);
    border-radius: 32px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 34px 90px rgba(18, 56, 79, .13);
}

.auth-wrap-register {
    align-items: stretch;
}

.auth-story {
    position: relative;
    min-height: 690px;
    padding: clamp(42px, 6vw, 76px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    background:
        linear-gradient(145deg, rgba(3, 29, 49, .98), rgba(4, 73, 105, .97)),
        var(--auth-navy);
}

.auth-story::before,
.auth-story::after {
    content: '';
    position: absolute;
    border: 1px solid rgba(135, 213, 241, .16);
    border-radius: 50%;
}

.auth-story::before { width: 460px; height: 460px; right: -245px; top: -105px; }
.auth-story::after { width: 320px; height: 320px; left: -185px; bottom: -130px; }

.auth-story-glow {
    position: absolute;
    width: 280px;
    height: 280px;
    top: 30%;
    right: -120px;
    border-radius: 50%;
    background: rgba(21, 171, 219, .24);
    filter: blur(55px);
}

.auth-story-content,
.auth-security-card { position: relative; z-index: 1; }

.auth-kicker {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    background: rgba(255, 255, 255, .07);
    color: #bcecff;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.auth-story h2 {
    max-width: 520px;
    margin: 30px 0 20px;
    color: #fff;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(2.7rem, 5.2vw, 4.65rem);
    font-weight: 400;
    line-height: .98;
    letter-spacing: -.045em;
}

.auth-story-content > p {
    max-width: 510px;
    margin: 0;
    color: #c3d7e4;
    font-size: .98rem;
    line-height: 1.8;
}

.auth-story-steps { margin-top: 46px; display: grid; gap: 17px; }
.auth-story-steps div { display: flex; align-items: center; gap: 14px; }
.auth-story-steps span {
    width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center;
    border: 1px solid rgba(149, 222, 249, .26); border-radius: 50%; color: #8fe1ff;
    font-size: .69rem; font-weight: 700;
}
.auth-story-steps p { margin: 0; color: #e4f0f6; font-size: .87rem; }

.auth-personas { display: grid; gap: 12px; margin-top: 42px; }
.auth-personas article {
    display: flex; gap: 14px; align-items: center; padding: 16px;
    border: 1px solid rgba(255,255,255,.13); border-radius: 17px; background: rgba(255,255,255,.06);
}
.auth-personas article > i { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: rgba(104,207,244,.14); color: #91e2ff; font-size: 1.15rem; }
.auth-personas strong, .auth-personas span { display: block; }
.auth-personas strong { color: #fff; font-size: .91rem; }
.auth-personas span { margin-top: 3px; color: #bcd1dc; font-size: .75rem; }

.auth-security-card {
    display: flex; align-items: center; gap: 14px; padding: 17px 18px;
    border: 1px solid rgba(255, 255, 255, .13); border-radius: 18px; background: rgba(255, 255, 255, .08);
    backdrop-filter: blur(12px);
}
.auth-security-card > i { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 13px; background: #e8f8ff; color: var(--auth-blue); font-size: 1.2rem; }
.auth-security-card strong, .auth-security-card span { display: block; }
.auth-security-card strong { color: #fff; font-size: .84rem; }
.auth-security-card span { margin-top: 3px; color: #b8ccd8; font-size: .7rem; line-height: 1.5; }

.auth-card {
    position: relative;
    min-height: 690px;
    padding: clamp(38px, 5vw, 68px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
}
.auth-card-register { justify-content: flex-start; padding-top: 48px; }
.auth-card-topline { position: absolute; top: 0; left: 0; right: 0; height: 4px; background: #eaf2f6; }
.auth-card-topline span { display: block; width: 36%; height: 100%; background: linear-gradient(90deg, var(--auth-blue), #2bb7dc); }

.auth-heading { margin-bottom: 26px; }
.auth-heading-compact { margin-bottom: 18px; }
.auth-eyebrow { color: var(--auth-blue); font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.auth-heading h1 { margin: 8px 0 9px; color: var(--auth-text); font-family: Georgia, 'Times New Roman', serif; font-size: clamp(2.35rem, 4vw, 3.25rem); font-weight: 400; letter-spacing: -.04em; line-height: 1; }
.auth-heading p, .auth-step-heading p { margin: 0; color: var(--auth-muted); font-size: .82rem; line-height: 1.65; }
.auth-heading p strong, .auth-step-heading p strong { color: var(--auth-text); word-break: break-word; }

.auth-step-heading { margin-bottom: 22px; }
.auth-step-heading h2 { margin: 0 0 6px; color: var(--auth-text); font-size: 1.25rem; font-weight: 700; }

.auth-alert { margin-bottom: 18px; padding: 12px 14px; border: 1px solid #fecaca; border-radius: 12px; background: #fff5f5; color: var(--auth-danger); font-size: .78rem; line-height: 1.5; }
.auth-alert.is-success { border-color: #bbebd7; background: #effbf6; color: var(--auth-success); }

.auth-google, .auth-primary, .auth-secondary {
    min-height: 48px; border-radius: 13px; font-size: .82rem; font-weight: 700; text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.auth-google { display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--auth-line); background: #fff; color: var(--auth-text); }
.auth-google:hover { color: var(--auth-text); border-color: #b5cfdd; box-shadow: 0 8px 22px rgba(15, 72, 103, .08); }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 19px 0; color: #91a3af; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; flex: 1; background: var(--auth-line); }

.auth-field { display: block; margin-bottom: 16px; }
.auth-field > span:first-child { display: flex; justify-content: space-between; margin-bottom: 7px; color: #334e61; font-size: .74rem; font-weight: 700; }
.auth-field em { color: #91a4b0; font-size: .66rem; font-style: normal; font-weight: 500; }
.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input-wrap > i { position: absolute; left: 15px; color: #7c96a6; font-size: .95rem; pointer-events: none; }
.auth-input-wrap input, .auth-input-wrap select {
    width: 100%; min-height: 49px; border: 1px solid var(--auth-line); border-radius: 13px; outline: 0;
    background: #fbfdfe; color: var(--auth-text); padding: 11px 44px; font: inherit; font-size: .8rem;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.auth-input-wrap select { appearance: none; cursor: pointer; }
.auth-input-wrap:not(:has(> i)) input { padding-left: 14px; }
.auth-input-wrap input:focus, .auth-input-wrap select:focus { border-color: var(--auth-blue-bright); background: #fff; box-shadow: 0 0 0 4px rgba(15, 146, 197, .11); }
.auth-input-wrap input::placeholder { color: #9badb8; }
.auth-icon-button { position: absolute; right: 8px; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: #6d8797; cursor: pointer; }
.auth-icon-button:hover { background: var(--auth-ice); color: var(--auth-blue); }

.auth-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.auth-check { display: flex; align-items: flex-start; gap: 9px; margin: 5px 0 20px; color: var(--auth-muted); font-size: .72rem; line-height: 1.45; cursor: pointer; }
.auth-check input { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 1px; accent-color: var(--auth-blue); }
.auth-password-note { display: flex; gap: 7px; align-items: center; margin: -6px 0 18px; color: #718897; font-size: .68rem; }
.auth-password-note i { color: var(--auth-success); }

.auth-primary { width: 100%; display: flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid var(--auth-blue); background: linear-gradient(135deg, var(--auth-blue), #05618b); color: #fff; cursor: pointer; box-shadow: 0 10px 24px rgba(4, 119, 168, .22); }
.auth-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 13px 28px rgba(4, 119, 168, .29); }
.auth-primary:disabled { opacity: .65; cursor: wait; }
.auth-secondary { padding: 0 22px; border: 1px solid var(--auth-line); background: #fff; color: var(--auth-text); cursor: pointer; }
.auth-secondary:hover { border-color: #b6ceda; background: #f8fbfc; }
.auth-form-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; }

.auth-switch-copy { margin: 20px 0 0; text-align: center; color: var(--auth-muted); font-size: .73rem; }
.auth-switch-copy a, .auth-code-meta button { border: 0; background: transparent; color: var(--auth-blue); font-weight: 700; text-decoration: none; cursor: pointer; }
.auth-switch-copy a:hover, .auth-code-meta button:hover { text-decoration: underline; }
.auth-back { display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; margin: 0 0 28px; padding: 0; border: 0; background: transparent; color: var(--auth-muted); font-size: .73rem; font-weight: 700; cursor: pointer; }
.auth-back:hover { color: var(--auth-blue); }

.auth-otp { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; margin: 26px 0 20px; }
.auth-otp input { width: 100%; aspect-ratio: 1 / 1; max-height: 76px; border: 1px solid var(--auth-line); border-radius: 15px; outline: 0; background: #f8fbfd; color: var(--auth-navy); text-align: center; font-size: 1.6rem; font-weight: 700; }
.auth-otp input:focus { border-color: var(--auth-blue); background: #fff; box-shadow: 0 0 0 4px rgba(15, 146, 197, .11); }
.auth-code-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; color: var(--auth-muted); font-size: .7rem; }
.auth-code-meta span { display: flex; align-items: center; gap: 5px; }
.auth-code-meta button:disabled { color: #9cadb7; cursor: wait; text-decoration: none; }
.auth-help { display: flex; gap: 8px; margin: 18px 0 0; color: #8195a2; font-size: .68rem; line-height: 1.5; }

.auth-type-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 20px; padding: 5px; border: 1px solid var(--auth-line); border-radius: 15px; background: #f4f8fa; }
.auth-type-switch button { min-height: 43px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 11px; background: transparent; color: #69808f; font-size: .76rem; font-weight: 700; cursor: pointer; }
.auth-type-switch button[aria-selected="true"] { background: #fff; color: var(--auth-blue); box-shadow: 0 4px 14px rgba(23, 62, 84, .09); }

.auth-progress { display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; gap: 8px; margin-bottom: 24px; }
.auth-progress > i { height: 1px; background: #dfe9ee; }
.auth-progress > span { display: flex; align-items: center; gap: 6px; color: #91a3ae; font-size: .63rem; font-weight: 700; }
.auth-progress b { width: 23px; height: 23px; display: grid; place-items: center; border: 1px solid #d5e2e8; border-radius: 50%; background: #fff; color: #8aa0ad; font-size: .64rem; }
.auth-progress span.is-active { color: var(--auth-blue); }
.auth-progress span.is-active b { border-color: var(--auth-blue); background: var(--auth-blue); color: #fff; box-shadow: 0 0 0 4px rgba(4,119,168,.1); }
.auth-progress span.is-complete b { border-color: #86cfb3; background: #eaf8f2; color: var(--auth-success); }

.auth-spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: auth-spin .7s linear infinite; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

@media (max-width: 940px) {
    .auth-main { padding: 28px 16px 48px; }
    .auth-wrap { width: min(620px, 100%); grid-template-columns: 1fr; }
    .auth-story { min-height: 330px; padding: 42px; }
    .auth-story h2 { font-size: 3.2rem; }
    .auth-story-steps { display: none; }
    .auth-security-card { margin-top: 34px; }
    .auth-card { min-height: 0; padding: 46px; }
}

@media (max-width: 560px) {
    .auth-main { padding: 16px 10px 32px; }
    .auth-wrap { border-radius: 22px; }
    .auth-story { min-height: 270px; padding: 30px 24px; }
    .auth-story h2 { margin-top: 22px; font-size: 2.55rem; }
    .auth-story-content > p { font-size: .82rem; line-height: 1.65; }
    .auth-security-card { display: none; }
    .auth-card, .auth-card-register { padding: 36px 22px; }
    .auth-heading h1 { font-size: 2.25rem; }
    .auth-field-grid { grid-template-columns: 1fr; gap: 0; }
    .auth-progress > span { font-size: 0; gap: 0; }
    .auth-progress b { font-size: .64rem; }
    .auth-form-actions { grid-template-columns: 1fr; }
    .auth-secondary { min-height: 44px; order: 2; }
    .auth-otp { gap: 8px; }
    .auth-otp input { border-radius: 12px; font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-page *, .auth-page *::before, .auth-page *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; }
}
