/* client/css/auth.css
 * Standalone auth pages (login, signup, waitlist).
 *
 * Visual language inspired by monarch.com's auth flow:
 *   • Centered narrow card on a warm/ivory background
 *   • Logo + brand mark above the card, never inside it
 *   • Generous whitespace, soft 1px borders, large rounded inputs
 *   • Primary CTA fills the card width
 *   • Optional right-rail "testimonial" panel on signup
 *
 * Self-contained — no dependency on styles.css. v2.css is still
 * linked for shared favicon/meta consistency.
 */

:root {
    --auth-bg: #f6f1e6;
    --auth-bg-alt: #efe7d5;
    --auth-ink: #14281a;
    --auth-ink-soft: #4f5648;
    --auth-ink-quiet: #7d8472;
    --auth-line: rgba(20, 40, 25, 0.12);
    --auth-line-soft: rgba(20, 40, 25, 0.07);
    --auth-card-bg: #ffffff;
    --auth-primary: #1D6B4A;
    --auth-primary-dark: #144f37;
    --auth-primary-soft: #eef7f1;
    --auth-warn: #b34020;
    --auth-warm: #8a5a1f;
    --auth-warm-soft: #fffaf0;
    --auth-warm-line: #e6dfc8;
    --auth-shadow: 0 1px 2px rgba(20, 40, 25, 0.04), 0 8px 30px rgba(20, 40, 25, 0.06);
    --auth-radius: 14px;
    --auth-radius-lg: 18px;
}

.auth-body {
    margin: 0;
    min-height: 100vh;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--auth-ink);
    background: var(--auth-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ------------------------------------------------------------------
   Layout shell — centered (login + waitlist)
   ------------------------------------------------------------------ */
.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 24px clamp(20px, 5vw, 48px) 32px;
    box-sizing: border-box;
}

.auth-topbar {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--auth-ink);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.auth-brand img { width: 28px; height: 28px; }

.auth-topbar-link {
    font-size: 0.92rem;
    color: var(--auth-ink-soft);
}

.auth-topbar-link a {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
    margin-left: 4px;
}

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

.auth-main {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 32px 0;
}

/* ------------------------------------------------------------------
   Card
   ------------------------------------------------------------------ */
.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-line-soft);
    border-radius: var(--auth-radius-lg);
    padding: clamp(28px, 5vw, 44px);
    box-shadow: var(--auth-shadow);
    box-sizing: border-box;
}

.auth-card h1 {
    font-family: "Inter", system-ui, sans-serif;
    font-weight: 600;
    font-size: 1.55rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 0 0 6px;
    color: var(--auth-ink);
}

.auth-card p.lead {
    margin: 0 0 22px;
    color: var(--auth-ink-soft);
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-card form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-field-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--auth-ink-soft);
}

.auth-field-label .auth-optional {
    color: var(--auth-ink-quiet);
    font-weight: 400;
    margin-left: 4px;
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"] {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 14px;
    border-radius: 10px;
    border: 1px solid var(--auth-line);
    background: var(--auth-card-bg);
    color: var(--auth-ink);
    font: inherit;
    font-size: 0.98rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-card input:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(29, 107, 74, 0.15);
}

.auth-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 2px;
    font-size: 0.88rem;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-ink-soft);
    cursor: pointer;
    user-select: none;
}

.auth-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--auth-primary);
    cursor: pointer;
}

.auth-inline-link {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-inline-link:hover { text-decoration: underline; }

.auth-card button[type="submit"] {
    margin-top: 6px;
    padding: 13px 16px;
    border-radius: 10px;
    border: 0;
    background: var(--auth-primary);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.05s ease;
}

.auth-card button[type="submit"]:hover { background: var(--auth-primary-dark); }
.auth-card button[type="submit"]:active { transform: translateY(1px); }

.auth-card button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-card .form-error {
    color: var(--auth-warn);
    min-height: 1.2em;
    font-size: 0.85rem;
    margin: 4px 0 0;
}

/* Footer beneath the card content */
.auth-card-foot {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--auth-line-soft);
    font-size: 0.9rem;
    color: var(--auth-ink-soft);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-card-foot a {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-card-foot a:hover { text-decoration: underline; }

.auth-waitlist-link {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--auth-warm-soft);
    border: 1px solid var(--auth-warm-line);
    color: var(--auth-warm);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.88rem;
}

.auth-waitlist-link:hover { text-decoration: underline; }

.auth-trial-banner {
    background: var(--auth-primary-soft);
    border: 1px solid #cfe5d6;
    color: var(--auth-primary);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.88rem;
    margin-bottom: 18px;
    text-align: center;
}

.auth-legal {
    margin-top: 24px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--auth-ink-quiet);
    max-width: 440px;
    line-height: 1.5;
}

.auth-legal a {
    color: var(--auth-ink-soft);
    text-decoration: underline;
}

