/* ===============================================================
   ToolDuck — authentication
   Loaded on /auth/… and reused by the mock API sign-in gate.
   =============================================================== */

/* The auth pages carry the site's ambient layer like every other page,
   so the card sits on it rather than hiding it: a translucent surface,
   a soft edge and the largest shadow in the scale. */
.auth-shell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 100%;
}

.auth-card {
    width: 100%;
    max-width: 26rem;
    margin: 0 auto;
    padding: 1.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    box-shadow: var(--shadow-lg);
}

.auth-card--wide { max-width: 44rem; }
.auth-card--message { text-align: center; }

.auth-card__title {
    margin: 0 0 .4rem;
    font-size: 1.35rem;
    text-align: center;
}

.auth-card--wide .auth-card__title,
.auth-card--message h1 { text-align: left; }

.auth-card--message h1 { margin: 0 0 .5rem; font-size: 1.25rem; }

.auth-lede {
    margin: 0 0 1.25rem;
    color: var(--ink-3);
    font-size: .92rem;
    line-height: 1.55;
    text-align: center;
}

.auth-card--wide .auth-lede,
.auth-card--message .auth-lede { text-align: left; }

/* ---------------------------------------------------------------
   Google button
   ---------------------------------------------------------------
   Follows Google's branding requirements: the official four-colour
   G, the approved wording, a white button, and no recolouring to
   match the site palette.
   --------------------------------------------------------------- */
.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    width: 100%;
    min-height: 44px;
    padding: .6rem 1rem;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: #ffffff;
    color: #1f1f1f;
    font-size: .95rem;
    font-weight: 500;
    text-decoration: none;
    transition: box-shadow .15s, border-color .15s, background .15s;
}

.google-btn:hover {
    border-color: var(--ink-4);
    box-shadow: 0 1px 3px rgba(17, 24, 39, .12);
    background: #fafafa;
}

.google-btn:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.google-btn__icon {
    display: inline-flex;
    flex: none;
}

.google-btn__text { font-family: inherit; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin: 1.1rem 0;
    color: var(--ink-4);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}

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

/* ---------------------------------------------------------------
   Forms
   --------------------------------------------------------------- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0;
}

.auth-form--inline { margin-top: 1rem; text-align: left; }

.auth-field {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.auth-field__label {
    font-size: .84rem;
    font-weight: 600;
    color: var(--ink-2);
}

.auth-field__help {
    font-size: .8rem;
    color: var(--ink-3);
    line-height: 1.5;
}

.auth-input {
    display: block;
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: .95rem;
    transition: border-color .15s, box-shadow .15s;
}

.auth-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}

.auth-submit {
    width: 100%;
    min-height: 44px;
    margin-top: .25rem;
}

.auth-alt {
    margin: 1.25rem 0 0;
    text-align: center;
    font-size: .88rem;
    color: var(--ink-3);
}

.auth-alt a { color: var(--brand-strong); font-weight: 500; }
.auth-alt__sep { padding: 0 .35rem; color: var(--ink-4); }

/* ---------------------------------------------------------------
   Messages
   --------------------------------------------------------------- */
.auth-flash-stack {
    width: 100%;
    max-width: 26rem;
    display: grid;
    gap: .5rem;
    margin: 0 auto;
}

.auth-flash {
    margin: 0;
    padding: .7rem .9rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    font-size: .88rem;
    line-height: 1.5;
}

.auth-flash--success { border-color: #a7f3d0; background: var(--ok-bg); color: var(--ok); }
.auth-flash--error { border-color: #fecaca; background: var(--err-bg); color: var(--err); }

.auth-errors {
    margin: 0 0 1rem;
    padding: .75rem .9rem .75rem 2rem;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: var(--err-bg);
    color: var(--err);
    font-size: .88rem;
    display: grid;
    gap: .3rem;
}

/* ---------------------------------------------------------------
   Account panel
   --------------------------------------------------------------- */
.auth-facts {
    display: grid;
    gap: .75rem;
    margin: 1.25rem 0 1.75rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-soft);
}

.auth-facts > div {
    display: flex;
    gap: 1rem;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
}

.auth-facts dt {
    font-size: .82rem;
    font-weight: 600;
    color: var(--ink-3);
    min-width: 9rem;
}

.auth-facts dd {
    margin: 0;
    font-size: .9rem;
    flex: 1 1 12rem;
    text-align: right;
    overflow-wrap: anywhere;
}

.auth-chip {
    display: inline-block;
    margin-left: .35rem;
    padding: .1rem .45rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: .74rem;
    color: var(--ink-3);
}

.auth-chip--ok { border-color: #a7f3d0; background: var(--ok-bg); color: var(--ok); }
.auth-chip--warn { border-color: #fcd34d; background: var(--warn-bg); color: var(--warn); }

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

.auth-section h2 {
    margin: 0 0 .75rem;
    font-size: 1rem;
}

.auth-section p { line-height: 1.55; }
.auth-section form + p { margin-top: .75rem; }

.auth-section--danger h2 { color: var(--err); }
.auth-danger { color: var(--err); }

.auth-note {
    margin: 0 0 1rem;
    padding: .65rem .85rem;
    border-radius: 8px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    font-size: .87rem;
    color: var(--ink-2);
}

.auth-note--warn { border-color: #fcd34d; background: var(--warn-bg); color: var(--warn); }
.auth-note--ok { border-color: #a7f3d0; background: var(--ok-bg); color: var(--ok); }

/* ---------------------------------------------------------------
   Sign-in gate on the mock API landing page
   --------------------------------------------------------------- */
.mock-create--gate { text-align: left; }

.mock-gate__carryover {
    margin: 0 0 1rem;
    padding: .6rem .85rem;
    border: 1px solid var(--brand-border);
    border-radius: 8px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-size: .87rem;
}

.mock-gate__actions {
    max-width: 24rem;
    display: flex;
    flex-direction: column;
}

.mock-gate__email { text-align: center; }
.mock-gate__alt { margin: .75rem 0 0; font-size: .87rem; color: var(--ink-3); }
.mock-gate__alt a { color: var(--brand-strong); font-weight: 500; }
