/* ─────────────────────────────────────────────────────────
   SparkleSnap · Membership pages
   v2 — parchment-warmth  (2026-10-21)

   Sections:
     1. Design tokens
     2. Reset & base
     3. Header
     4. Main content area
     5. Typography & eyebrow
     6. Forms, inputs, buttons
     7. Status & feedback
     8. Account-specific blocks
     9. Footer
    10. Accessibility & utilities
    11. Portal warmth layer  (login / join only)
    12. Benefit badges
    13. Micro-interactions
    14. Responsive
   ───────────────────────────────────────────────────────── */

/* ── 1. Design tokens ──────────────────────────────────── */
:root {
    color-scheme: light;
    --paper:    #f7f4ee;
    --paper-hi: #faf8f3;   /* lighter center for radial glow */
    --ink:      #292624;
    --muted:    #68615a;
    --accent:   #774b67;
    --accent-warm: #8b5a6d; /* softer rose for gradients */
    --line:     #d5cec4;
    --glow:     rgba(119,75,103,.12); /* accent at low opacity */
    font-family: Inter, system-ui, sans-serif;
    color: var(--ink);
    background: var(--paper);
}

/* ── 2. Reset & base ───────────────────────────────────── */
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-underline-offset: .22em; }
a:hover { color: var(--accent); }

/* ── 3. Header ─────────────────────────────────────────── */
header {
    display: flex; align-items: center; gap: 1rem;
    min-height: 84px;
    padding: 1.2rem max(1.25rem, calc((100vw - 1120px) / 2));
    border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 1.3rem; text-decoration: none; }
.language { margin-left: auto; font-size: .8rem; color: var(--muted); }
.account-menu { position: relative; }
.account-menu summary { cursor: pointer; padding: .6rem; }
.account-menu nav {
    position: absolute; right: 0; top: 100%; width: 210px;
    background: var(--paper); border: 1px solid var(--line);
    padding: .8rem; z-index: 2;
}
.account-menu nav a { display: block; padding: .65rem; }

/* ── 4. Main content area ──────────────────────────────── */
main {
    width: min(100% - 2.5rem, 540px);
    margin: clamp(2.5rem, 8vh, 6rem) auto;
    flex: 1;
}

/* ── 5. Typography & eyebrow ───────────────────────────── */
h1 {
    font-size: 2.4rem; line-height: 1.12;
    letter-spacing: -.04em; margin: .6rem 0 1.5rem;
    overflow-wrap: anywhere;
}
h2 { font-size: 1.25rem; margin-top: 2rem; }
.eyebrow {
    font-size: .78rem; letter-spacing: .1em;
    text-transform: uppercase; color: var(--accent); font-weight: 700;
}
.lead { font-size: 1.1rem; line-height: 1.7; }
p { line-height: 1.65; }

/* ── 6. Forms, inputs, buttons ─────────────────────────── */
form { display: grid; gap: 1.1rem; margin: 1.5rem 0; }
label { display: grid; gap: .5rem; font-size: .95rem; font-weight: 600; }

input {
    width: 100%; font: inherit; font-weight: 400;
    border: 1px solid #a69d93; background: #fffdfa; color: var(--ink);
    border-radius: 8px; padding: .9rem; min-height: 48px;
    transition: border-color .2s, box-shadow .2s;
}

button {
    justify-self: start; min-height: 48px;
    padding: .8rem 1.4rem;
    border: 1px solid var(--ink); border-radius: 999px;
    background: var(--ink); color: var(--paper);
    font: inherit; font-weight: 600; cursor: pointer;
    transition: background .2s, border-color .2s, box-shadow .2s;
}
button:hover  { background: var(--accent); border-color: var(--accent); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .6; cursor: wait; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }

.hint { font-size: .9rem; color: var(--muted); margin: -.3rem 0 0; }
.form-links { display: flex; gap: 1rem; justify-content: space-between; flex-wrap: wrap; }

/* ── 7. Status & feedback ──────────────────────────────── */
.account-email { overflow-wrap: anywhere; color: var(--muted); }
#account-status {
    background: #eae2e8; border: 1px solid #bca3b3;
    padding: 1rem; border-radius: 8px; line-height: 1.5;
}
#account-status[data-error=true] { background: #f8e6e2; border-color: #b87265; }

