/*
 * Auth screens — a split-screen shell built on the same design tokens as the
 * marketing pages (--bg / --surface / --accent / --font-display / --font-sans),
 * so signing in feels like the same product as the home page.
 */

.auth-shell {
    display: grid;
    min-height: 100vh;
    min-height: 100svh;
    background: var(--bg);
}

@media (width >= 1024px) {
    .auth-shell {
        grid-template-columns: 1fr 1fr;
    }

    /* Longer forms (register) get more room than the picture. */
    .auth-shell--wide {
        grid-template-columns: 1.2fr 1fr;
    }

    /* Puts the picture first so a screen reads differently from its sibling. */
    .auth-shell--reverse .auth-panel {
        order: -1;
    }
}

/* ---------------------------------------------------------------- form side */

.auth-form-col {
    display: flex;
    flex-direction: column;
    padding: 2rem 1.25rem 2.75rem;
}

@media (width >= 640px) {
    .auth-form-col {
        padding: 2.5rem 2rem 3rem;
    }
}

@media (width >= 1024px) {
    .auth-form-col {
        padding: 3rem 4rem;
    }
}

.auth-form-col__inner {
    width: 100%;
    max-width: 26.5rem;
    margin-inline: auto;
    margin-block: auto;
}

.auth-shell--wide .auth-form-col__inner {
    max-width: 30rem;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    margin-bottom: 2.75rem;
}

.auth-brand img {
    width: auto;
    height: 2.25rem;
    max-width: 9rem;
    object-fit: contain;
}

.auth-eyebrow {
    margin-bottom: 0.75rem;
    font-family: var(--font-sans);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

.auth-heading {
    margin-bottom: 0.75rem;
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--text);
}

.auth-heading .accent {
    color: var(--accent);
}

.auth-sub {
    margin-bottom: 2rem;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--muted);
}

/* ------------------------------------------------------------------- fields */

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

.auth-label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: var(--font-sans);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.auth-field {
    position: relative;
}

.auth-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.auth-input::placeholder {
    color: var(--muted);
}

.auth-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-input:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Leaves room for the reveal button on password fields. */
.auth-field:has(.auth-field__toggle) .auth-input {
    padding-right: 3rem;
}

.auth-field__toggle {
    position: absolute;
    inset-block: 0;
    right: 0.35rem;
    display: flex;
    align-items: center;
    padding-inline: 0.65rem;
    font-size: 0.875rem;
    color: var(--muted);
    background: none;
    border: 0;
    cursor: pointer;
    transition: color 0.15s ease;
}

.auth-field__toggle:hover,
.auth-field__toggle:focus-visible {
    color: var(--accent);
    outline: none;
}

.auth-error {
    margin-top: 0.4rem;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #f87171;
}

.auth-hint {
    margin-top: 0.4rem;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    color: var(--muted);
}

.auth-ok {
    margin-top: 0.4rem;
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    color: var(--accent);
}

.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--muted);
    cursor: pointer;
}

.auth-check input {
    flex: none;
    width: 1rem;
    height: 1rem;
    margin-top: 0.1rem;
    accent-color: var(--accent);
}

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

.auth-link {
    font-family: var(--font-sans);
    color: var(--accent);
    text-decoration: none;
}

.auth-link:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-meta {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--muted);
}

.auth-submit {
    width: 100%;
    margin-top: 0.35rem;
}

.auth-foot {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* Status / notice banners */

.auth-note {
    padding: 0.85rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    line-height: 1.55;
    border-radius: 0.75rem;
    border: 1px solid;
}

.auth-note--ok {
    color: var(--text);
    background: var(--accent-soft);
    border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.auth-note--bad {
    color: #fca5a5;
    background: rgb(239 68 68 / 0.08);
    border-color: rgb(239 68 68 / 0.35);
}

/* ------------------------------------------------------------ picture panel */

.auth-panel {
    position: relative;
    display: none;
    overflow: hidden;
    background: var(--surface-2);
}

@media (width >= 1024px) {
    .auth-panel {
        display: block;
    }
}

.auth-panel__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-panel__scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgb(0 0 0 / 0.2) 0%,
        rgb(0 0 0 / 0.55) 45%,
        rgb(0 0 0 / 0.88) 100%
    );
}

.auth-panel__body {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    padding: 3.5rem;
    color: #fff;
}

.auth-panel__quote {
    margin-bottom: 1.1rem;
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 2.3vw, 2.5rem);
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: -0.02em;
}

.auth-panel__quote .accent {
    color: var(--accent);
}

.auth-panel__text {
    max-width: 30rem;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.65;
    color: rgb(255 255 255 / 0.72);
}

.auth-panel__points {
    display: grid;
    gap: 0.85rem;
    margin-top: 2.25rem;
    padding-top: 1.75rem;
    border-top: 1px solid rgb(255 255 255 / 0.14);
}

.auth-panel__point {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.5;
    color: rgb(255 255 255 / 0.82);
}

.auth-panel__point i {
    margin-top: 0.15rem;
    color: var(--accent);
}

/* Small print pinned under the form on every screen. */
.auth-legal {
    margin-top: 2.5rem;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--muted);
}

.auth-legal a {
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-legal a:hover {
    color: var(--accent);
}
