:root {
    --auth-navy: #071629;
    --auth-navy-2: #123257;
    --auth-blue: #245ea8;
    --auth-blue-hover: #194d8f;
    --auth-red: #d7193f;
    --auth-red-dark: #b31334;
    --auth-text: #172033;
    --auth-muted: #657184;
    --auth-line: #aeb7c3;
    --auth-soft: #f5f7fa;
    --auth-border: #d8dee7;
}

html,
body.auth-page { min-height: 100%; }

body.auth-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 77% 35%, rgba(72,112,163,.26), transparent 30%),
        linear-gradient(115deg, var(--auth-navy) 0%, #0b1f3a 52%, var(--auth-navy-2) 100%);
    color: var(--auth-text);
    font-family: Whitney, "Open Sans", "Source Sans 3", "Segoe UI", Arial, sans-serif;
    font-weight: 400;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: hidden;
}

.auth-page *,
.auth-page *::before,
.auth-page *::after { box-sizing: border-box; }

.auth-page button,
.auth-page input,
.auth-page select,
.auth-page textarea { font-family: inherit; }

.auth-page a,
.auth-page button,
.auth-page input,
.auth-page label { -webkit-tap-highlight-color: transparent; }

.auth-header {
    min-height: 76px;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    background: rgba(5,19,38,.92);
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,.10);
}

.auth-header__inner {
    width: min(1280px, calc(100% - 48px));
    margin: 0 auto;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-height: 44px;
    color: #fff;
    text-decoration: none;
    letter-spacing: .09em;
    font-weight: 700;
}

.auth-brand:hover,
.auth-brand:focus { color: #fff; }

.auth-brand__mark {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    color: #fff;
    background: var(--auth-red);
    font-size: 16px;
    line-height: 1;
    font-weight: 700;
    clip-path: polygon(0 0, 72% 0, 100% 50%, 72% 100%, 0 100%);
}

.auth-brand__name { font-size: 17px; }

.auth-main {
    position: relative;
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 64px 20px 72px;
    overflow: hidden;
}

.auth-main::before {
    content: "";
    position: absolute;
    width: 720px;
    height: 720px;
    right: -210px;
    top: -210px;
    border: 120px solid rgba(255,255,255,.035);
    transform: rotate(34deg);
    pointer-events: none;
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
}

.auth-shell--wide { max-width: 760px; }

.auth-panel {
    background: #fff;
    border: 0;
    box-shadow: 0 24px 70px rgba(0,0,0,.30);
    padding: 44px 46px 46px;
}

.auth-panel--help { padding-bottom: 36px; }

.auth-kicker {
    margin: 0 0 8px;
    color: var(--auth-red);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.auth-title {
    margin: 0;
    color: var(--auth-navy);
    font-size: 32px;
    line-height: 1.15;
    font-weight: 400;
    letter-spacing: -.015em;
}

.auth-subtitle {
    margin: 14px 0 30px;
    color: var(--auth-muted);
    font-size: 16px;
    line-height: 1.55;
    font-weight: 400;
}

.auth-field { margin-bottom: 25px; }

.auth-label {
    display: block;
    margin-bottom: 8px;
    color: #303a49;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
}

.auth-input-wrap { position: relative; }

.auth-input {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-bottom: 1px solid #a9b2bf;
    border-radius: 0;
    background: transparent;
    padding: 8px 0 12px;
    color: var(--auth-text);
    font-family: inherit;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.4;
    box-shadow: none;
}

.auth-input:focus {
    outline: none;
    border-bottom: 2px solid var(--auth-blue);
    box-shadow: none;
}

.auth-input::placeholder { color: #919aa7; font-weight: 400; }

.auth-password-input { padding-right: 78px; }

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 0;
    min-width: 48px;
    min-height: 44px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--auth-blue);
    padding: 4px 0 4px 10px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    touch-action: manipulation;
}

.auth-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: -3px;
    margin-bottom: 28px;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    font-size: 14px;
    font-weight: 400;
    color: var(--auth-text);
    cursor: pointer;
}

.auth-check input {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    accent-color: var(--auth-red);
}

.auth-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--auth-blue);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-link:hover,
.auth-link:focus { color: var(--auth-blue-hover); }

.auth-submit {
    width: 100%;
    min-height: 52px;
    border: 0;
    border-radius: 0;
    background: var(--auth-red);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .055em;
    text-transform: uppercase;
    transition: background-color .18s ease, transform .18s ease;
    touch-action: manipulation;
}

.auth-submit:hover,
.auth-submit:focus {
    background: var(--auth-red-dark);
    color: #fff;
}

.auth-submit:active { transform: translateY(1px); }

.auth-secondary-links {
    margin-top: 24px;
    padding-top: 23px;
    border-top: 1px solid var(--auth-border);
    display: grid;
    gap: 4px;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.5;
}

.auth-note {
    margin-top: 24px;
    padding: 15px 16px;
    background: #f7f9fb;
    border-left: 3px solid var(--auth-red);
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.55;
}

.auth-validation-summary {
    margin-bottom: 20px;
    color: #a51d2d;
    font-size: 13px;
}

.auth-validation-summary ul { margin-bottom: 0; padding-left: 18px; }

.auth-validation {
    display: block;
    margin-top: 6px;
    color: #a51d2d;
    font-size: 12px;
}

