/* Recompensated authentication experience.
 * Uses the shared theme tokens. Dark-only — this codebase has no light theme.
 */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

html {
    background: var(--bg-base);
}

body.auth-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    background: var(--bg-base);
    color: var(--text-body);
    font-family: "Poppins", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
}

.auth-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(39rem, 1.08fr) minmax(31rem, 0.92fr);
    background: var(--bg-base);
}

/* -------------------------------------------------------------------------
 * Desktop showcase
 * ---------------------------------------------------------------------- */

.auth-showcase {
    --showcase-bg: rgb(7, 13, 20);
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    min-height: 43rem;
    overflow: hidden;
    isolation: isolate;
    padding: clamp(1.6rem, 3vw, 3rem);
    color: rgb(246, 248, 255);
    background:
        radial-gradient(38rem 28rem at 50% 54%, rgba(52, 240, 181, 0.13), transparent 68%),
        radial-gradient(28rem 24rem at 8% 0%, rgba(56, 189, 248, 0.14), transparent 70%),
        radial-gradient(26rem 24rem at 100% 100%, rgba(16, 185, 129, 0.12), transparent 72%),
        var(--showcase-bg);
}

.auth-showcase::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    opacity: 0.22;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.10) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.10) 1px, transparent 1px);
    background-size: 3.5rem 3.5rem;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent 76%);
}

.auth-showcase::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: min(38vw, 34rem);
    aspect-ratio: 1;
    left: 50%;
    top: 43%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(52, 240, 181, 0.12);
    border-radius: 50%;
    box-shadow:
        0 0 0 4.5rem rgba(52, 240, 181, 0.025),
        0 0 0 9rem rgba(56, 189, 248, 0.018);
}

.auth-showcase__glow {
    position: absolute;
    z-index: -1;
    width: 54%;
    height: 11rem;
    left: 23%;
    top: 59%;
    border-radius: 50%;
    background: rgba(52, 240, 181, 0.16);
    filter: blur(3.4rem);
    transform: perspective(10rem) rotateX(62deg);
}

.auth-showcase__brand,
.auth-toolbar__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.72rem;
    color: inherit;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 750;
    letter-spacing: -0.025em;
}

.auth-showcase__brand {
    position: relative;
    z-index: 8;
}

.auth-showcase__brand img,
.auth-toolbar__brand img {
    width: 2.55rem;
    height: 2.55rem;
    border-radius: 0.82rem;
    box-shadow: 0 0.65rem 1.8rem rgba(16, 185, 129, 0.23);
}

.auth-showcase__copy {
    position: absolute;
    z-index: 5;
    top: clamp(6.2rem, 12vh, 8.5rem);
    left: clamp(2rem, 5vw, 5.5rem);
    right: clamp(2rem, 5vw, 5.5rem);
    text-align: center;
}

.auth-heading__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.78rem;
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 750;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.auth-showcase__copy h2 {
    max-width: 43rem;
    margin: 0 auto;
    color: rgb(246, 248, 255);
    font-size: clamp(2.05rem, 3.2vw, 3.4rem);
    line-height: 1.04;
    letter-spacing: -0.052em;
}

.auth-showcase__copy > p:last-child {
    max-width: 38rem;
    margin: 0.9rem auto 0;
    color: rgba(216, 222, 240, 0.76);
    font-size: clamp(0.78rem, 1vw, 0.95rem);
    line-height: 1.68;
}

.auth-laptop {
    position: absolute;
    z-index: 4;
    width: min(96%, 54rem);
    aspect-ratio: 1313 / 832;
    left: 50%;
    top: clamp(15.5rem, 32vh, 18.5rem);
    transform: translateX(-50%);
    filter:
        drop-shadow(0 2.2rem 2.4rem rgba(0, 0, 0, 0.52))
        drop-shadow(0 0 2.4rem rgba(52, 240, 181, 0.11));
    animation: auth-laptop-float 7s ease-in-out infinite;
}

.auth-laptop__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@keyframes auth-laptop-float {
    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-0.45rem);
    }
}

/* -------------------------------------------------------------------------
 * Form side
 * ---------------------------------------------------------------------- */

.auth-form-side {
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 1.25rem clamp(2rem, 4.2vw, 4.75rem) 3rem;
    background:
        radial-gradient(28rem 22rem at 100% 0%, var(--accent-dim), transparent 68%),
        var(--bg-base);
}

