/* ─── Design System ─────────────────────────────────────────────────────── */
:root {
  color-scheme: light;

  --c-primary:      #4f46e5;
  --c-primary-dk:   #3730a3;
  --c-primary-lt:   #eef2ff;
  --c-success:      #059669;
  --c-success-lt:   #d1fae5;
  --c-success-text: #065f46;
  --c-success-border: #a7f3d0;
  --c-warning:      #d97706;
  --c-warning-lt:   #fef3c7;
  --c-warning-text: #92400e;
  --c-warning-border: #fde68a;
  --c-danger:       #dc2626;
  --c-danger-lt:    #fee2e2;
  --c-danger-text:  #991b1b;
  --c-danger-border: #fca5a5;
  --c-info:         #0284c7;
  --c-info-lt:      #e0f2fe;
  --c-info-text:    #075985;
  --c-info-border:  #bae6fd;
  --c-bg:           #f8f9fc;
  --c-surface:      #ffffff;
  --c-border:       #e5e7eb;
  --c-text:         #111827;
  --c-text-2:       #374151;
  --c-muted:        #6b7280;
  --c-subtle:       #9ca3af;
  --c-bg-subtle:    #f3f4f6;
  --c-row-hover:    #fafbff;
  --c-preview-bg:   #e5e7eb;

  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
  --shadow:     0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.10);
  --ring:       0 0 0 3px rgba(79,70,229,.12);

  --font: Inter, 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --nav-h: 60px;
}

/* ─── Dark theme (follows the OS preference) ────────────────────────────────
   Pages that frame sender-designed invitation content opt out by setting
   data-force-light on <html> — the invitation artwork defines its own colors
   and the surrounding chrome must not flip underneath it. */