/* ── 8. Account-specific blocks ────────────────────────── */
.account-destinations {
    display: grid; gap: .8rem;
    border-block: 1px solid var(--line); padding: 1.4rem 0; margin: 2rem 0;
}
.account-destinations a { display: flex; justify-content: space-between; }
.delete-account { margin-top: 2.5rem; border-top: 1px solid var(--line); padding-top: 1.3rem; }
.delete-account summary { cursor: pointer; color: #8b332f; }
.danger { background: #8b332f; border-color: #8b332f; }

/* ── 9. Footer ─────────────────────────────────────────── */
footer {
    display: flex; gap: 1rem; justify-content: space-between; flex-wrap: wrap;
    border-top: 1px solid var(--line); padding: 1.5rem;
    font-size: .85rem; color: var(--muted);
}

/* ── 10. Accessibility & utilities ─────────────────────── */
.skip { position: absolute; top: -80px; left: 1rem; background: var(--paper); padding: 1rem; z-index: 10; }
.skip:focus { top: 0; }
[hidden] { display: none !important; }

/* ── 11. Portal warmth layer  (login / join) ───────────── */

/* Radial parchment glow behind the whole page */
body[data-account-page="login"],
body[data-account-page="join"] {
    background:
        radial-gradient(ellipse 70% 60% at 50% 30%, var(--paper-hi) 0%, var(--paper) 100%);
}

/* Page-level fade-in */
body[data-account-page="login"] main,
body[data-account-page="join"] main {
    animation: memberFadeIn .45s ease-out both;
}
@keyframes memberFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Form card wrapper */
.form-card {
    background: rgba(255,253,250,.65);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 2rem 2rem 2.2rem;
    box-shadow: 0 2px 24px rgba(41,38,36,.04);
    margin-top: .5rem;
}

/* Warmer primary CTA on portal pages */
body[data-account-page="login"] button[type="submit"],
body[data-account-page="join"]  button[type="submit"] {
    background: linear-gradient(135deg, var(--ink) 0%, #3a3330 100%);
    border-color: var(--ink);
}
body[data-account-page="login"] button[type="submit"]:hover,
body[data-account-page="join"]  button[type="submit"]:hover {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-warm) 100%);
    border-color: var(--accent);
    box-shadow: 0 2px 16px var(--glow);
}

/* Input focus glow on portal pages */
body[data-account-page="login"] input:focus,
body[data-account-page="join"]  input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--glow);
    outline: none;
}

/* Divider text between OAuth and email form */
.form-divider {
    display: flex; align-items: center; gap: 1rem;
    color: var(--muted); font-size: .85rem;
    margin: .2rem 0;
}
.form-divider::before,
.form-divider::after {
    content: ""; flex: 1; height: 1px;
    background: var(--line);
}

/* ── 12. Benefit badges ────────────────────────────────── */
.benefit-badges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .8rem;
    margin: .5rem 0 1.2rem;
}
.benefit-badge {
    background: rgba(255,253,250,.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    font-size: .82rem;
    line-height: 1.4;
    color: var(--ink);
}
.benefit-badge .badge-icon {
    display: block;
    font-size: 1.4rem;
    margin-bottom: .35rem;
}
.benefit-badge strong {
    display: block;
    font-size: .88rem;
    margin-bottom: .25rem;
    font-weight: 700;
    color: var(--ink);
}

/* Staggered fade-in for badges */
.benefit-badge { animation: badgeFadeIn .4s ease-out both; }
.benefit-badge:nth-child(1) { animation-delay: .08s; }
.benefit-badge:nth-child(2) { animation-delay: .2s;  }
.benefit-badge:nth-child(3) { animation-delay: .32s; }

@keyframes badgeFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0);   }
}

/* Join-page cross-link callout */
.join-cta-link {
    display: inline-flex; align-items: center; gap: .3em;
    font-weight: 600;
    color: var(--accent);
}
.join-cta-link:hover { text-decoration: underline; }

/* ── 13. Micro-interactions (skeleton hooks) ───────────── */

/* Button shimmer — uncomment when ready for advanced pass:
button[type="submit"]::before {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.15) 50%, transparent 70%);
    border-radius: inherit;
    transform: translateX(-100%);
    transition: transform .5s;
}
button[type="submit"]:hover::before { transform: translateX(100%); }
*/

/* ── 14. Responsive ────────────────────────────────────── */
@media (max-width: 400px) {
    h1 { font-size: 2rem; }
    header { gap: .3rem; }
    .brand { font-size: 1.1rem; }
    button { width: 100%; }
    .form-card { padding: 1.4rem 1.2rem 1.6rem; }
    .benefit-badges { grid-template-columns: 1fr; }
}

