/* styles.css — "Velvet & Gold" design system for the Ravda birthday weekend.
   Cozy invitation feel: plum + gold on warm cream. Mobile-first. */

:root {
  /* Palette (overridable via tweaks on .app) */
  --cream:       #f7f1e8;
  --cream-deep:  #efe5d6;
  --card:        #fffdf9;
  --plum:        #6d2a52;
  --plum-deep:   #45203f;
  --plum-soft:   #8a3d68;
  --berry:       #a23f5e;
  --gold:        #c0902f;
  --gold-light:  #e7b65a;
  --ink:         #34202f;
  --muted:       #7c6470;
  --line:        #e7d8c6;
  --line-soft:   #efe4d6;
  --good:        #4f7d52;
  --good-bg:     #e7efe2;
  --warn:        #b07a26;
  --warn-bg:     #f6ecd6;

  --serif: 'DM Serif Display', Georgia, serif;
  --sans:  'Hanken Grotesk', system-ui, -apple-system, sans-serif;

  --radius:   18px;
  --radius-lg:24px;
  --radius-sm:12px;
  --shadow:   0 12px 30px -16px rgba(69,32,63,.32);
  --shadow-sm:0 4px 14px -8px rgba(69,32,63,.30);

  --maxw: 460px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  background: #2b1626;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }
a { color: inherit; }

/* ---------- App frame ---------- */
.app {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--cream);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 70px -10px rgba(0,0,0,.5);
  overflow: hidden;
}

/* subtle paper grain via layered gradients */
.app::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(231,182,90,.10), transparent 60%),
    radial-gradient(90% 50% at 0% 100%, rgba(162,63,94,.07), transparent 55%);
}

.scroll {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  position: relative; z-index: 1;
  padding-bottom: 96px;
  scroll-behavior: smooth;
}
.scroll::-webkit-scrollbar { width: 0; }

.view { padding: 0 20px; }
@media (prefers-reduced-motion: no-preference) {
  .view { animation: fade .4s ease; }
}
@keyframes fade { from { transform: translateY(8px); } to { transform: none; } }

