/* Gift Registry — Gohu family-app theme: white surfaces, navy type, one blue accent. */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f7fb;
  --accent-soft: #f0f2ff;
  --accent-line: #d9ddff;
  --border: #e4e6ef;
  --border-strong: #d3d6e2;
  --text: #131a33;
  --muted: #5b6178;
  --faint: #8b90a5;
  --accent: #4353ff;
  --accent-hover: #2e3be0;
  --danger: #d33a55;
  --danger-soft: #fdeef1;
  --success: #1f9d63;
  --success-soft: #e8f6ef;
  --warning: #a76a12;
  --warning-soft: #fdf4e3;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow-hover: 0 8px 24px rgba(19, 26, 51, 0.07), 0 2px 6px rgba(19, 26, 51, 0.04);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.2; }

.icon { flex-shrink: 0; display: block; }
.inline { display: inline; margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 0.875rem; }
.accent { color: var(--accent); }
.center { text-align: center; }

/* ── top bar ─────────────────────────────────────────────────────────────── */

.topbar { border-bottom: 1px solid var(--border); background: var(--bg); }
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text);
}
.brand-mark .icon path:last-child, .brand-mark .icon path:nth-child(2) { stroke: var(--accent); }

.nav { display: flex; align-items: center; gap: 6px; }
.nav-link {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: 999px;
}
.nav-link:hover { color: var(--text); text-decoration: none; background: var(--surface-2); }
.nav-link.active { color: var(--text); background: var(--surface-2); }
.nav-me {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 4px 12px 4px 4px;
  margin: 0 4px 0 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.nav-me:hover { text-decoration: none; border-color: var(--border-strong); }

/* ── layout ──────────────────────────────────────────────────────────────── */

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  flex: 1;
}
.container.narrow { max-width: 480px; padding-top: 56px; }

.page-head { margin-bottom: 36px; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.page-head h1, .title-xl { font-size: clamp(2rem, 5vw, 2.75rem); font-weight: 700; letter-spacing: -0.035em; }
.lede { margin: 10px 0 0; color: var(--muted); font-size: 1.05rem; max-width: 640px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
}
.section-title { font-size: 1.35rem; font-weight: 700; }
.section-gap { margin-top: 56px; }

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

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: start;
}
.split-side { position: sticky; top: 24px; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 24px;
}
.back:hover { color: var(--text); text-decoration: none; }

.footer {
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 0.875rem;
}
.footer-inner { max-width: 1080px; margin: 0 auto; padding: 24px; }

/* ── cards ───────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.card-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.card-sub { color: var(--muted); font-size: 0.925rem; margin: 0 0 20px; }

.card-link {
  display: flex;
  flex-direction: column;
  color: var(--text);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.card-link:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-hover); }
.card-link:focus-visible { outline: 3px solid rgba(67, 83, 255, 0.35); outline-offset: 2px; }

.card-foot {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.95rem;
}
.card-foot .icon { color: var(--faint); transition: transform 140ms ease; }
.card-link:hover .card-foot .icon { transform: translateX(3px); color: var(--muted); }

.card-dashed {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 1.05rem;
  padding: 28px;
  text-align: center;
}
a.card-dashed:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.card-dashed p { margin: 0; font-weight: 400; font-size: 0.925rem; color: var(--faint); }
.card-dashed.compact { min-height: 0; padding: 40px 24px; }

/* ── icon & date tiles ───────────────────────────────────────────────────── */

