/* Reunion Portal – shared styles (guest pages + admin console) */
@font-face { font-family: 'Fraunces'; src: url(/fonts/fraunces.woff2) format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url(/fonts/fraunces-italic.woff2) format('woff2'); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Inter'; src: url(/fonts/inter.woff2) format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
:root {
  --primary: #1f2a44;
  --accent: #d4a537;
  --paper: #f6f3ec;
  --card: #ffffff;
  --ink: #1d1d1f;
  --muted: #6b6a66;
  --line: #e6e1d6;
  --ok: #2f7d4f;
  --ok-bg: #e7f3eb;
  --warn: #9a6a00;
  --warn-bg: #fff4d9;
  --bad: #b3261e;
  --bad-bg: #fbe9e7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 20, .05), 0 6px 24px rgba(20, 20, 20, .06);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--sans); }
img { max-width: 100%; display: block; }
a { color: var(--primary); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
small, .muted { color: var(--muted); }
.hide { display: none !important; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.mt0 { margin-top: 0 } .mt1 { margin-top: .5rem } .mt2 { margin-top: 1rem } .mt3 { margin-top: 1.75rem }
.mb0 { margin-bottom: 0 } .mb1 { margin-bottom: .5rem } .mb2 { margin-bottom: 1rem }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: .75rem; }
.grid2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid3 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border: 0; cursor: pointer; text-decoration: none;
  font: 600 1rem/1 var(--sans); padding: .9rem 1.4rem; border-radius: 999px; background: var(--primary); color: #fff; min-height: 48px;
  transition: transform .08s ease, filter .15s ease; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn.accent { background: var(--accent); color: #1a1a1a; }
.btn.ghost { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--primary); }
.btn.danger { background: var(--bad); }
.btn.small { padding: .5rem .9rem; min-height: 36px; font-size: .88rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--primary); text-decoration: underline; cursor: pointer; font: inherit; }

label { display: block; font-weight: 600; font-size: .92rem; margin: 0 0 .35rem; }
.field { margin-bottom: 1rem; }
.hint { font-size: .85rem; color: var(--muted); margin-top: .3rem; font-weight: 400; }
input:not([type]), input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], input[type=url], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; font: 16px/1.4 var(--sans); padding: .75rem .9rem; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
input:not([type]):focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
textarea { min-height: 110px; resize: vertical; }
.check { display: flex; gap: .65rem; align-items: flex-start; font-weight: 500; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--primary); flex: none; }
.seg { display: inline-flex; background: #efebe1; border-radius: 22px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { margin: 0; padding: .6rem 1.1rem; border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg input:checked + label { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg input:focus-visible + label { outline: 2px solid var(--primary); }

/* ---------- Cards, badges, alerts ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.35rem; }
.card + .card { margin-top: 1rem; }
.card.tight { padding: 1rem; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.badge { display: inline-block; font: 600 .74rem/1 var(--sans); letter-spacing: .02em; padding: .35rem .55rem; border-radius: 999px; background: #eee9dd; color: #5a564d; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.dark { background: var(--primary); color: #fff; }
.alert { padding: .9rem 1.1rem; border-radius: 12px; background: var(--ok-bg); color: #1f5434; margin-bottom: 1rem; font-weight: 500; }
.alert.warn { background: var(--warn-bg); color: #6b4a00; }
.alert.bad { background: var(--bad-bg); color: #7d1a15; }
.alert.info { background: #e8eef9; color: #22385f; }
.divider { height: 1px; background: var(--line); margin: 1.25rem 0; border: 0; }

/* ---------- Guest header ---------- */
.g-top { background: var(--primary); color: #fff; position: relative; overflow: hidden; }
.g-top::before { content: ''; position: absolute; inset: 0; opacity: .08;
  background-image: radial-gradient(circle at 1px 1px, #fff 1px, transparent 0); background-size: 18px 18px; }
.g-top .inner { position: relative; max-width: 980px; margin: 0 auto; padding: 1rem 1.1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { color: #fff; text-decoration: none; display: flex; flex-direction: column; line-height: 1.1; }
.brand .school { font: 700 .7rem/1.2 var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.brand .cls { font: 600 1.35rem/1.1 var(--serif); }
.g-top nav { display: flex; gap: .25rem; }
.g-top nav a { color: rgba(255,255,255,.82); text-decoration: none; font-weight: 600; font-size: .93rem; padding: .55rem .8rem; border-radius: 999px; }
.g-top nav a:hover, .g-top nav a.on { background: rgba(255,255,255,.12); color: #fff; }
.hero { position: relative; max-width: 980px; margin: 0 auto; padding: 1.5rem 1.1rem 2.6rem; }
.hero h1 { color: #fff; margin-bottom: .3rem; }
.hero p { color: rgba(255,255,255,.85); max-width: 640px; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 1.1rem 6rem; }
.lift { margin-top: -1.6rem; position: relative; }

/* bottom tab bar on phones */
.tabbar { display: none; }
@media (max-width: 760px) {
  .g-top nav { display: none; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; background: #fff; border-top: 1px solid var(--line);
    padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom)); justify-content: space-around; }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--muted); font: 600 .7rem/1.1 var(--sans); padding: .3rem 0; }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a.on { color: var(--primary); }
  .card { padding: 1.1rem; }
}

/* Progress steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.step { text-decoration: none; color: var(--ink); text-align: center; padding: .8rem .3rem; border-radius: 12px; background: #faf8f3; border: 1.5px solid var(--line); }
.step .dot { width: 34px; height: 34px; border-radius: 50%; margin: 0 auto .35rem; display: grid; place-items: center; font-weight: 700; background: #fff; border: 2px solid var(--line); color: var(--muted); }
.step.done { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); background: var(--ok-bg); }
.step.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.next { border-color: var(--accent); background: #fffaf0; }
.step.next .dot { border-color: var(--accent); color: var(--warn); }
.step .lbl { font-weight: 700; font-size: .9rem; }
.step .sub { font-size: .74rem; color: var(--muted); }

/* Event cards */
.event { display: grid; grid-template-columns: 72px 1fr; gap: 1rem; align-items: start; }
.datebox { background: var(--primary); color: #fff; border-radius: 12px; text-align: center; padding: .55rem 0 .6rem; }
.datebox .m { font: 700 .72rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.datebox .d { font: 600 1.9rem/1 var(--serif); margin-top: .2rem; }
.datebox .w { font-size: .7rem; opacity: .75; margin-top: .15rem; }
.event + .event { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }

/* Then & Now */
.tn { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.tn figure { margin: 0; }
.tn .ph { aspect-ratio: 4/5; border-radius: 12px; overflow: hidden; background: #ece7db; display: grid; place-items: center; color: var(--muted); font-size: .85rem; text-align: center; }
.tn .ph img { width: 100%; height: 100%; object-fit: cover; }
.tn figcaption { text-align: center; font: 700 .72rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: .45rem; }
.sepia { filter: sepia(.25) contrast(1.02); }

/* Photo grid */
.pgrid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pgrid .pi { position: relative; border-radius: 12px; overflow: hidden; background: #ece7db; aspect-ratio: 1; }
.pgrid .pi img { width: 100%; height: 100%; object-fit: cover; }
.pgrid .pi .tag { position: absolute; left: .4rem; top: .4rem; }
.pgrid .pi .act { position: absolute; right: .4rem; bottom: .4rem; display: flex; gap: .3rem; }

/* Upload dropzone */
.drop { border: 2px dashed color-mix(in srgb, var(--primary) 30%, var(--line)); border-radius: var(--radius); padding: 1.6rem 1rem; text-align: center; background: #fdfcf9; cursor: pointer; display: block; }
.drop:hover, .drop.over { border-color: var(--primary); background: #fff; }
.drop .big { font: 600 1.15rem/1.3 var(--serif); }
.drop input { display: none; }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .5rem; margin-top: .8rem; }
.previews img { aspect-ratio: 1; object-fit: cover; border-radius: 8px; width: 100%; }
.progress { height: 8px; border-radius: 99px; background: #eee; overflow: hidden; margin-top: .8rem; }
.progress > div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }

/* People list */
.people { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.person { text-align: center; }
.person .av { aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #e9e3d6; margin: 0 auto .5rem; width: 100%; max-width: 120px; display: grid; place-items: center; font: 600 1.6rem var(--serif); color: var(--muted); }
.person .av img { width: 100%; height: 100%; object-fit: cover; }
.person .nm { font-weight: 700; line-height: 1.2; }
.person .sm { font-size: .82rem; color: var(--muted); }

/* Line items / totals */
.lines { width: 100%; border-collapse: collapse; }
.lines td { padding: .6rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.lines td:last-child { text-align: right; white-space: nowrap; padding-left: 1rem; }
.lines tr.total td { border-bottom: 0; font-weight: 800; font-size: 1.15rem; padding-top: .9rem; }
.paylogos { display: flex; gap: .5rem; justify-content: center; align-items: center; color: var(--muted); font-size: .82rem; margin-top: .7rem; }

/* Poll bars */
.bar { background: #efebe1; border-radius: 8px; height: 30px; position: relative; overflow: hidden; margin-top: .35rem; }
.bar > span { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--accent) 55%, #fff); }
.bar > b { position: relative; display: flex; justify-content: space-between; padding: 0 .7rem; line-height: 30px; font-size: .9rem; font-weight: 600; }
.opt { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; margin-bottom: .45rem; font-weight: 500; background: #fff; }
.opt:has(input:checked) { border-color: var(--primary); background: #f5f7fb; }
.opt input { width: 20px; height: 20px; accent-color: var(--primary); }

.qrbox { background: #fff; padding: 10px; border-radius: 12px; display: inline-block; box-shadow: var(--shadow); }
.qrbox img { width: 180px; height: 180px; }

/* ---------- Public landing ---------- */
.landing-hero { background: var(--primary); color: #fff; position: relative; overflow: hidden; }
.landing-hero::after { content: ''; position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%;
  border: 60px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.landing-hero .inner { position: relative; z-index: 1; max-width: 980px; margin: 0 auto; padding: 3rem 1.1rem 4.5rem; }
.landing-hero .yr { font: 600 clamp(4rem, 14vw, 8.5rem)/.85 var(--serif); color: var(--accent); letter-spacing: -.03em; }
.landing-hero h1 { color: #fff; font-size: clamp(1.6rem, 4vw, 2.4rem); margin-top: .6rem; }
.landing-hero p { color: rgba(255,255,255,.85); max-width: 560px; font-size: 1.08rem; }
.stats { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 1.4rem; }
.stats div { font-size: .85rem; color: rgba(255,255,255,.75); }
.stats b { display: block; font: 600 1.8rem/1 var(--serif); color: #fff; }
.map { width: 100%; height: 260px; border: 0; border-radius: 12px; background: #e9e3d6; }

/* ---------- Admin ---------- */
.a-shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.a-side { background: var(--primary); color: #fff; padding: 1.2rem .8rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.a-side .brand { padding: .2rem .6rem 1.2rem; }
.a-side .brand .cls { font-size: 1.15rem; }
.a-side .tag { font: 600 .7rem var(--sans); opacity: .6; letter-spacing: .1em; text-transform: uppercase; margin-top: .25rem; }
.a-side a.nav { display: flex; align-items: center; justify-content: space-between; gap: .6rem; color: rgba(255,255,255,.78); text-decoration: none; font-weight: 600; font-size: .93rem;
  padding: .6rem .7rem; border-radius: 9px; margin-bottom: 2px; }
.a-side a.nav:hover { background: rgba(255,255,255,.08); color: #fff; }
.a-side a.nav.on { background: rgba(255,255,255,.14); color: #fff; }
.a-side a.nav .ic { display: flex; align-items: center; gap: .6rem; }
.a-side a.nav svg { width: 18px; height: 18px; opacity: .85; }
.a-side .count { background: var(--accent); color: #1a1a1a; border-radius: 99px; font-size: .72rem; padding: .15rem .45rem; font-weight: 800; }
.a-side .sect { font: 700 .66rem var(--sans); text-transform: uppercase; letter-spacing: .14em; opacity: .45; padding: 1rem .7rem .35rem; }
.a-main { padding: 1.6rem 2rem 4rem; min-width: 0; }
.a-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.a-head h1 { font-size: 1.9rem; margin: 0; }
.a-mobilebar { display: none; }
@media (max-width: 900px) {
  .a-shell { grid-template-columns: 1fr; }
  .a-side { position: fixed; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform .2s; z-index: 80; }
  .a-side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .a-main { padding: 1rem 1rem 4rem; }
  .a-mobilebar { display: flex; align-items: center; justify-content: space-between; background: var(--primary); color: #fff; padding: .7rem 1rem; position: sticky; top: 0; z-index: 70; }
  .a-mobilebar button { background: none; border: 0; color: #fff; font-size: 1.5rem; }
}
.kpis { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); margin-bottom: 1.2rem; }
.kpi { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 1rem 1.1rem; }
.kpi .n { font: 600 1.9rem/1 var(--serif); }
.kpi .l { font-size: .82rem; color: var(--muted); margin-top: .35rem; font-weight: 600; }
.kpi .m { height: 6px; background: #efebe1; border-radius: 99px; margin-top: .6rem; overflow: hidden; }
.kpi .m span { display: block; height: 100%; background: var(--accent); }
.funnel { display: grid; gap: .45rem; }
.funnel .f { display: grid; grid-template-columns: 120px 1fr 56px; align-items: center; gap: .7rem; font-size: .9rem; }
.funnel .f .t { height: 22px; background: #efebe1; border-radius: 6px; overflow: hidden; }
.funnel .f .t span { display: block; height: 100%; background: var(--primary); border-radius: 6px; }
table.t { width: 100%; border-collapse: collapse; background: #fff; font-size: .92rem; }
table.t th { text-align: left; font: 700 .72rem var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .7rem .75rem; border-bottom: 1.5px solid var(--line); background: #fbfaf6; position: sticky; top: 0; }
table.t td { padding: .65rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:hover td { background: #fcfbf8; }
.tablewrap { overflow-x: auto; border-radius: 12px; box-shadow: var(--shadow); background: #fff; }
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: 1rem; border-bottom: 1.5px solid var(--line); }
.tabs a { text-decoration: none; padding: .6rem .9rem; font-weight: 600; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; display: flex; gap: .4rem; align-items: center; }
.tabs a.on { color: var(--ink); border-color: var(--accent); }
.tabs .count { background: var(--accent); color: #1a1a1a; border-radius: 99px; font-size: .7rem; padding: .1rem .4rem; font-weight: 800; }
.mini-av { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #e9e3d6; display: inline-grid; place-items: center; font-weight: 700; color: var(--muted); font-size: .8rem; vertical-align: middle; }
.ap-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.ap { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); position: relative; }
.ap .img { display: block; aspect-ratio: 1; background: #ece7db; overflow: hidden; }
.ap .img img { width: 100%; height: 100%; object-fit: cover; }
.ap .meta { padding: .6rem .7rem; font-size: .85rem; }
.ap .btns { display: flex; gap: .3rem; padding: 0 .6rem .7rem; flex-wrap: wrap; }
.ap .sel { position: absolute; top: .5rem; left: .5rem; width: 22px; height: 22px; accent-color: var(--primary); }
.toolbar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar input[type=search] { max-width: 280px; }
.toolbar select { width: auto; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; background: #f3f0e8; padding: .15rem .4rem; border-radius: 6px; word-break: break-all; }
.copyfield { display: flex; gap: .4rem; }
.copyfield input { font-family: ui-monospace, Menlo, monospace; font-size: .82rem; }
details.box { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: .9rem 1.1rem; }
details.box + details.box { margin-top: .7rem; }
details.box summary { cursor: pointer; font-weight: 700; }
.preview-frame { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }

/* Check-in scanner */
#reader { width: 100%; max-width: 460px; border-radius: 14px; overflow: hidden; background: #000; min-height: 260px; }
.scanres { font-size: 1.1rem; padding: 1rem; border-radius: 12px; }

/* ---------- Print ---------- */
@media print {
  .noprint { display: none !important; }
  body { background: #fff; }
}

/* inline icons */
h2 svg, h3 svg, p svg, a > svg:only-child, .drop svg { width: 1.15em; height: 1.15em; vertical-align: -.2em; }
.drop svg { width: 34px; height: 34px; }
.tn .ph svg { width: 28px; height: 28px; margin: 0 auto .3rem; display: block; }
.grid2 > .card + .card, .grid3 > .card + .card, .grid2 > * + .card { margin-top: 0; }
