/* =============================================================================
   Family Photo Archive — Auth pages stylesheet
   photoarchive.family
   Shared by Redeem Invite and Account Creation. Uses the spec §2 design tokens.
   ============================================================================= */

:root {
    /* Palette (spec §2) */
    --sage:    #5C7A5C;
    --olive:   #7A8C6E;
    --gold:    #B5956A;
    --cream:   #F2EDE4;
    --surface: #FAFAF8;
    --text:    #333330;
    --muted:   #6B6B63;
    --border:  #D9D2C5;

    /* Tints derived from the palette */
    --gold-dark:  #9C7F58;
    --sage-dark:  #4C674C;
    --error:      #9A4A3C;
    --error-bg:   #F3E2DD;

    --radius: 10px;
    --shadow: 0 14px 38px rgba(51, 51, 48, 0.10);
}

* { box-sizing: border-box; }

/* ----------------------------------------------------------------------------
   Page frame: a warm cream field with a single centred card. Photos are the
   star elsewhere; these utility pages stay quiet and composed.
   -------------------------------------------------------------------------- */
.auth-body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    font-family: 'Roboto', system-ui, -apple-system, sans-serif;
    color: var(--text);
    background-color: var(--cream);
    /* Subtle paper-grain wash so the cream doesn't read as flat. */
    background-image:
        radial-gradient(1200px 600px at 50% -10%, rgba(92, 122, 92, 0.07), transparent 60%);
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* ----------------------------------------------------------------------------
   Header: brand on a sage band, with a slim gold "archival" divider beneath —
   the one decorative flourish, kept restrained.
   -------------------------------------------------------------------------- */
.auth-card__head {
    background: var(--sage);
    padding: 22px 32px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-brand {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: var(--surface);
}

/* Gold hairline with a centred diamond — the signature mark. */
.auth-ornament {
    position: relative;
    height: 1px;
    background: linear-gradient(90deg,
        transparent, var(--gold) 18%, var(--gold) 82%, transparent);
    opacity: 0.85;
}
.auth-ornament::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    transform: translate(-50%, -50%) rotate(45deg);
    background: var(--gold);
}

.auth-card__body {
    padding: 32px;
}

/* ----------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
.auth-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
    font-size: 1.7rem;
    line-height: 1.25;
    margin: 0 0 12px;
    color: var(--text);
}

.auth-lead {
    font-size: 0.98rem;
    line-height: 1.6;
    color: var(--muted);
    margin: 0 0 24px;
}
.auth-lead strong { color: var(--text); font-weight: 500; }

/* ----------------------------------------------------------------------------
   Form fields
   -------------------------------------------------------------------------- */
.auth-form { display: flex; flex-direction: column; gap: 20px; }

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

.field__label {
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: var(--muted);
}

.field__input {
    width: 100%;
    padding: 11px 13px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 7px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field__input:focus {
    outline: none;
    border-color: var(--sage);
    box-shadow: 0 0 0 3px rgba(92, 122, 92, 0.16);
}
.field__input--error { border-color: var(--error); }
.field__input--error:focus { box-shadow: 0 0 0 3px rgba(154, 74, 60, 0.16); }

/* Native select arrow tidy-up */
select.field__input {
    appearance: none;
    -webkit-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 2px),
        calc(100% - 13px) calc(50% - 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 38px;
}

.field__readonly {
    margin: 0;
    padding: 11px 13px;
    font-size: 1rem;
    color: var(--text);
    background: var(--cream);
    border: 1px dashed var(--border);
    border-radius: 7px;
}

.field__hint  { font-size: 0.82rem; color: var(--muted); margin: 0; }
.field__error { font-size: 0.82rem; color: var(--error); margin: 0; }

/* ----------------------------------------------------------------------------
   Password strength meter
   -------------------------------------------------------------------------- */
.strength { margin-top: 4px; display: flex; flex-direction: column; gap: 5px; }
.strength__bar {
    height: 5px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}
.strength__fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: var(--olive);
    transition: width 0.25s ease, background-color 0.25s ease;
}
.strength__label { font-size: 0.8rem; color: var(--muted); }

/* Strength levels (set via data-attribute by the JS) */
.strength[data-level="1"] .strength__fill { width: 25%;  background: var(--error); }
.strength[data-level="2"] .strength__fill { width: 50%;  background: var(--gold); }
.strength[data-level="3"] .strength__fill { width: 75%;  background: var(--olive); }
.strength[data-level="4"] .strength__fill { width: 100%; background: var(--sage); }

/* ----------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.auth-btn {
    display: inline-block;
    width: 100%;
    padding: 13px 18px;
    margin-top: 4px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-align: center;
    text-decoration: none;
    color: var(--surface);
    background: var(--gold);
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.05s ease;
}
.auth-btn:hover  { background: var(--gold-dark); }
.auth-btn:active { transform: translateY(1px); }
.auth-btn:focus-visible {
    outline: 2px solid var(--sage-dark);
    outline-offset: 2px;
}

.auth-btn--ghost {
    color: var(--sage);
    background: transparent;
    border: 1px solid var(--sage);
}
.auth-btn--ghost:hover { background: rgba(92, 122, 92, 0.08); }

/* ----------------------------------------------------------------------------
   Alerts
   -------------------------------------------------------------------------- */
.auth-alert {
    padding: 12px 14px;
    border-radius: 7px;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 20px;
}
.auth-alert--error {
    color: var(--error);
    background: var(--error-bg);
    border: 1px solid rgba(154, 74, 60, 0.35);
}

/* ----------------------------------------------------------------------------
   Small screens + accessibility
   -------------------------------------------------------------------------- */
@media (max-width: 420px) {
    .auth-card__head { padding: 20px 22px 18px; }
    .auth-card__body { padding: 24px 22px; }
    .auth-title { font-size: 1.45rem; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