/* ---------- Typography ---------- */
.serif { font-family: var(--serif); font-weight: 400; }
.eyebrow {
  font-size: 11px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--gold); font-weight: 700;
}
.h-section {
  font-family: var(--serif); font-size: 30px; line-height: 1.05; color: var(--plum-deep);
  letter-spacing: .005em;
}
.lead { color: var(--muted); font-size: 15px; line-height: 1.55; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}
.card + .card { margin-top: 14px; }
.card-title {
  font-family: var(--serif); font-size: 19px; color: var(--plum-deep); margin-bottom: 4px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 16px 18px; border-radius: 14px;
  font-size: 15px; font-weight: 700; letter-spacing: .01em;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.btn:active { transform: scale(.975); }
.btn-primary { background: var(--plum); color: #fbf3e9; box-shadow: 0 10px 22px -12px var(--plum); }
.btn-primary:hover { background: var(--plum-deep); }
.btn-gold { background: var(--gold-light); color: var(--plum-deep); }
.btn-ghost { background: transparent; border: 1.5px solid var(--line); color: var(--plum); }
.btn-sm { width: auto; padding: 10px 16px; font-size: 13px; border-radius: 11px; }

/* ---------- Choice toggles (RSVP options) ---------- */
.choices { display: grid; gap: 10px; }
.choices.row { grid-auto-flow: column; grid-auto-columns: 1fr; }
.choice {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 16px; border-radius: 14px; text-align: left;
  background: var(--card); border: 1.5px solid var(--line);
  transition: all .16s ease; color: var(--ink); width: 100%;
}
.choice .ce { font-size: 19px; line-height: 1; }
.choice .ct { font-weight: 600; font-size: 15px; }
.choice .cs { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.choice .cmeta { margin-left: auto; }
.choice.sel { border-color: var(--plum); background: #fbf1ea; box-shadow: inset 0 0 0 1px var(--plum); }
.choice.sel.good { border-color: var(--good); background: var(--good-bg); box-shadow: inset 0 0 0 1px var(--good); }
.choice.center { flex-direction: column; gap: 5px; text-align: center; align-items: center; padding: 14px 8px; }
.choice.center .ct { font-size: 13.5px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  padding: 4px 10px; border-radius: 100px; white-space: nowrap;
}
.badge.confirmed { background: var(--good-bg); color: var(--good); }
.badge.pending   { background: var(--warn-bg); color: var(--warn); }
.badge.declined  { background: #f0e3e3; color: #9a5252; }
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.tag {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 8px;
  background: var(--cream-deep); color: var(--plum-soft);
}

/* ---------- Avatars ---------- */
.av {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff; letter-spacing: .01em;
}
.av.sm { width: 30px; height: 30px; font-size: 12px; }
.av.lg { width: 52px; height: 52px; font-size: 18px; }
.av.star::after {
  content: "★"; position: absolute; margin: -22px 0 0 26px; font-size: 13px;
  color: var(--gold-light); text-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.av-wrap { position: relative; }

/* ---------- Lists ---------- */
.row-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}
.row-item:last-child { border-bottom: none; }
.row-item .name { font-weight: 600; font-size: 15px; }
.row-item .sub { font-size: 12.5px; color: var(--muted); }
.row-meta { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ---------- Header ---------- */
.topbar {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px 12px;
}
.topbar .brand { display: flex; align-items: center; gap: 9px; }
.topbar .brand .mk {
  width: 30px; height: 30px; border-radius: 9px; background: var(--plum);
  display: grid; place-items: center; color: var(--gold-light);
  font-family: var(--serif); font-size: 16px;
}
.topbar .brand .tt { font-family: var(--serif); font-size: 16px; color: var(--plum-deep); line-height: 1; }
.topbar .me {
  display: flex; align-items: center; gap: 7px; padding: 5px 5px 5px 12px;
  border-radius: 100px; background: var(--card); border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600; color: var(--plum);
}

/* ---------- Bottom nav ---------- */
.tabbar {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(255,253,249,.92); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px; color: var(--muted); font-size: 10px; font-weight: 600;
  letter-spacing: .02em; border-radius: 12px; transition: color .15s ease;
}
.tab svg { width: 22px; height: 22px; stroke-width: 1.8; }
.tab.active { color: var(--plum); }
.tab.active svg { stroke-width: 2.1; }
.tab .ind { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); margin-top: 1px; opacity: 0; transition: opacity .15s; }
.tab.active .ind { opacity: 1; }

/* ---------- Section heading row ---------- */
.sec-head { margin: 26px 2px 14px; }
.sec-head.first { margin-top: 6px; }

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.center { text-align: center; }
.stack-sm > * + * { margin-top: 8px; }
.muted { color: var(--muted); }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
.spacer { height: 8px; }

/* segmented */
.seg {
  display: flex; background: var(--cream-deep); border-radius: 13px; padding: 4px; gap: 4px;
}
.seg button {
  flex: 1; padding: 9px 6px; border-radius: 10px; font-size: 13px; font-weight: 600;
  color: var(--muted); transition: all .15s ease;
}
.seg button.on { background: var(--card); color: var(--plum); box-shadow: var(--shadow-sm); }

/* progress meter */
.meter { height: 8px; border-radius: 100px; background: var(--cream-deep); overflow: hidden; }
.meter > span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-light)); border-radius: 100px; transition: width .5s ease; }

/* inputs */
.field { width: 100%; padding: 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--card); font-size: 15px; color: var(--ink); }
.field:focus { outline: none; border-color: var(--plum-soft); }
label.lbl { display: block; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }

/* toast */
.toast {
  position: absolute; left: 50%; bottom: 104px; transform: translateX(-50%) translateY(20px);
  background: var(--plum-deep); color: #fbf3e9; padding: 12px 20px; border-radius: 100px;
  font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow); z-index: 40;
  opacity: 0; pointer-events: none; transition: all .3s ease; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