/* Membership invitation: show the value, keep account actions uncomplicated. */
body[data-account-page="login"] main,
body[data-account-page="join"] main {
    flex: 0 0 auto;
    position: relative;
    isolation: isolate;
    margin-block: clamp(2.5rem, 6vh, 5rem);
}
body[data-account-page="login"] footer,
body[data-account-page="join"] footer { margin-top: auto; }
body[data-account-page="login"] h1,
body[data-account-page="join"] h1 { margin-bottom: .8rem; }
body[data-account-page="login"] .lead,
body[data-account-page="join"] .lead { color: var(--muted); margin: 0 0 1.8rem; }
body[data-account-page="login"] .form-card,
body[data-account-page="join"] .form-card,
.membership-preview { position: relative; isolation: isolate; }
body[data-account-page="login"] .form-card::before,
.membership-preview::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    border-radius: inherit;
    background: url('/_assets/members/seasons/silver-thread-clouds-v1-web.webp') center bottom / 100% auto no-repeat;
    opacity: .22;
    mask-image: linear-gradient(transparent 15%, #000 85%);
}
body[data-account-page="login"] form button[type="submit"],
body[data-account-page="join"] form button[type="submit"] {
    width: 100%; justify-self: stretch; display: flex; align-items: center;
    justify-content: center; gap: .75rem;
    background: var(--accent); border-color: var(--accent); color: #fffdfa;
}
body[data-account-page="login"] form button.google-button,
body[data-account-page="join"] form button.google-button {
    background: #fffdfa; color: var(--ink); border-color: var(--line);
}
body[data-account-page="login"] form button.google-button:hover,
body[data-account-page="join"] form button.google-button:hover { background: #f3edf1; border-color: var(--accent); }
.google-button svg { flex: 0 0 20px; }
.membership-preview {
    padding: clamp(1.25rem, 4vw, 2rem); border: 1px solid #cbb8c5; border-radius: 18px;
    background: linear-gradient(145deg, #fffdfa, #f4edf2);
    box-shadow: 0 12px 34px #774b6709;
}
.preview-caption { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem; font-size: .73rem; color: var(--accent); }
.preview-label { border: 1px solid #d9c8d4; border-radius: 999px; padding: .3rem .6rem; background: #fffdfa; }
.membership-preview h2 { font-size: 1.65rem; letter-spacing: -.035em; margin: 1.1rem 0 .35rem; }
.preview-intro { margin: 0 0 1.4rem; font-size: .9rem; color: var(--muted); }
.preview-entry { display: flex; align-items: center; gap: .9rem; padding: 1rem 0; border-top: 1px solid #ddd0d9; }
.preview-entry > div { flex: 1; min-width: 0; }
.preview-entry h3 { margin: 0; font-size: .98rem; font-weight: 700; }
.preview-entry p { margin: .3rem 0 0; font-size: .8rem; color: var(--muted); }
.preview-symbol { display: grid; place-items: center; width: 42px; height: 46px; flex-shrink: 0; border: 1px solid #d8c7d2; border-radius: 10px; color: var(--accent); background: #fffaf5; font-size: 1.4rem; }
.preview-arrow { color: var(--accent); }
.preview-track { height: 5px; margin-top: .8rem; background: #e3d8df; border-radius: 999px; }
.preview-track span { display: block; width: 60%; height: 100%; background: var(--accent); border-radius: inherit; }
.preview-footnote { margin: 1rem 0 0; font-size: .75rem; color: var(--muted); }
.membership-promises { list-style: none; display: grid; gap: .7rem; padding: 0; margin: 1.6rem .25rem; font-size: .9rem; }
.membership-promises li { display: flex; gap: .7rem; align-items: baseline; line-height: 1.55; }
.membership-promises li::before { content: "✦"; color: var(--accent); font-size: .65rem; }
.registration-note { padding: 1.5rem; }
.registration-label { margin: 0 0 .6rem; font-size: .95rem; font-weight: 650; }
.registration-note .hint { margin: 0; }
.member-link-button { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1.2rem; margin: 1.3rem 0 1rem; border-radius: 999px; text-decoration: none; background: var(--accent); color: #fffdfa; font-weight: 600; }
.member-link-button:hover { background: #653d56; color: #fffdfa; }
.explore-link { display: inline-block; font-size: .85rem; }
@media (max-width: 400px) {
    .preview-entry { gap: .65rem; }
    .preview-symbol { width: 34px; height: 40px; }
    .form-links { font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) {
    body[data-account-page="login"] main,
    body[data-account-page="join"] main { animation: none; }
    input, button { transition: none; }
}