.date-tile {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  background: var(--surface);
  color: var(--faint);
}
.date-tile-month { color: var(--accent); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.date-tile-day { color: var(--text); font-size: 1.35rem; font-weight: 700; margin-top: 3px; letter-spacing: -0.02em; }
.date-tile.lg { width: 72px; height: 72px; border-radius: 20px; }
.date-tile.lg .date-tile-month { font-size: 0.8rem; }
.date-tile.lg .date-tile-day { font-size: 1.8rem; }
.date-tile.sm { width: 44px; height: 44px; border-radius: 12px; }
.date-tile.sm .date-tile-month { font-size: 0.6rem; }
.date-tile.sm .date-tile-day { font-size: 1.05rem; margin-top: 2px; }

/* ── avatars ─────────────────────────────────────────────────────────────── */

.avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0;
  overflow: hidden;
}
/* Soft per-person tints for initials, so stacked avatars stay distinguishable. */
.avatar.tint-1 { background: #e8f4ff; color: #1f6fc4; }
.avatar.tint-2 { background: #f1ebff; color: #6a3fd1; }
.avatar.tint-3 { background: #e6f6f1; color: #17805d; }
.avatar.tint-4 { background: #fff2e2; color: #b0600e; }
.avatar.tint-5 { background: #fdecf2; color: #c0386d; }
.avatar-xs { width: 22px; height: 22px; font-size: 0.6rem; }
.avatar-sm { width: 28px; height: 28px; font-size: 0.7rem; }
.avatar-lg { width: 52px; height: 52px; font-size: 1.1rem; }
.avatar-xl { width: 80px; height: 80px; font-size: 1.7rem; }

.avatar-stack { display: flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar + .avatar { margin-left: -6px; }

/* ── badges ──────────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface);
}
.badge-blue { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.badge-green { background: var(--success-soft); border-color: #c4e8d6; color: #167a4c; }
.badge-dark { background: var(--text); border-color: var(--text); color: #fff; }

/* ── buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 3px solid rgba(67, 83, 255, 0.35); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-dark { background: var(--text); color: #fff; border-radius: 12px; }
.btn-dark:hover { background: #262e4d; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-soft:hover { background: #e4e8ff; }
.btn-danger { background: var(--surface); color: var(--danger); border-color: #f3c3cd; }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 0.875rem; }
.btn-block { width: 100%; }

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid transparent;
  background: none;
  color: var(--faint);
  cursor: pointer;
}
.icon-btn:hover { color: var(--danger); background: var(--danger-soft); }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.link-btn:hover { color: var(--danger); text-decoration: underline; }

/* ── forms ───────────────────────────────────────────────────────────────── */

.stack > * + * { margin-top: 16px; }

.field { display: block; }
.field-label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.field-label .opt { color: var(--faint); font-weight: 400; }
.field-help { display: block; color: var(--muted); font-size: 0.85rem; margin-top: 6px; }

.input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(67, 83, 255, 0.15); }
textarea.input { min-height: 88px; resize: vertical; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  cursor: pointer;
}
.checkbox input, .check-card input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex-shrink: 0; }

fieldset { border: none; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; font-weight: 600; font-size: 0.9rem; }

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.check-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
  min-width: 0;
}
.check-card:hover { border-color: var(--border-strong); }
.check-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.check-card-text { min-width: 0; }
.check-card-name { font-weight: 600; font-size: 0.95rem; }
.check-card-email { color: var(--muted); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 8px; }

/* ── flashes & notices ───────────────────────────────────────────────────── */

.flashes { margin-bottom: 28px; }
.flash {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.95rem;
  border: 1px solid;
}
.flash + .flash { margin-top: 8px; }
.flash-success { background: var(--success-soft); border-color: #c4e8d6; color: #146b44; }
.flash-error { background: var(--danger-soft); border-color: #f3c3cd; color: #a52338; }
.flash-warning { background: var(--warning-soft); border-color: #f0dcb4; color: #86540c; }
.flash-info { background: var(--accent-soft); border-color: var(--accent-line); color: #2c3bb8; }

.notice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: #2a3470;
  font-size: 0.95rem;
  margin-bottom: 36px;
}
.notice .icon { color: var(--accent); margin-top: 2px; }
.notice strong { color: var(--text); }

.empty { color: var(--muted); padding: 8px 0; }

/* ── events ──────────────────────────────────────────────────────────────── */

.event-card { min-height: 260px; }
.event-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.event-card-title { font-size: 1.35rem; font-weight: 600; }
.event-card-desc {
  margin: 8px 0 0;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.event-card-people { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 0.925rem; }
.event-card .card-foot { border-top: 1px solid var(--border); margin-top: auto; padding-top: 16px; }
.event-card-body { margin-bottom: 20px; }
.event-card.is-past { background: var(--surface-2); }
.event-card.is-past .card-foot .accent { color: var(--muted); }

.event-head { display: flex; align-items: center; gap: 20px; }
.event-head-text { flex: 1; min-width: 0; }
.event-head .lede { margin-top: 6px; }
.event-desc { margin: 24px 0 0; color: var(--muted); font-size: 1.05rem; max-width: 720px; white-space: pre-line; }
.event-intro { margin-bottom: 36px; }

.person-card { flex-direction: row; align-items: center; gap: 16px; padding: 20px 22px; }
.person-card-body { flex: 1; min-width: 0; }
.person-card-name { font-weight: 600; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.person-card-meta { color: var(--muted); font-size: 0.9rem; margin-top: 2px; }
.person-card > .icon { color: var(--faint); }
.person-card.is-me { border-color: var(--accent-line); }

.person-head { display: flex; align-items: center; gap: 22px; margin-bottom: 36px; }
.person-head .eyebrow { margin-bottom: 6px; }
.person-head .lede { margin-top: 8px; }

/* ── wish list ───────────────────────────────────────────────────────────── */

.wish { padding: 22px 24px; }
.wish + .wish { margin-top: 14px; }
.wish-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.wish-heading { min-width: 0; }
.wish-heading .badge { margin-bottom: 8px; }
.wish-title { font-size: 1.15rem; font-weight: 600; overflow-wrap: anywhere; }
.wish-hint { color: var(--faint); font-size: 0.875rem; margin-top: 2px; }
.wish-notes { margin: 8px 0 0; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.wish-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.claim { display: flex; align-items: center; gap: 10px; font-size: 0.925rem; flex-wrap: wrap; }
.claim-text { flex: 1; min-width: 0; }
.claim-text strong { font-weight: 600; }
.claim-note { color: var(--muted); }
.claim.is-mine .claim-text strong { color: #167a4c; }

.disclosure > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  user-select: none;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary:hover { color: var(--accent-hover); }
.disclosure[open] > summary { margin-bottom: 14px; }
.disclosure > summary.btn { color: var(--accent); }

.claim-form { display: flex; gap: 8px; flex-wrap: wrap; }
.claim-form .input { flex: 1; min-width: 180px; padding: 9px 12px; font-size: 0.95rem; }

/* planned gifts summary */
.planned { list-style: none; margin: 0; padding: 0; }
.planned li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--border); }
.planned li:first-child { border-top: none; padding-top: 0; }
.planned-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--accent-soft);
  color: var(--accent);
}
.planned-icon.is-claim { background: var(--success-soft); color: var(--success); }
.planned-body { flex: 1; min-width: 0; }
.planned-what { font-weight: 600; overflow-wrap: anywhere; }
.planned-who { color: var(--muted); font-size: 0.85rem; }
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* ── admin lists ─────────────────────────────────────────────────────────── */

.list-card { padding: 8px 0; }
.list-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
}
.list-row:first-child { border-top: none; }
.list-row-body { flex: 1; min-width: 0; }
.list-row-title { font-weight: 600; overflow-wrap: anywhere; }
.list-row-title a { color: var(--text); }
.list-row-meta { color: var(--muted); font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; }
.list-row-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.danger-zone { margin-top: 24px; border-color: #f3c3cd; }
.danger-zone p { margin: 4px 0 16px; color: var(--muted); }

/* ── sign in ─────────────────────────────────────────────────────────────── */

.login h1 { font-size: 2rem; font-weight: 600; letter-spacing: -0.03em; }
.login-intro { margin: 12px 0 28px; color: var(--muted); font-size: 1.05rem; }
.gohu-word { color: var(--accent); font-weight: 500; }
.gohu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 16px 20px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 500;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.gohu-btn:hover { text-decoration: none; border-color: var(--accent); }
.gohu-btn:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(67, 83, 255, 0.2); }
.login-hint { margin: 16px 0 0; text-align: center; color: var(--faint); font-size: 0.875rem; }

.faq {
  margin-top: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.faq > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 500;
}
.faq > summary::-webkit-details-marker { display: none; }
.faq > summary .icon { transition: transform 160ms ease; }
.faq[open] > summary .icon { transform: rotate(180deg); }
.faq-body { margin-top: 16px; color: var(--muted); font-size: 0.975rem; line-height: 1.65; }
.faq-body p { margin: 0; }
.faq-body p + p { margin-top: 14px; }
.faq-body strong { color: var(--text); font-weight: 500; }

/* ── error page ──────────────────────────────────────────────────────────── */

.error-page { text-align: center; padding: 48px 0; }
.error-page .code { color: var(--accent); font-weight: 700; letter-spacing: 0.16em; font-size: 0.8rem; }
.error-page h1 { font-size: 2rem; margin-top: 10px; }
.error-page p { color: var(--muted); margin: 12px 0 28px; }

/* ── responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 880px) {
  .split { grid-template-columns: 1fr; }
  .split-side { position: static; }
  .split.form-first .split-side { order: -1; }
}

@media (max-width: 640px) {
  .topbar-inner { padding: 0 16px; height: 64px; }
  .brand-text { display: none; }
  .nav-me-name { display: none; }
  .nav-me { padding: 3px; }
  .nav-link { padding: 8px 10px; }
  .container { padding: 32px 16px 64px; }
  .container.narrow { padding-top: 40px; }
  .footer-inner { padding: 20px 16px; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  .card { padding: 22px; }
  .event-card { min-height: 0; }
  .row-2 { grid-template-columns: 1fr; }
  .event-head { align-items: flex-start; flex-wrap: wrap; gap: 16px; }
  .person-head { gap: 16px; }
  .person-head .avatar-xl { width: 64px; height: 64px; font-size: 1.4rem; }
  .list-card { padding: 4px 0; }
  .list-row { padding: 14px 18px; flex-wrap: wrap; }
  .list-row-actions.below { width: 100%; padding-left: 56px; }
  .card-dashed { min-height: 160px; }
}
