:root {
    --auth-blue: #0066cc;
    --auth-blue-dark: #003f8f;
    --auth-blue-soft: #eaf4ff;
    --auth-coral: #ff6b6b;
    --auth-coral-dark: #ed5151;
    --auth-ink: #172033;
    --auth-muted: #667085;
    --auth-border: #dce5f0;
    --auth-surface: #ffffff;
    --auth-success: #087a55;
    --auth-danger: #b42318;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: #f5f9ff;
}

body.auth-page {
    min-height: 100vh;
    margin: 0;
    color: var(--auth-ink);
    font-family: "Segoe UI", Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background:
        radial-gradient(circle at 12% 12%, rgba(77, 171, 247, 0.28), transparent 28rem),
        radial-gradient(circle at 88% 88%, rgba(255, 107, 107, 0.18), transparent 25rem),
        linear-gradient(135deg, #f7fbff 0%, #edf5ff 52%, #fff8f8 100%);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(300px, 0.95fr) minmax(420px, 1.05fr);
}

.auth-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(2rem, 5vw, 4.5rem);
    color: #fff;
    background: linear-gradient(145deg, var(--auth-blue) 0%, var(--auth-blue-dark) 100%);
}

.auth-brand::before,
.auth-brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.13);
}

.auth-brand::before {
    width: 28rem;
    height: 28rem;
    top: -12rem;
    right: -11rem;
    box-shadow: 0 0 0 4rem rgba(255, 255, 255, 0.035);
}

.auth-brand::after {
    width: 17rem;
    height: 17rem;
    left: -7rem;
    bottom: -7rem;
    box-shadow: 0 0 0 3rem rgba(255, 107, 107, 0.08);
}

.auth-brand-main,
.auth-brand-copy,
.auth-brand-foot {
    position: relative;
    z-index: 1;
}

.auth-brand-main {
    width: min(100%, 38rem);
    margin: auto;
}

.auth-brand-main::before,
.auth-brand-main::after {
    content: "";
    position: absolute;
    z-index: -1;
    background: rgba(255, 255, 255, 0.035);
    pointer-events: none;
}

.auth-brand-main::before {
    width: 25rem;
    height: 12rem;
    top: 1.5rem;
    left: -6.5rem;
    box-shadow: 14rem 12.5rem 0 rgba(255, 255, 255, 0.025);
}

.auth-brand-main::after {
    width: 22rem;
    height: 5rem;
    left: -6.5rem;
    bottom: -3.4rem;
    box-shadow: 5.5rem -5.7rem 0 rgba(255, 255, 255, 0.025);
}

