/* Village Bible Church event registration — shared styles.
   Colors/fonts below are defaults; each event's look & feel (set in /admin)
   overrides --red, --green, --cream, --night, --display, --script, --bg-image. */
:root {
  --red: #C40014;
  --green: #3A9A04;
  --cream: #FFFBEF;
  --paper: #FFFDF8;
  --ink: #2B2118;
  --muted: #6E6152;
  --line: #E8DDC6;
  --field: #FFFFFF;
  --night: #120E0A;
  --amber: #F2C46B;
  --radius: 18px;
  --bg-image: url('/assets/street-bg.jpg');
  --display: 'Oranienbaum', 'Bodoni 72 Condensed', 'Didot', Georgia, serif;
  --script: 'Pinyon Script', 'Snell Roundhand', 'Apple Chancery', cursive;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color-scheme: light;
}

/* Shades derived from the theme colors (re-declared on .themed previews) */
:root, .themed {
  --red-dark: color-mix(in srgb, var(--red) 78%, black);
  --red-soft: color-mix(in srgb, var(--red) 11%, white);
  --green-dark: color-mix(in srgb, var(--green) 75%, black);
  --green-soft: color-mix(in srgb, var(--green) 12%, white);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--night);
}
/* Fixed photo backdrop (pseudo-element so it works on iPhone too) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--night) 15%, transparent) 0%,
      color-mix(in srgb, var(--night) 55%, transparent) 45%,
      color-mix(in srgb, var(--night) 88%, transparent) 100%),
    var(--bg-image) center 30% / cover no-repeat;
}

a { color: var(--red); }
img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* ---------- Hero ---------- */
.hero { padding: clamp(28px, 7vw, 72px) 0 clamp(18px, 4vw, 34px); text-align: center; }
.hero .badge-img { width: min(100%, 720px); margin: 0 auto; filter: drop-shadow(0 18px 40px rgba(0,0,0,.45)); }
.hero .banner-img { width: min(100%, 900px); margin: 0 auto; border-radius: var(--radius); box-shadow: 0 24px 60px rgba(0,0,0,.45); }
.hero:empty { min-height: 220px; }
.hero-meta {
  margin: 18px auto 0;
  color: var(--cream);
  font-size: 13px;
  letter-spacing: .22em;
  text-transform: uppercase;
  opacity: .92;
}
.hero-meta .dot { color: var(--amber); padding: 0 .5em; }

/* CSS version of the notched cream badge (Christmas Eve / manage pages) */
.badge {
  position: relative;
  isolation: isolate;
  display: inline-block;
  max-width: 100%;
  background: var(--cream);
  border-radius: clamp(14px, 3vw, 26px);
  padding: clamp(14px, 3.2vw, 26px) clamp(22px, 5vw, 52px) clamp(18px, 3.6vw, 30px);
  filter: drop-shadow(0 18px 40px rgba(0,0,0,.45));
}
.badge::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 15%; bottom: 15%;
  left: -4.6%; right: -4.6%;
  background: var(--cream);
  border-radius: inherit;
}
.badge-title {
  display: block;
  font-family: var(--display);
  color: var(--red);
  text-transform: uppercase;
  font-size: clamp(34px, 8.6vw, 78px);
  line-height: .92;
  letter-spacing: .01em;
}
.badge-script {
  display: block;
  font-family: var(--script);
  color: var(--green);
  font-size: clamp(26px, 6.2vw, 54px);
  line-height: 1;
  margin-top: -.12em;
}

/* ---------- Cards ---------- */
.card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0,0,0,.35), 0 2px 0 rgba(255,255,255,.6) inset;
  padding: clamp(20px, 4.5vw, 36px);
  margin: 0 0 18px;
}
.card + .card { margin-top: 0; }

.section { padding: 4px 0 22px; border-bottom: 1px dashed var(--line); margin-bottom: 22px; }
.section:last-of-type { border-bottom: 0; margin-bottom: 0; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.step {
  flex: none;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--red); color: #fff;
  font-weight: 700; font-size: 14px;
  transform: translateY(-3px);
}
h2.title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: .02em;
  font-size: clamp(26px, 5.4vw, 34px);
  line-height: 1.05;
}
.script { font-family: var(--script); color: var(--green); font-size: 1.6em; line-height: 1; }
.help { color: var(--muted); font-size: 14px; margin: 4px 0 14px; }

/* ---------- Session picker ---------- */
.sessions { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 12px; }
.sessions.two { grid-template-columns: repeat(2, 1fr); }
.session {
  position: relative;
  display: block;
  cursor: pointer;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--field);
  padding: 14px 14px 12px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.session input { position: absolute; opacity: 0; pointer-events: none; }