/* ------------------------------------------------------------------
   Success state (waitlist post-submit)
   ------------------------------------------------------------------ */
.auth-success {
    text-align: center;
    padding: 24px 8px 8px;
}

.auth-success h2 {
    font-family: "Instrument Serif", "Fraunces", serif;
    font-weight: 400;
    font-size: 1.6rem;
    margin: 0 0 8px;
    color: var(--auth-ink);
}

.auth-success p {
    color: var(--auth-ink-soft);
    margin: 0 0 16px;
    font-size: 0.95rem;
}

/* ------------------------------------------------------------------
   Signup side-rail testimonial
   ------------------------------------------------------------------ */
.auth-split {
    width: 100%;
    max-width: 1040px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(24px, 4vw, 56px);
    align-items: center;
}

.auth-split .auth-card { margin: 0 auto; }

.auth-rail {
    background: var(--auth-bg-alt);
    border: 1px solid var(--auth-line-soft);
    border-radius: var(--auth-radius-lg);
    padding: clamp(28px, 4vw, 40px);
    color: var(--auth-ink);
    box-shadow: var(--auth-shadow);
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 380px;
    justify-content: space-between;
}

.auth-rail-quote {
    font-family: "Instrument Serif", "Fraunces", serif;
    font-weight: 400;
    font-size: 1.5rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--auth-ink);
}

.auth-rail-attrib {
    font-size: 0.85rem;
    color: var(--auth-ink-soft);
    margin-top: 8px;
}

.auth-rail-art {
    position: relative;
    height: 200px;
    margin: 8px 0 4px;
    overflow: visible;
}

.auth-rail-art .landing-card {
    position: absolute;
    width: 180px;
    height: 114px;
    border-radius: 12px;
    padding: 12px 14px;
    color: #f6f1e6;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    letter-spacing: 0.04em;
    left: 50%;
    top: 50%;
    margin-left: -90px;
    margin-top: -57px;
}

.auth-rail-art .landing-card-issuer { font-size: 0.6rem; opacity: 0.85; }
.auth-rail-art .landing-card-balance { font-size: 1.1rem; font-weight: 700; }
.auth-rail-art .landing-card-balance em { font-style: normal; font-size: 0.7rem; opacity: 0.85; margin-left: 4px; }
.auth-rail-art .landing-card-chip {
    width: 26px; height: 19px; border-radius: 4px;
    background: linear-gradient(135deg, #d4a64a 0%, #b8862c 100%);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.auth-rail-art .landing-card-1 {
    background: linear-gradient(135deg, #1d6b4a 0%, #144f37 100%);
    transform: translate(-38px, -34px) rotate(-9deg);
    z-index: 3;
}
.auth-rail-art .landing-card-2 {
    background: linear-gradient(135deg, #2a313b 0%, #161a1f 100%);
    transform: translate(0, 0) rotate(2deg);
    z-index: 2;
}
.auth-rail-art .landing-card-3 {
    background: linear-gradient(135deg, #8a5a1f 0%, #6b4416 100%);
    transform: translate(38px, 34px) rotate(11deg);
    z-index: 1;
}

.auth-rail-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--auth-line-soft);
}

.auth-rail-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.auth-rail-stat strong {
    font-size: 1.1rem;
    color: var(--auth-ink);
    font-weight: 700;
}

.auth-rail-stat span {
    font-size: 0.78rem;
    color: var(--auth-ink-quiet);
    line-height: 1.3;
}

/* ------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */
@media (max-width: 860px) {
    .auth-split {
        grid-template-columns: 1fr;
    }
    .auth-rail {
        order: -1;
        min-height: 0;
        padding: 22px 24px;
    }
    .auth-rail-art { display: none; }
    .auth-rail-quote { font-size: 1.25rem; }
}

@media (max-width: 480px) {
    .auth-card { padding: 24px 20px; border-radius: 14px; }
    .auth-topbar-link { font-size: 0.85rem; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-card button[type="submit"],
    .auth-card input { transition: none; }
}

/* --- Google sign-in -------------------------------------------------------- */
.auth-google-block { margin: 0 0 18px; }
.auth-google-block[hidden] { display: none; }

.auth-google-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 11px 14px;
    background: #fff;
    color: #1f2937;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid #d4d8de;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.auth-google-btn:hover { background: #f7f8fa; border-color: #b8bec7; }
.auth-google-btn:focus-visible { outline: 2px solid #1D6B4A; outline-offset: 2px; }
.auth-google-btn[disabled] { opacity: 0.6; cursor: progress; }
.auth-google-icon { flex: 0 0 18px; display: block; }

.auth-divider {
    position: relative;
    text-align: center;
    margin: 16px 0 4px;
    color: #6b7280;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.auth-divider::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 50%;
    height: 1px;
    background: #e3e6ea;
}
.auth-divider span {
    position: relative;
    background: #fff;
    padding: 0 10px;
}