.auth-toolbar {
    width: 100%;
    min-height: 2.7rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
}

.auth-toolbar__brand {
    display: none;
    color: var(--text-primary);
}

.auth-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.auth-locale {
    display: inline-flex;
    padding: 0.2rem;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    background: var(--bg-surface);
}

.auth-locale a {
    min-width: 2.25rem;
    padding: 0.35rem 0.45rem;
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.66rem;
    font-weight: 750;
    letter-spacing: 0.05em;
    text-align: center;
    text-decoration: none;
    transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.auth-locale a:hover {
    color: var(--text-primary);
}

.auth-locale a.is-active {
    background: var(--bg-card);
    box-shadow: var(--shadow-xs);
    color: var(--accent);
}

.auth-form-wrap {
    width: 100%;
    max-width: 31.5rem;
    margin: auto;
    padding: clamp(2rem, 5.5vh, 4.5rem) 0 1rem;
}

.auth-shell--register .auth-form-wrap {
    max-width: 34rem;
    padding-top: clamp(1.25rem, 2.8vh, 2.5rem);
}

.auth-heading {
    margin-bottom: 1.65rem;
}

.auth-heading__eyebrow {
    margin-bottom: 0.62rem;
}

.auth-heading h1 {
    margin: 0;
    color: var(--text-primary);
    font-size: clamp(1.85rem, 3vw, 2.55rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.auth-heading > p:last-child {
    max-width: 29rem;
    margin: 0.72rem 0 0;
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.65;
}

.auth-google-button,
.auth-submit-button {
    width: 100%;
    min-height: 3.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.68rem;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.auth-google-button {
    border: 1px solid var(--border-strong);
    background: var(--bg-surface);
    color: var(--text-body);
}

.auth-google-button:hover {
    border-color: var(--accent-border);
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.auth-google-button i {
    color: var(--accent);
    font-size: 1rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin: 1.35rem 0;
    color: var(--text-faint);
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.auth-divider span {
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.025em;
    white-space: nowrap;
}

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

.auth-field {
    min-width: 0;
}

.auth-field label,
.auth-field__label-row {
    color: var(--text-body);
    font-size: 0.72rem;
    font-weight: 650;
}

.auth-field > label,
.auth-field__label-row {
    display: flex;
    margin-bottom: 0.46rem;
}

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

.auth-field__label-row a {
    color: var(--accent);
    font-weight: 650;
    text-decoration: none;
}

.auth-field__label-row a:hover,
.auth-switch a:hover,
.auth-check a:hover {
    text-decoration: underline;
    text-underline-offset: 0.18rem;
}

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

.auth-input-wrap > i {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 1rem;
    color: var(--text-faint);
    font-size: 0.83rem;
    transform: translateY(-50%);
    pointer-events: none;
}

.auth-input-wrap input {
    width: 100%;
    min-height: 3.25rem;
    padding: 0.78rem 2.95rem 0.78rem 2.65rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    outline: none;
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 0.82rem;
    line-height: 1.2;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.auth-input-wrap input::placeholder {
    color: var(--text-faint);
    opacity: 0.74;
}

.auth-input-wrap input:hover {
    border-color: var(--border-strong);
}

.auth-input-wrap input:focus {
    border-color: var(--accent);
    background: var(--bg-surface-hover);
    box-shadow: var(--focus-ring);
}

.auth-input-wrap input.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-dim);
}

.auth-password-toggle {
    position: absolute;
    z-index: 3;
    top: 50%;
    right: 0.72rem;
    width: 2rem;
    height: 2rem;
    display: grid;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-faint);
    cursor: pointer;
    transform: translateY(-50%);
}

.auth-password-toggle:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.auth-password-toggle .fa-eye-slash {
    display: none;
}

.auth-password-toggle.is-revealed .fa-eye {
    display: none;
}

.auth-password-toggle.is-revealed .fa-eye-slash {
    display: inline-block;
}

.auth-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.auth-field-error {
    margin: 0.38rem 0 0;
    color: var(--danger);
    font-size: 0.68rem;
    line-height: 1.45;
}

.auth-field-error--standalone {
    margin-top: -0.65rem;
}

.auth-check {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.68rem;
    color: var(--text-muted);
    font-size: 0.69rem;
    line-height: 1.55;
    cursor: pointer;
}

.auth-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.auth-check__box {
    width: 1.12rem;
    height: 1.12rem;
    display: grid;
    flex: 0 0 auto;
    margin-top: 0.04rem;
    place-items: center;
    border: 1px solid var(--border-strong);
    border-radius: 0.34rem;
    background: var(--bg-surface);
    color: transparent;
    font-size: 0.54rem;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.auth-check input:checked + .auth-check__box {
    border-color: var(--accent);
    background: var(--accent);
    color: rgb(4, 18, 14);
}

.auth-check input:focus-visible + .auth-check__box {
    box-shadow: var(--focus-ring);
}

.auth-check a {
    color: var(--accent);
    font-weight: 650;
    text-decoration: none;
}

.auth-consents {
    display: grid;
    gap: 0.68rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
}

.auth-check--optional {
    color: var(--text-faint);
}

.auth-submit-button {
    border: 1px solid var(--accent);
    background: var(--accent);
    box-shadow: 0 0.72rem 1.6rem var(--glow-accent);
    color: rgb(4, 18, 14);
    cursor: pointer;
}

.auth-submit-button:hover {
    border-color: var(--accent-hover);
    background: var(--accent-hover);
    box-shadow: 0 0.9rem 2rem var(--glow-accent);
    transform: translateY(-1px);
}

.auth-submit-button:active {
    transform: translateY(0);
}

.auth-submit-button i {
    font-size: 0.72rem;
    transition: transform 160ms ease;
}

.auth-submit-button:hover i {
    transform: translateX(0.2rem);
}

.auth-switch {
    margin: 1.25rem 0 0;
    color: var(--text-muted);
    font-size: 0.76rem;
    text-align: center;
}

.auth-switch a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.auth-secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.48rem;
    margin-top: 1.6rem;
    color: var(--text-faint);
    font-size: 0.63rem;
}

.auth-secure-note i {
    color: var(--accent);
}

.auth-locale a:focus-visible,
.auth-google-button:focus-visible,
.auth-submit-button:focus-visible,
.auth-password-toggle:focus-visible,
.auth-switch a:focus-visible,
.auth-field__label-row a:focus-visible,
.auth-toolbar__brand:focus-visible,
.auth-showcase__brand:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* -------------------------------------------------------------------------
 * Responsive behavior
 * ---------------------------------------------------------------------- */

@media (max-width: 80rem) {
    .auth-shell {
        grid-template-columns: minmax(35rem, 1fr) minmax(29rem, 0.9fr);
    }
}

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

    .auth-showcase {
        display: none;
    }

    .auth-form-side {
        min-height: 100vh;
        min-height: 100dvh;
        padding: 1rem clamp(1.2rem, 7vw, 4.5rem) 2.5rem;
    }

    .auth-toolbar {
        justify-content: space-between;
    }

    .auth-toolbar__brand {
        display: inline-flex;
    }

    .auth-form-wrap,
    .auth-shell--register .auth-form-wrap {
        max-width: 34rem;
        padding-top: clamp(2.25rem, 7vh, 5rem);
    }
}

@media (max-width: 38rem) {
    .auth-form-side {
        padding-inline: 1.1rem;
    }

    .auth-toolbar__brand span {
        display: none;
    }

    .auth-heading {
        margin-bottom: 1.35rem;
    }

    .auth-heading h1 {
        font-size: 1.85rem;
    }

    .auth-heading > p:last-child {
        font-size: 0.8rem;
    }

    .auth-field-grid {
        grid-template-columns: 1fr;
        gap: 1.05rem;
    }

    .auth-google-button,
    .auth-submit-button,
    .auth-input-wrap input {
        min-height: 3.15rem;
    }

    .auth-consents {
        padding: 0.78rem;
    }
}

@media (max-width: 25rem) {
    .auth-toolbar__actions {
        gap: 0.45rem;
    }

    .auth-locale a {
        min-width: 2rem;
    }

    .auth-form-wrap,
    .auth-shell--register .auth-form-wrap {
        padding-top: 1.6rem;
    }

    .auth-divider span {
        font-size: 0.62rem;
    }
}

@media (max-height: 47rem) and (min-width: 68.8125rem) {
    .auth-showcase__copy {
        top: 4.8rem;
    }

    .auth-showcase__copy h2 {
        font-size: clamp(1.8rem, 2.8vw, 2.7rem);
    }

    .auth-laptop {
        top: 12.8rem;
        width: min(90%, 45rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto;
        animation-duration: 0.01ms;
        animation-iteration-count: 1;
        transition-duration: 0.01ms;
    }
}