.auth-success-icon {
    width: 52px;
    height: 52px;
    margin-bottom: 20px;
    border: 2px solid var(--auth-blue);
    border-radius: 50%;
    color: var(--auth-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 600;
}

.auth-help-list { border-top: 1px solid var(--auth-border); }

.auth-help-item {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 28px;
    align-items: center;
    padding: 28px 0;
    border-bottom: 1px solid var(--auth-border);
}

.auth-help-item h2 {
    margin: 0;
    color: var(--auth-navy);
    font-size: 21px;
    font-weight: 500;
}

.auth-help-item p {
    max-width: 540px;
    margin: 9px 0 0;
    color: var(--auth-muted);
    font-size: 15px;
    line-height: 1.65;
}

.auth-help-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 156px;
    min-height: 48px;
    padding: 10px 18px;
    background: var(--auth-red);
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .035em;
    text-transform: uppercase;
    white-space: nowrap;
    touch-action: manipulation;
}

.auth-help-action:hover,
.auth-help-action:focus {
    background: var(--auth-red-dark);
    color: #fff;
}

.auth-help-action--secondary {
    background: #fff;
    color: var(--auth-blue);
    border: 1px solid var(--auth-blue);
}

.auth-help-action--secondary:hover,
.auth-help-action--secondary:focus {
    background: var(--auth-blue);
    color: #fff;
}

.auth-help-footer {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-top: 28px;
    color: var(--auth-muted);
    font-size: 13px;
}

.auth-footer {
    min-height: 64px;
    flex: 0 0 auto;
    background: rgba(5,19,38,.94);
    border-top: 1px solid rgba(255,255,255,.10);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    color: rgba(255,255,255,.55);
    font-size: 12px;
}

.auth-footer a { color: rgba(255,255,255,.82); }

/* Tablet landscape and large portrait tablets. */
@media (max-width: 1024px) {
    .auth-header__inner { width: min(100% - 40px, 900px); }
    .auth-main { padding: 52px 28px 60px; }
    .auth-shell { max-width: 500px; }
    .auth-shell--wide { max-width: 760px; }
    .auth-panel { padding: 42px; }
}

/* iPad Mini, Android tablets and compact tablet portrait. */
@media (max-width: 820px) {
    .auth-main {
        align-items: flex-start;
        padding-top: 44px;
        overflow: visible;
    }

    .auth-main::before {
        width: 560px;
        height: 560px;
        right: -260px;
        top: -170px;
        border-width: 96px;
    }

    .auth-shell,
    .auth-shell--wide { max-width: 560px; }
    .auth-panel { box-shadow: 0 18px 52px rgba(0,0,0,.24); }
}

@media (max-width: 700px) {
    .auth-help-item { grid-template-columns: 1fr; gap: 16px; }
    .auth-help-action { width: 100%; }
    .auth-help-footer { flex-direction: column; gap: 4px; }
}

/* Phones: iPhone, Pixel, Galaxy and similar widths. */
@media (max-width: 575.98px) {
    body.auth-page { background: var(--auth-navy); }

    .auth-header {
        min-height: calc(64px + env(safe-area-inset-top));
        padding-top: env(safe-area-inset-top);
        background: var(--auth-navy);
    }

    .auth-header__inner {
        width: 100%;
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    .auth-brand__mark { width: 30px; height: 30px; flex-basis: 30px; }
    .auth-brand__name { font-size: 16px; }

    .auth-main {
        display: block;
        padding: 0;
        overflow: visible;
        background: #fff;
    }

    .auth-main::before { display: none; }

    .auth-shell,
    .auth-shell--wide {
        max-width: none;
        min-height: 100%;
        margin: 0;
    }

    .auth-panel,
    .auth-panel--help {
        min-height: 100%;
        padding: 34px max(20px, env(safe-area-inset-right)) 38px max(20px, env(safe-area-inset-left));
        box-shadow: none;
    }

    .auth-title {
        font-size: clamp(28px, 8.5vw, 34px);
        line-height: 1.12;
    }

    .auth-subtitle { margin-bottom: 26px; }
    .auth-field { margin-bottom: 22px; }

    .auth-input {
        min-height: 50px;
        font-size: 16px;
    }

    .auth-row {
        align-items: stretch;
        flex-direction: column;
        gap: 2px;
        margin-bottom: 22px;
    }

    .auth-check,
    .auth-row > .auth-link { width: 100%; }
    .auth-submit { min-height: 54px; }

    .auth-note { margin-top: 20px; }

    .auth-footer {
        min-height: 58px;
        padding: 16px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    }
}

/* Very narrow devices and split-screen phone windows. */
@media (max-width: 380px) {
    .auth-panel,
    .auth-panel--help { padding-left: 17px; padding-right: 17px; }
    .auth-kicker { letter-spacing: .08em; }
    .auth-title { font-size: 27px; }
    .auth-secondary-links { font-size: 13px; }
}

/* Landscape phones and visible software keyboards. */
@media (max-height: 600px) and (orientation: landscape) {
    .auth-header { min-height: 56px; }
    .auth-main { align-items: flex-start; padding: 24px 20px 30px; overflow: visible; }
    .auth-panel { padding-top: 28px; padding-bottom: 30px; }
    .auth-footer { min-height: 50px; padding-top: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}

@media (hover: none) and (pointer: coarse) {
    .auth-submit:hover,
    .auth-help-action:hover { transform: none; }
    .auth-link,
    .auth-password-toggle,
    .auth-check { touch-action: manipulation; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-submit { transition: none; }
}