@media (prefers-color-scheme: dark) {
  :root:not([data-force-light]) {
    color-scheme: dark;

    --c-primary:      #6366f1;
    --c-primary-dk:   #4f46e5;
    --c-primary-lt:   rgba(99,102,241,.16);
    --c-success:      #34d399;
    --c-success-lt:   rgba(52,211,153,.14);
    --c-success-text: #6ee7b7;
    --c-success-border: rgba(52,211,153,.35);
    --c-warning:      #fbbf24;
    --c-warning-lt:   rgba(251,191,36,.13);
    --c-warning-text: #fcd34d;
    --c-warning-border: rgba(251,191,36,.35);
    --c-danger:       #f87171;
    --c-danger-lt:    rgba(248,113,113,.14);
    --c-danger-text:  #fca5a5;
    --c-danger-border: rgba(248,113,113,.35);
    --c-info:         #38bdf8;
    --c-info-lt:      rgba(56,189,248,.14);
    --c-info-text:    #7dd3fc;
    --c-info-border:  rgba(56,189,248,.35);
    --c-bg:           #0f1117;
    --c-surface:      #171a23;
    --c-border:       #262b38;
    --c-text:         #e7e9ee;
    --c-text-2:       #c2c8d4;
    --c-muted:        #99a1b0;
    --c-subtle:       #6e7684;
    --c-bg-subtle:    #1e2330;
    --c-row-hover:    #1c202b;
    --c-preview-bg:   #0b0d12;

    --shadow-sm:  0 1px 3px rgba(0,0,0,.35);
    --shadow:     0 4px 16px rgba(0,0,0,.35);
    --shadow-lg:  0 8px 32px rgba(0,0,0,.45);
    --ring:       0 0 0 3px rgba(129,140,248,.30);
  }

  /* Solid fills stay saturated so their white label text keeps contrast. */
  :root:not([data-force-light]) .btn-success { background: #059669; }
  :root:not([data-force-light]) .btn-danger  { background: #dc2626; }
  /* --c-primary-dk darkens for hovers; this one is text on a dark tint. */
  :root:not([data-force-light]) .btn-social.primary { color: #a5b4fc; }
  :root:not([data-force-light]) .btn-social.primary:hover { background: rgba(99,102,241,.28); }
}

/* ─── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--c-primary); }

/* ─── Accessibility: skip link + focus rings + reduced motion ───────────── */
.skip-link {
  position: absolute;
  left: 12px; top: -48px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--c-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--c-primary); outline-offset: 2px; border-radius: 4px; }
/* Light ring on dark / coloured surfaces for visibility */
.hero-wall a:focus-visible,
.hero-btn-primary:focus-visible,
.hero-btn-secondary:focus-visible,
.occasion-tile:focus-visible { outline-color: #fff; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ─── Layout ─────────────────────────────────────────────────────────────── */
.container      { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.container-sm   { max-width: 680px;  margin: 0 auto; padding: 0 20px; }
.container-xs   { max-width: 480px;  margin: 0 auto; padding: 0 20px; }
.page-body      { padding: 32px 0 64px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* ─── Navigation ─────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}
.site-nav {
  height: 100%;
  max-width: 1100px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.nav-brand {
  font-weight: 800; font-size: 1.15rem; color: var(--c-primary);
  text-decoration: none; letter-spacing: -0.02em; flex-shrink: 0;
}
.nav-brand span { color: var(--c-text); }

.nav-links {
  display: flex; align-items: center; gap: 6px;
}
.nav-links a {
  padding: 6px 12px; border-radius: var(--radius-sm);
  color: var(--c-muted); text-decoration: none; font-size: 0.9rem;
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--c-text); background: var(--c-bg); }

.nav-user {
  display: flex; align-items: center; gap: 10px;
}
.nav-username {
  font-size: 0.85rem; color: var(--c-muted); font-weight: 500;
}

.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  padding: 6px; border-radius: var(--radius-sm); color: var(--c-text); font-size: 1.3rem;
}


/* Mobile nav drawer */
.nav-drawer {
  display: none; position: fixed; inset: var(--nav-h) 0 0 0;
  background: var(--c-surface); border-top: 1px solid var(--c-border);
  padding: 20px; flex-direction: column; gap: 8px; z-index: 99;
  box-shadow: var(--shadow-lg);
}
.nav-drawer.open { display: flex; }
.nav-drawer a, .nav-drawer button {
  padding: 12px 16px; border-radius: var(--radius); font-size: 1rem;
  color: var(--c-text); text-decoration: none; font-weight: 500;
  transition: background .15s;
}
.nav-drawer a:hover, .nav-drawer button:hover { background: var(--c-bg); }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius);
  font-size: 0.9rem; font-weight: 600; font-family: inherit;
  text-decoration: none; border: none; cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .1s;
  white-space: nowrap; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-primary   { background: var(--c-primary);  color: #fff; }
.btn-primary:hover  { background: var(--c-primary-dk); box-shadow: 0 4px 12px rgba(79,70,229,.3); }
.btn-secondary { background: var(--c-surface); color: var(--c-text); border: 1px solid var(--c-border); }
.btn-secondary:hover { background: var(--c-bg); }
.btn-success   { background: var(--c-success);  color: #fff; }
.btn-success:hover  { background: #047857; }
.btn-danger    { background: var(--c-danger);   color: #fff; }
.btn-danger:hover   { background: #b91c1c; }
.btn-ghost     { background: transparent; color: var(--c-primary); }
.btn-ghost:hover    { background: var(--c-primary-lt); }
.btn-sm  { padding: 6px 12px; font-size: 0.82rem; }
.btn-lg  { padding: 13px 28px; font-size: 1rem; }
.btn-xl  { padding: 16px 36px; font-size: 1.05rem; border-radius: var(--radius-lg); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card-hover { transition: box-shadow .2s, transform .2s; }
.card-hover:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; white-space: nowrap;
  /* Neutral fallback so unknown badge-<type> modifiers still render legibly. */
  background: var(--c-bg-subtle); color: var(--c-muted);
}
.badge-primary  { background: var(--c-primary-lt); color: var(--c-primary); }
.badge-success  { background: var(--c-success-lt); color: var(--c-success); }
.badge-warning  { background: var(--c-warning-lt); color: var(--c-warning); }
.badge-danger   { background: var(--c-danger-lt);  color: var(--c-danger); }
.badge-neutral  { background: var(--c-bg-subtle); color: var(--c-muted); }

/* Event type badges — one per Event.EVENT_TYPES key */
.badge-wedding         { background: #fdf2f8; color: #9d174d; }
.badge-birthday        { background: #fff7ed; color: #c2410c; }
.badge-baby_shower     { background: #fdf4ff; color: #7e22ce; }
.badge-bridal_shower   { background: #fff1f2; color: #be123c; }
.badge-tournament      { background: #ecfdf5; color: #047857; }
.badge-casual          { background: #f1f5f9; color: #475569; }
.badge-kids_party      { background: #fef9c3; color: #a16207; }
.badge-first_communion { background: #f0f9ff; color: #0369a1; }
.badge-quinceanera     { background: #fce7f3; color: #be185d; }
.badge-anniversary     { background: #fffbeb; color: #b45309; }
.badge-mass            { background: #eef2ff; color: #4338ca; }
.badge-excursion       { background: #f0fdfa; color: #0f766e; }
.badge-halloween       { background: #ffedd5; color: #9a3412; }
.badge-gender_reveal   { background: #f5f3ff; color: #6d28d9; }
.badge-open_house      { background: #f7fee7; color: #4d7c0f; }
.badge-courses         { background: #ecfeff; color: #0e7490; }
.badge-custom          { background: #f3f4f6; color: #374151; }
.badge-bautizo         { background: #eff6ff; color: #1d4ed8; }
.badge-confirmacion    { background: #ede9fe; color: #5b21b6; }
.badge-pets_party      { background: #d1fae5; color: #065f46; }
.badge-pool_party      { background: #e0f2fe; color: #0369a1; }
.badge-mothers_day     { background: #fce7f3; color: #9d174d; }
.badge-fathers_day     { background: #e2e8f0; color: #1e3a5f; }
.badge-pdf             { background: #f3f4f6; color: #4b5563; }
.badge-other           { background: #f9fafb; color: #374151; }

/* ─── Stat Cards ─────────────────────────────────────────────────────────── */
.stat-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--radius-lg); padding: 20px 24px;
  display: flex; flex-direction: column; gap: 4px;
}
.stat-card .stat-label { font-size: 0.78rem; color: var(--c-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stat-card .stat-value { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-card .stat-sub   { font-size: 0.8rem; color: var(--c-muted); }
.stat-confirmed .stat-value { color: var(--c-success); }
.stat-declined  .stat-value { color: var(--c-danger); }
.stat-maybe     .stat-value { color: var(--c-warning); }
.stat-total     .stat-value { color: var(--c-primary); }

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.form-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: 28px; }
.form-section { margin-bottom: 28px; }
.form-section-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--c-muted); margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--c-border); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 0.83rem; font-weight: 600; color: var(--c-text-2); }
.form-field input,
.form-field textarea,
.form-field select {
  padding: 9px 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: 0.93rem; font-family: inherit; color: var(--c-text);
  background: var(--c-surface); width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: none; border-color: var(--c-primary);
  box-shadow: var(--ring);
}
.form-field textarea { resize: vertical; min-height: 80px; }
.form-field .field-error { font-size: 0.78rem; color: var(--c-danger); }
.form-field .field-hint  { font-size: 0.78rem; color: var(--c-muted); }
.form-error-box { background: var(--c-danger-lt); border: 1px solid var(--c-danger-border); border-radius: var(--radius); padding: 12px 16px; color: var(--c-danger); font-size: 0.87rem; margin-bottom: 20px; }

/* Legacy form compat */
form { background: var(--c-surface); padding: 0; border: none; border-radius: 0; }
input, select, textarea { width: 100%; padding: 9px 12px; margin: 0; border: 1px solid var(--c-border); border-radius: var(--radius-sm); font-family: inherit; font-size: 0.93rem; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--c-primary); box-shadow: var(--ring); }
button { font-family: inherit; cursor: pointer; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 0.83rem; font-weight: 600; color: var(--c-text-2); margin-bottom: 5px; }

/* Password eye toggle */
.pwd-wrap {
  display: flex; align-items: stretch;
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  background: var(--c-surface); transition: border-color .15s, box-shadow .15s;
  overflow: hidden;
}
.pwd-wrap:focus-within {
  border-color: var(--c-primary); box-shadow: var(--ring);
}
.pwd-wrap input {
  flex: 1; min-width: 0; width: auto;
  border: none !important; box-shadow: none !important; border-radius: 0;
  background: transparent; padding: 9px 10px 9px 12px;
}
.pwd-wrap input:focus { outline: none; box-shadow: none !important; }
.pwd-eye {
  flex-shrink: 0; padding: 0 12px;
  background: none; border: none; border-left: 1px solid var(--c-border);
  cursor: pointer; color: var(--c-muted); display: flex; align-items: center;
  transition: color .15s, background .15s;
}
.pwd-eye:hover { color: var(--c-text); background: var(--c-bg); }

/* Password strength */
.pwd-hint { margin-top: 6px; }
.strength-wrapper { background: var(--c-bg-subtle); border-radius: 4px; height: 6px; overflow: hidden; margin-top: 6px; }
.strength-bar { height: 100%; width: 0; transition: width .2s, background .2s; background: var(--c-danger); border-radius: 4px; }
.strength-bar.weak   { background: var(--c-danger); }
.strength-bar.medium { background: var(--c-warning); }
.strength-bar.strong { background: var(--c-success); }

/* ─── RSVP Table ─────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border: 1px solid var(--c-border); border-radius: var(--radius-lg); }
.rsvp-table { width: 100%; border-collapse: collapse; background: var(--c-surface); font-size: 0.9rem; }
.rsvp-table th { padding: 12px 16px; text-align: left; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); background: var(--c-bg); border-bottom: 1px solid var(--c-border); white-space: nowrap; }
.rsvp-table td { padding: 13px 16px; border-bottom: 1px solid var(--c-bg-subtle); vertical-align: middle; }
.rsvp-table tr:last-child td { border-bottom: none; }
.rsvp-table tbody tr:hover { background: var(--c-row-hover); }
.rsvp-table .filter-row th { padding: 8px 10px; background: var(--c-surface); }
.rsvp-table .filter-row input,
.rsvp-table .filter-row select { padding: 6px 10px; font-size: 0.83rem; margin: 0; }
.rsvp-table th.sortable { cursor: pointer; user-select: none; }
.rsvp-table th.sortable:hover { color: var(--c-text); }
.col-indicator { color: var(--c-primary); font-size: 10px; margin-left: 4px; }

/* ─── Event Cards (Dashboard) ────────────────────────────────────────────── */
.event-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
  transition: box-shadow .2s, transform .15s;
}
.event-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.event-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.event-card-header > div { min-width: 0; }
.event-card-title {
  font-size: 1.05rem; font-weight: 700; color: var(--c-text); margin-bottom: 2px;
  /* Long/unbroken titles must never spill out of the card on narrow screens. */
  overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.event-card-meta  { font-size: 0.82rem; color: var(--c-muted); }
.event-card-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.event-stat { display: flex; flex-direction: column; align-items: center; min-width: 44px; }
.event-stat-val  { font-size: 1.25rem; font-weight: 800; line-height: 1; }
.event-stat-lbl  { font-size: 0.68rem; color: var(--c-muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.event-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}
.event-card-actions .btn { text-align: center; justify-content: center; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── Template Browser Cards ─────────────────────────────────────────────── */
.template-card {
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  border-radius: var(--radius-lg); overflow: hidden;
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column;
  transition: border-color .2s, box-shadow .2s, transform .15s;
  cursor: pointer;
}
.template-card:hover { border-color: var(--c-primary); box-shadow: var(--shadow); transform: translateY(-3px); }
.template-preview-wrap {
  position: relative; overflow: hidden;
  height: 240px; background: var(--c-preview-bg);
  border-bottom: 1px solid var(--c-border);
}
.template-preview-iframe {
  position: absolute; top: 0; left: 0;
  width: 375px; height: 812px;
  transform: scale(0.45) translate(-50%, -50%);
  transform-origin: 0 0;
  left: 50%; top: 50%;
  pointer-events: none; border: none;
}
.template-card-body { padding: 16px; }
.template-card-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.template-card-desc { font-size: 0.82rem; color: var(--c-muted); }
.template-card-footer { padding: 12px 16px; border-top: 1px solid var(--c-border); background: var(--c-row-hover); }

/* ─── Hero / Landing ─────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--c-primary) 0%, #7c3aed 100%);
  color: #fff; text-align: center;
  padding: 80px 20px 90px;
}
.hero-eyebrow { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; opacity: .75; margin-bottom: 14px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 900; letter-spacing: -.03em; line-height: 1.1; margin-bottom: 18px; }
.hero p  { font-size: 1.1rem; opacity: .85; max-width: 560px; margin: 0 auto 36px; line-height: 1.65; }
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-btn-primary  { background: #fff; color: var(--c-primary); font-weight: 700; }
.hero-btn-primary:hover { background: #f0f4ff; color: var(--c-primary-dk); }
.hero-btn-secondary { background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.35); }
.hero-btn-secondary:hover { background: rgba(255,255,255,0.25); }

/* ─── Hero wall (visual template collage) ───────────────────────────────── */
.hero-wall { position: relative; background: #0f1117; height: 460px; overflow: hidden; }
.hero-wall-strip {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; padding: 12px;
}
.hero-wall-tile {
  position: relative; border-radius: 14px;
  overflow: hidden; background: #171a23; box-shadow: 0 12px 40px rgba(0,0,0,.45);
}
.hero-wall-tile:nth-child(2n) { transform: translateY(-20px); }
.hero-wall-tile iframe {
  position: absolute; top: 0; left: 50%;
  width: 375px; height: 812px; border: 0; pointer-events: none;
  transform: translateX(-50%) scale(.62); transform-origin: top center;
}
.hero-wall-overlay {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 0 0 52px; text-align: center; color: #fff;
  background: linear-gradient(to top, rgba(15,17,23,.97) 28%, rgba(15,17,23,.55) 62%, rgba(15,17,23,.15) 100%);
}
.hero-wall-eyebrow { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; opacity: .8; margin-bottom: 12px; }
.hero-wall-overlay h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 900; letter-spacing: -.03em; line-height: 1.08; margin-bottom: 14px; }
.hero-wall-sub { font-size: 1.05rem; opacity: .88; max-width: 560px; margin: 0 auto 28px; line-height: 1.6; }

/* ─── Benefit strip ─────────────────────────────────────────────────────── */
.benefit-strip-section { background: var(--c-surface); border-bottom: 1px solid var(--c-border); }
.benefit-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 820px; margin: 0 auto; }
.benefit-card {
  display: flex; gap: 14px; align-items: flex-start;
  border: 1px solid var(--c-border); border-radius: var(--radius-lg);
  padding: 18px 20px; background: var(--c-surface);
}
.benefit-icon {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 10px;
  background: var(--c-primary-lt); color: var(--c-primary);
  display: flex; align-items: center; justify-content: center;
}
.benefit-card h3 { font-size: 0.98rem; font-weight: 800; margin-bottom: 4px; }
.benefit-card p  { font-size: 0.85rem; color: var(--c-muted); line-height: 1.55; }

/* ─── Occasion tiles ────────────────────────────────────────────────────── */
.occasion-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px;
}
.occasion-tile {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius-lg);
  display: flex; align-items: flex-end; padding: 14px;
  text-decoration: none; color: #fff; overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
.occasion-tile::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.35), transparent 60%);
}
.occasion-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.occasion-name { position: relative; z-index: 1; font-weight: 800; font-size: 0.95rem; letter-spacing: -.01em; line-height: 1.2; }
.occ-a { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.occ-b { background: linear-gradient(135deg, #db2777, #fb7185); }
.occ-c { background: linear-gradient(135deg, #0891b2, #67e8f9); }
.occ-d { background: linear-gradient(135deg, #ea580c, #fdba74); }
.occ-e { background: linear-gradient(135deg, #059669, #6ee7b7); }
.occ-f { background: linear-gradient(135deg, #4f46e5, #818cf8); }

/* ─── Sections ───────────────────────────────────────────────────────────── */
.section { padding: 64px 0; }
.section-sm { padding: 40px 0; }
.section-alt { background: var(--c-surface); border-top: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); }
.section-title { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.02em; margin-bottom: 8px; }
.section-sub   { color: var(--c-muted); font-size: 1rem; max-width: 500px; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header .section-sub { margin: 0 auto; }

/* How-it-works steps */
.step {
  text-align: center; padding: 8px;
}
.step-num {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--c-primary-lt); color: var(--c-primary);
  font-weight: 800; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.step h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.step p  { font-size: 0.88rem; color: var(--c-muted); line-height: 1.6; }

/* FAQ */
.faq-item { border-bottom: 1px solid var(--c-border); padding: 0; }
.faq-btn {
  width: 100%; text-align: left; padding: 18px 4px;
  background: none; border: none; font: inherit; cursor: pointer;
  font-size: 0.95rem; font-weight: 600; color: var(--c-text);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq-btn svg { flex-shrink: 0; transition: transform .2s; }
.faq-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.faq-body { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-body.open { max-height: 400px; }
.faq-body p { padding: 0 4px 18px; color: var(--c-muted); font-size: 0.92rem; line-height: 1.7; }

/* Pricing cards */
.pricing-card {
  background: var(--c-surface); border: 2px solid var(--c-border);
  border-radius: var(--radius-xl); padding: 32px 28px;
  display: flex; flex-direction: column; gap: 20px;
}
.pricing-card.featured { border-color: var(--c-primary); }
.pricing-card .price { font-size: 2.8rem; font-weight: 900; line-height: 1; }
.pricing-card .price span { font-size: 1rem; font-weight: 400; color: var(--c-muted); }
.pricing-card ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.pricing-card ul li { font-size: 0.88rem; display: flex; align-items: center; gap: 8px; }
.pricing-card ul li::before { content: '✓'; color: var(--c-success); font-weight: 700; flex-shrink: 0; }

/* ─── Auth (login / register) ───────────────────────────────────────────── */
.auth-split { max-width: 940px; margin: 0 auto; }
.auth-panel { display: none; }
.auth-card-col { background: var(--c-surface); }
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.auth-head p { color: var(--c-muted); font-size: 0.92rem; }

.auth-social { display: flex; flex-direction: column; gap: 10px; }
.btn-social {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px 16px; min-height: 48px;
  border: 1px solid var(--c-border); border-radius: var(--radius);
  background: var(--c-surface); color: var(--c-text);
  font-size: 0.95rem; font-weight: 600; font-family: inherit;
  text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s;
}
.btn-social:hover { background: var(--c-bg); border-color: var(--c-subtle); }
.btn-social.primary { border-color: var(--c-primary); background: var(--c-primary-lt); color: var(--c-primary-dk); }
.btn-social.primary:hover { background: #e2e7ff; }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--c-border); }
.auth-divider span { font-size: 0.8rem; color: var(--c-muted); }

.auth-panel ul { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-direction: column; gap: 12px; }
.auth-panel li { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; }
.auth-panel li svg { flex-shrink: 0; opacity: .95; }

@media (min-width: 860px) {
  .auth-split {
    display: grid; grid-template-columns: 1fr 400px;
    border: 1px solid var(--c-border); border-radius: var(--radius-xl);
    overflow: hidden; box-shadow: var(--shadow-lg); background: var(--c-surface);
  }
  .auth-panel {
    display: flex; flex-direction: column; justify-content: center;
    background: linear-gradient(150deg, var(--c-primary), #a78bfa);
    color: #fff; padding: 44px 38px;
  }
  .auth-panel h2 { font-size: 1.4rem; font-weight: 800; line-height: 1.25; }
  .auth-panel p { font-size: 0.95rem; opacity: .92; margin-top: 8px; }
  .auth-card-col { padding: 44px 38px; display: flex; flex-direction: column; justify-content: center; }
}

/* ─── Page headers ───────────────────────────────────────────────────────── */
.page-header { padding: 28px 0 24px; border-bottom: 1px solid var(--c-border); margin-bottom: 32px; }
.page-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.page-subtitle { color: var(--c-muted); font-size: 0.9rem; margin-top: 3px; }
.breadcrumb { font-size: 0.82rem; color: var(--c-muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--c-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--c-primary); }

/* ─── Alert / Notice ─────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 0.88rem; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 10px; }
.alert-success { background: var(--c-success-lt); color: var(--c-success-text); border: 1px solid var(--c-success-border); }
.alert-info    { background: var(--c-info-lt);    color: var(--c-info-text);    border: 1px solid var(--c-info-border); }
.alert-warning { background: var(--c-warning-lt); color: var(--c-warning-text); border: 1px solid var(--c-warning-border); }
.alert-danger  { background: var(--c-danger-lt);  color: var(--c-danger-text);  border: 1px solid var(--c-danger-border); }

/* ─── Copy-link widget ───────────────────────────────────────────────────── */
.link-widget { display: flex; gap: 6px; align-items: center; }
.link-widget input {
  flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 0.83rem;
  padding: 8px 12px; background: var(--c-bg); color: var(--c-text);
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
}
.link-widget .copy-btn {
  flex-shrink: 0; padding: 8px 14px; font-size: 0.83rem;
  background: var(--c-bg); border: 1px solid var(--c-border);
  border-radius: var(--radius-sm); font-family: inherit; cursor: pointer;
  font-weight: 600; transition: background .15s;
}
.link-widget .copy-btn:hover { background: var(--c-primary-lt); color: var(--c-primary); }

/* ─── Error list ─────────────────────────────────────────────────────────── */
.errorlist { list-style: none; color: var(--c-danger); font-size: 0.82rem; margin: 4px 0 0; }

/* ─── Empty state ────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; opacity: .4; }
.empty-state h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; }
.empty-state p  { color: var(--c-muted); font-size: 0.9rem; margin-bottom: 24px; }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--c-surface); border-top: 1px solid var(--c-border);
  padding: 32px 0; margin-top: auto;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px; font-size: 0.83rem; color: var(--c-muted);
}
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--c-muted); text-decoration: none; }
.footer-links a:hover { color: var(--c-text); }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-user > *:not(.nav-toggle) { display: none; }
  .nav-toggle { display: block; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .pricing-2col { grid-template-columns: 1fr !important; }
  .benefit-strip { grid-template-columns: 1fr; }

  .hero-wall { height: 400px; }
  .hero-wall-strip { grid-template-columns: repeat(3, 1fr); }
  .hero-wall-tile:nth-child(n+4) { display: none; }

  .page-header-inner { flex-direction: column; align-items: flex-start; }
  .hero { padding: 56px 20px 64px; }

  .event-card-actions { gap: 6px; }
  .event-card-actions .btn { font-size: 0.78rem; padding: 6px 8px; }

  .stat-card { padding: 16px; }
  .stat-card .stat-value { font-size: 1.6rem; }
}

@media (max-width: 480px) {
  .container, .container-sm { padding: 0 16px; }
  .card { padding: 16px; }
  .hero h1 { font-size: 1.75rem; }
  .hero p  { font-size: 0.95rem; }
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .template-preview-wrap { height: 180px; }
  .template-preview-iframe { transform: scale(0.32) translate(-50%, -50%); }
}

/* ─── Event-type Tabs ────────────────────────────────────────────────────── */
.event-tabs {
  display: flex; gap: 0; overflow-x: auto;
  border-bottom: 2px solid var(--c-border);
  margin-bottom: 32px; scrollbar-width: none;
}
.event-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 12px 20px;
  border: none; border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  background: none; cursor: pointer;
  font: 600 0.9rem var(--font); color: var(--c-muted);
  white-space: nowrap; transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--c-text); }
.tab-btn.active { color: var(--c-primary); border-bottom-color: var(--c-primary); }

.tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--c-bg); border: 1px solid var(--c-border);
  border-radius: 999px; font-size: 0.7rem; font-weight: 700;
  color: var(--c-muted);
}
.tab-btn.active .tab-count { background: var(--c-primary-lt); border-color: var(--c-primary); color: var(--c-primary); }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}

/* ─── Price Badge ─────────────────────────────────────────────────────────── */
.price-badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; white-space: nowrap;
  background: var(--c-primary-lt); color: var(--c-primary);
  flex-shrink: 0;
}
.price-badge.price-free { background: var(--c-success-lt); color: var(--c-success); }

/* ─── Utility ────────────────────────────────────────────────────────────── */
.text-muted  { color: var(--c-muted); }
.text-sm     { font-size: 0.85rem; }
.text-xs     { font-size: 0.78rem; }
.text-center { text-align: center; }
.mt-1  { margin-top: 4px; }
.mt-2  { margin-top: 8px; }
.mt-3  { margin-top: 12px; }
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mt-8  { margin-top: 32px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.mb-8  { margin-bottom: 32px; }
.gap-2 { gap: 8px; }
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