.brand-logo {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.auth-brand-main > .brand-logo {
    display: flex;
    width: max-content;
    margin: 0 auto 2.25rem;
}

.brand-logo-image {
    display: block;
    width: clamp(9rem, 10vw, 10.5rem);
    height: auto;
    padding: 0.38rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 1.35rem;
    background: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 1.25rem 2.8rem rgba(0, 25, 72, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.auth-brand-copy {
    max-width: none;
    margin: 0;
    padding: 0;
}

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1.2rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.auth-brand h1 {
    max-width: none;
    margin: 0 0 0.45rem;
    font-size: clamp(3rem, 4.2vw, 4rem);
    line-height: 1.02;
    letter-spacing: -0.06em;
    white-space: nowrap;
}

.auth-brand-copy > p:last-child {
    max-width: 32rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.05rem;
    line-height: 1.75;
}

@media (max-width: 1100px) and (min-width: 821px) {
    .auth-brand-main {
        width: 100%;
    }

    .auth-brand-main > .brand-logo {
        margin-bottom: 1.75rem;
    }

    .auth-brand h1 {
        font-size: clamp(2.6rem, 5vw, 3.35rem);
        white-space: normal;
    }
}

.auth-brand-foot {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

.auth-brand-foot::before {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #66e3b4;
    box-shadow: 0 0 0 0.28rem rgba(102, 227, 180, 0.13);
}

.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.25rem, 5vw, 4rem);
}

.auth-card {
    width: min(100%, 31rem);
    padding: clamp(1.5rem, 4vw, 2.8rem);
    border: 1px solid rgba(220, 229, 240, 0.9);
    border-radius: 1.6rem;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1.5rem 4rem rgba(23, 55, 101, 0.13);
    backdrop-filter: blur(12px);
}

.auth-mobile-logo {
    display: none;
}

.auth-card h2 {
    margin: 0 0 0.55rem;
    font-size: clamp(1.75rem, 4vw, 2.2rem);
    line-height: 1.15;
    letter-spacing: -0.04em;
}

.auth-subtitle {
    margin: 0 0 1.8rem;
    color: var(--auth-muted);
    line-height: 1.6;
}

.auth-form {
    display: grid;
    gap: 1.15rem;
}

.auth-field {
    display: grid;
    gap: 0.5rem;
}

.auth-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.auth-field label {
    font-size: 0.9rem;
    font-weight: 700;
}

.auth-field a,
.auth-text-link {
    color: var(--auth-blue);
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.auth-field a:hover,
.auth-text-link:hover {
    text-decoration: underline;
}

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

.auth-control {
    width: 100%;
    min-height: 3.4rem;
    padding: 0.82rem 1rem;
    border: 1px solid var(--auth-border);
    border-radius: 0.9rem;
    outline: none;
    color: var(--auth-ink);
    background: #fff;
    font: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-control::placeholder {
    color: #98a2b3;
}

.auth-control:hover {
    border-color: #b8c9dc;
}

.auth-control:focus {
    border-color: var(--auth-blue);
    box-shadow: 0 0 0 0.24rem rgba(0, 102, 204, 0.12);
}

.auth-control.has-action {
    padding-right: 5.4rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 0.7rem;
    transform: translateY(-50%);
    width: 4.5rem;
    height: 2.4rem;
    border: 0;
    border-radius: 0.7rem;
    color: var(--auth-muted);
    background: transparent;
    cursor: pointer;
}

.password-toggle:hover {
    color: var(--auth-blue);
    background: var(--auth-blue-soft);
}

.auth-hint {
    margin: -0.1rem 0 0;
    color: var(--auth-muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.auth-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    min-height: 3.4rem;
    margin-top: 0.15rem;
    padding: 0.85rem 1.2rem;
    border: 0;
    border-radius: 0.9rem;
    color: #fff;
    background: linear-gradient(135deg, var(--auth-coral), var(--auth-coral-dark));
    box-shadow: 0 0.8rem 1.6rem rgba(255, 107, 107, 0.24);
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.auth-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 1rem 2rem rgba(255, 107, 107, 0.3);
}

.auth-button:disabled {
    opacity: 0.65;
    cursor: wait;
}

.auth-alert {
    margin: 0 0 1.2rem;
    padding: 0.85rem 1rem;
    border: 1px solid;
    border-radius: 0.85rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.auth-alert[hidden] {
    display: none;
}

.auth-alert--danger {
    border-color: #f3b8b3;
    color: var(--auth-danger);
    background: #fff3f2;
}

.auth-alert--success {
    border-color: #a9dec9;
    color: var(--auth-success);
    background: #ecfdf5;
}

.auth-footer-link {
    margin: 1.5rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid #edf1f6;
    color: var(--auth-muted);
    text-align: center;
    font-size: 0.9rem;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 820px) {
    .auth-shell {
        display: block;
    }

    .auth-brand {
        display: none;
    }

    .auth-main {
        min-height: 100vh;
        align-items: center;
        padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
    }

    .auth-card {
        width: min(100%, 32rem);
        border-radius: 1.35rem;
    }

    .auth-mobile-logo {
        display: flex;
        justify-content: center;
        width: max-content;
        margin: 0 auto 1.7rem;
    }

    .auth-mobile-logo .brand-logo-image {
        width: 8rem;
        padding: 0.32rem;
        border-color: rgba(0, 102, 204, 0.16);
        border-radius: 1.15rem;
        box-shadow: 0 1rem 2.2rem rgba(0, 70, 160, 0.2);
    }
}

@media (max-width: 430px) {
    body.auth-page {
        background: #fff;
    }

    .auth-main {
        align-items: flex-start;
        padding: max(1.4rem, env(safe-area-inset-top)) 1.1rem max(1.4rem, env(safe-area-inset-bottom));
    }

    .auth-card {
        padding: 0.5rem 0.15rem;
        border: 0;
        box-shadow: none;
        background: transparent;
    }

    .auth-mobile-logo {
        margin-bottom: 2rem;
    }

    .auth-card h2 {
        font-size: 1.85rem;
    }

    .auth-subtitle {
        margin-bottom: 1.55rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
