/*
 * auth.css - sign-in, registration and password reset.
 *
 * One centred card on a soft brand wash, set in Poppins (A12). The form is the
 * page: there is no competing photo panel, and the same shell carries every
 * auth screen. The public site keeps Montserrat.
 */

/* The layers are linked individually by styles() in helpers.php, each with
   its own ?v=. They used to be @imported here, and an import carries no
   version - so a browser refetched this file and then served its OWN
   year-cached copy of every layer, and edits reached nobody who had visited
   before. Do not put the @imports back. */
:root {
    --gg-font: var(--gg-font-ui);
    --gg-font-display: var(--gg-font-ui);
}

.auth-body {
    min-height: 100svh;
    background:
        radial-gradient(circle at 8% 0%, rgba(21, 175, 106, 0.11), transparent 30rem),
        radial-gradient(circle at 100% 100%, rgba(245, 158, 11, 0.10), transparent 28rem),
        var(--gg-surface-alt);
    color: var(--gg-ink-800);
}

.auth-shell {
    width: min(100%, 31rem);
    min-height: 100svh;
    margin: 0 auto;
    padding: clamp(1.5rem, 5vh, 3rem) 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.4rem;
}

/* -------------------------------------------------------------------------
 * Brand above the card
 * ---------------------------------------------------------------------- */
.auth-brand {
    display: grid;
    justify-items: center;
    gap: 0.5rem;
    text-align: center;
}

.auth-brand__logo { display: inline-flex; }
.auth-brand__logo img { width: auto; height: 3.6rem; }

.auth-brand__tagline {
    margin: 0;
    color: var(--gg-ink-500);
    font-size: var(--gg-text-xs);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* -------------------------------------------------------------------------
 * The card
 * ---------------------------------------------------------------------- */
.auth-card {
    width: 100%;
    padding: clamp(1.5rem, 4vw, 2.25rem);
    background: var(--gg-surface);
    border: 1px solid var(--gg-border);
    border-radius: var(--gg-radius-lg);
    box-shadow:
        0 24px 60px -32px rgba(5, 41, 27, 0.38),
        0 2px 6px rgba(5, 41, 27, 0.04);
}

.auth-card__title {
    margin: 0 0 0.4rem;
    font-size: clamp(1.5rem, 1.25rem + 0.8vw, 1.9rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.025em;
    color: var(--gg-ink-900);
}

.auth-card__lead {
    margin: 0 0 1.4rem;
    color: var(--gg-ink-500);
    font-size: var(--gg-text-sm);
    line-height: 1.65;
}

.auth-card .alert { margin-bottom: 1rem; }

/* Compact, touch-sized fields. 16px keeps iOS from zooming the page. */
.auth-card .field { margin-bottom: 1rem; }
.auth-card .field:last-of-type { margin-bottom: 0; }

.auth-card .field label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--gg-ink-700);
    font-size: var(--gg-text-sm);
    font-weight: 600;
}

.auth-card .field input {
    width: 100%;
    min-height: 3rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--gg-border);
    border-radius: var(--gg-radius-md);
    background: var(--gg-surface);
    color: var(--gg-ink-900);
    font: inherit;
    font-size: 1rem;
    transition: border-color var(--gg-speed) var(--gg-ease), box-shadow var(--gg-speed) var(--gg-ease);
}

.auth-card .field input:hover { border-color: var(--gg-ink-300); }

.auth-card .field input:focus {
    outline: none;
    border-color: var(--gg-primary);
    box-shadow: 0 0 0 3px rgba(21, 175, 106, 0.16);
}

.auth-card .field input[aria-invalid="true"] { border-color: var(--gg-danger); }

.auth-card .field__hint {
    margin: 0.35rem 0 0;
    color: var(--gg-ink-500);
    font-size: var(--gg-text-xs);
    line-height: 1.55;
}

.auth-card .field__hint a { color: var(--gg-primary-strong); font-weight: 600; }
.auth-card .field__error { margin: 0.35rem 0 0; color: var(--gg-danger); font-size: var(--gg-text-xs); }
.auth-card .field__optional { color: var(--gg-ink-400); font-weight: 400; }

.auth-card__submit {
    width: 100%;
    min-height: 3rem;
    margin-top: 0.6rem;
    border-radius: var(--gg-radius-md);
    font-weight: 600;
    box-shadow: 0 10px 24px -14px rgba(12, 90, 58, 0.7);
}

/* A quiet "or" between the password form and Google. */
.auth-card__divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.1rem 0;
    color: var(--gg-ink-400);
    font-size: var(--gg-text-xs);
}
.auth-card__divider::before,
.auth-card__divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--gg-border);
}

/* White Google button, full width, keeping the .button language. */
.button--google {
    width: 100%;
    min-height: 3rem;
    border-radius: var(--gg-radius-md);
    background: #fff;
    border-color: var(--gg-border);
    color: var(--gg-ink-800);
}
.button--google:hover { background: var(--gg-surface-alt); border-color: var(--gg-ink-300); box-shadow: none; }
.button--google svg { width: 1.1rem; height: 1.1rem; flex: none; }

/* The other door: sign in <-> create account. */
.auth-card__alt {
    margin: 1.3rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--gg-border);
    text-align: center;
    color: var(--gg-ink-500);
    font-size: var(--gg-text-sm);
}
.auth-card__alt a { color: var(--gg-primary-strong); font-weight: 600; }

/* -------------------------------------------------------------------------
 * Foot of the page
 * ---------------------------------------------------------------------- */
.auth-foot {
    width: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.auth-foot__back {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex: none;
    color: var(--gg-ink-600);
    font-size: var(--gg-text-xs);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.auth-foot__back:hover { color: var(--gg-primary-strong); }
.auth-foot__back .icon { width: 0.9rem; height: 0.9rem; }

.auth-foot__note {
    margin: 0;
    color: var(--gg-ink-400);
    font-size: var(--gg-text-xs);
    text-align: right;
}

/* -------------------------------------------------------------------------
 * Reset-password channel tabs
 *
 * Plain links carrying ?channel=, not a script-driven toggle: a password
 * reset is exactly the page that must still work when something else on the
 * page has failed to load.
 * ---------------------------------------------------------------------- */
.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
    margin-bottom: 1.1rem;
    padding: 0.25rem;
    border-radius: var(--gg-radius-full);
    background: var(--gg-surface-alt);
}

.auth-tabs__tab {
    padding: 0.55rem 0.5rem;
    border-radius: var(--gg-radius-full);
    color: var(--gg-ink-500);
    font-size: var(--gg-text-sm);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: background var(--gg-speed) var(--gg-ease), color var(--gg-speed) var(--gg-ease);
}

.auth-tabs__tab.is-active { background: var(--gg-surface); color: var(--gg-green-800); box-shadow: var(--gg-shadow-sm); }
.auth-tabs__tab:hover:not(.is-active) { color: var(--gg-green-800); }

/* -------------------------------------------------------------------------
 * Smaller screens
 * ---------------------------------------------------------------------- */
@media (max-width: 30rem) {
    .auth-shell { padding: 1.1rem 0.9rem 1.5rem; gap: 1.1rem; }
    .auth-brand__logo img { height: 3rem; }
    .auth-card { padding: 1.35rem 1.15rem; }
    .auth-foot { flex-direction: column; gap: 0.45rem; text-align: center; }
    .auth-foot__note { text-align: center; }
}

/* A short window should scroll from the top, never hide the brand above it. */
@media (max-height: 46rem) {
    .auth-shell { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-card .field input,
    .auth-tabs__tab { transition: none; }
}