.session:hover { border-color: #D9C9A6; }
.session:has(input:focus-visible) { outline: 3px solid var(--amber); outline-offset: 2px; }
.session.selected { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.session.selected::after {
  content: "✓"; position: absolute; top: 10px; right: 12px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--red); color: #fff; font-size: 13px; font-weight: 700;
  display: grid; place-items: center;
}
.session.disabled { cursor: not-allowed; opacity: .55; background: #F6F1E6; }
.session-time { font-family: var(--display); color: var(--red); font-size: 34px; line-height: 1; text-transform: uppercase; }
.session-day { font-size: 13px; color: var(--muted); margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #F3EEE3; color: var(--muted); }
.chip.cc { background: var(--green-soft); color: var(--green-dark); }
.chip.low { background: var(--red-soft); color: var(--red-dark); }
.chip.full { background: #E9E4DA; color: #5d554b; }

/* ---------- Fields ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: block; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 5px 2px; }
.req { color: var(--red); }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], textarea, select {
  width: 100%;
  font: inherit;
  font-size: 16px; /* prevents iOS zoom */
  color: var(--ink);
  background: var(--field);
  border: 1.5px solid #D9CDB3;
  border-radius: 10px;
  padding: 11px 12px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
input.invalid, textarea.invalid { border-color: var(--red); background: #FFF6F6; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- People ---------- */
.people { display: grid; gap: 10px; }
.person {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
}
.person-row { display: grid; grid-template-columns: 1fr 1fr 84px 36px; gap: 8px; align-items: end; }
.person-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px 2px; }
.person-label .you { color: var(--green-dark); text-transform: none; letter-spacing: 0; font-weight: 600; }
.icon-btn {
  width: 36px; height: 44px; border: 0; border-radius: 10px;
  background: transparent; color: #A39582; font-size: 22px; cursor: pointer;
}
.icon-btn:hover { background: var(--red-soft); color: var(--red); }
.icon-btn[disabled] { visibility: hidden; }
.cc-toggle {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 10px; padding: 10px 12px;
  border-radius: 10px; background: var(--green-soft); color: var(--green-dark);
  font-size: 14px; cursor: pointer;
}
.cc-toggle input { width: 20px; height: 20px; accent-color: var(--green); margin: 1px 0 0; flex: none; }
.cc-note { margin-top: 10px; padding: 9px 12px; border-radius: 10px; background: #F6F1E6; color: var(--muted); font-size: 13.5px; }
.add-person {
  margin-top: 10px;
  width: 100%;
  padding: 12px;
  border: 2px dashed #D9C9A6;
  border-radius: 14px;
  background: transparent;
  color: var(--red);
  font: inherit; font-weight: 700;
  cursor: pointer;
}
.add-person:hover { background: #FFF7F1; border-color: var(--red); }
.tally {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  margin-top: 14px; padding: 12px 14px;
  border-radius: 12px; background: #F8F3E8;
  font-size: 14px; color: var(--muted);
}
.tally b { color: var(--ink); }

/* ---------- Choice pills ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; }
.pill span {
  display: inline-block; padding: 9px 14px; border-radius: 999px;
  border: 1.5px solid #D9CDB3; background: #fff; font-size: 14px; cursor: pointer;
}
.pill input:checked + span { border-color: var(--green); background: var(--green-soft); color: var(--green-dark); font-weight: 600; }
.pill input:focus-visible + span { outline: 3px solid var(--amber); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: 16px;
  padding: 14px 24px; border-radius: 999px; border: 0;
  background: var(--red); color: #fff; cursor: pointer; text-decoration: none;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--red) 25%, transparent);
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--red-dark); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn.block { width: 100%; padding: 17px 24px; font-size: 17px; }
.btn.ghost { background: transparent; color: var(--red); box-shadow: inset 0 0 0 2px var(--red); }
.btn.ghost:hover { background: var(--red-soft); }
.btn.green { background: var(--green); box-shadow: 0 6px 16px color-mix(in srgb, var(--green) 25%, transparent); }
.btn.green:hover { background: var(--green-dark); }
.btn.small { padding: 8px 14px; font-size: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--red); text-decoration: underline; cursor: pointer; }

/* ---------- Messages ---------- */
.alert { border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; font-size: 15px; }
.alert.error { background: var(--red-soft); color: var(--red-dark); border: 1px solid #F2C3C6; }
.alert.ok { background: var(--green-soft); color: var(--green-dark); border: 1px solid #CBE5B8; }
.alert.info { background: #F6F1E6; color: var(--muted); border: 1px solid var(--line); }
.closed-box { text-align: center; padding: 18px 0 6px; }

/* ---------- Confirmation / summary ---------- */
.done { text-align: center; }
.done .big { font-family: var(--display); color: var(--red); text-transform: uppercase; font-size: clamp(36px, 8vw, 54px); line-height: 1; margin: 6px 0 0; }
.done .script { font-size: clamp(30px, 6vw, 42px); }
.summary { text-align: left; margin: 20px 0; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; padding: 16px 18px; }
.summary .k { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.summary .when { font-family: var(--display); color: var(--red); font-size: 28px; line-height: 1.1; margin: 2px 0 12px; }
.summary ul { list-style: none; padding: 0; margin: 6px 0 0; }
.summary li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid #F1EADB; font-size: 15px; }
.summary li:last-child { border-bottom: 0; }
.summary li .age { color: var(--muted); white-space: nowrap; }
.tag-cc { color: var(--green-dark); font-weight: 600; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .18em; font-weight: 700; font-size: 18px; color: var(--ink); }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(18,14,10,.6); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--paper); border-radius: var(--radius); max-width: 420px; width: 100%; padding: 24px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.modal h3 { margin: 0 0 8px; font-family: var(--display); color: var(--red); font-weight: 400; font-size: 30px; text-transform: uppercase; }

/* ---------- Footer ---------- */
.foot { text-align: center; color: rgba(255,251,239,.7); font-size: 13px; padding: 10px 16px 40px; }
.foot a { color: var(--cream); }

.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--red); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
  .grid2 { grid-template-columns: 1fr; }
  .person-row { grid-template-columns: 1fr 1fr 36px; }
  .person-row .age-field { grid-column: 1 / 2; grid-row: 2; }
  .sessions.two { grid-template-columns: 1fr 1fr; }
  .session-time { font-size: 30px; }
  .hero-meta { letter-spacing: .14em; font-size: 12px; }
}
@media (max-width: 360px) {
  .sessions.two { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.nw { white-space: nowrap; }
.foot-logo { display: block; width: fit-content; margin: 6px auto 10px; opacity: .9; }
.foot-logo:hover { opacity: 1; }
.foot-logo img { width: 200px; height: auto; }

/* Times grouped by day (multi-day events like Easter) */
.day-group + .day-group { margin-top: 16px; }
.day-head { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px 2px; }
.intro { font-size: 16px; margin: 0 0 22px; color: var(--ink); white-space: pre-line; }

/* ---------- Sticky church header (matches villagebible.church) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: #000; color: #fff;
  font-family: 'Montserrat', var(--body);
}
.sh-in { max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 78px; display: flex; align-items: center; gap: 24px; }
.sh-brand { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; flex: none; }
.sh-brand img { width: 44px; height: 44px; }
.sh-name { display: flex; flex-direction: column; line-height: 1.2; text-transform: uppercase; }
.sh-line1 { font-weight: 800; font-size: 14px; letter-spacing: .24em; }
.sh-line2 { font-weight: 700; font-size: 13px; letter-spacing: .24em; color: #A8A8A8; }
.sh-nav { margin-left: auto; display: flex; align-items: center; gap: 30px; }
.sh-nav a { color: #fff; text-decoration: none; font-weight: 800; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.sh-nav a:hover { color: #C9C9C9; }
.sh-nav a.sh-pill { background: #4A4A4A; border-radius: 999px; padding: 12px 26px; font-weight: 600; letter-spacing: .06em; }
.sh-nav a.sh-pill:hover { background: #5c5c5c; color: #fff; }
.sh-burger { display: none; margin-left: auto; width: 44px; height: 44px; background: none; border: 0; padding: 10px 6px; cursor: pointer; }
.sh-burger span { display: block; height: 3px; background: #8A8A8A; border-radius: 2px; margin: 5px 0; transition: transform .2s, opacity .2s; }
@media (max-width: 860px) {
  .sh-in { height: 64px; padding: 0 16px; }
  .sh-brand img { width: 40px; height: 40px; }
  .sh-line1 { font-size: 12px; letter-spacing: .2em; }
  .sh-line2 { font-size: 11px; letter-spacing: .2em; }
  .sh-burger { display: block; }
  .sh-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #000; border-top: 1px solid #222; padding: 8px 0 16px;
  }
  .sh-nav a { padding: 14px 20px; font-size: 15px; }
  .sh-nav a.sh-pill { margin: 10px 16px 0; text-align: center; }
  body.sh-open .sh-nav { display: flex; }
  body.sh-open .sh-burger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  body.sh-open .sh-burger span:nth-child(2) { opacity: 0; }
  body.sh-open .sh-burger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}
@media (max-width: 360px) { .sh-line1, .sh-line2 { letter-spacing: .12em; } }
/* Keep the badge's side tabs and the date line inside narrow phone screens */
.badge { max-width: 90%; }
@media (max-width: 560px) { .hero-meta .nw { white-space: normal; } }
