:root {
  --bg: #fff7df;
  --ink: #081552;
  --muted: #5a5f7a;
  --line: #f0c66b;
  --surface: #fffdf5;
  --surface-2: #fff0bd;
  --accent: #d91f12;
  --accent-dark: #9d130c;
  --navy: #07145d;
  --green: #15823f;
  --gold: #ffc928;
  --sky: #d8f1ff;
  --shadow: 0 18px 55px rgba(9, 21, 82, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 8%, rgba(255, 201, 40, 0.28), transparent 28%),
    linear-gradient(180deg, var(--sky) 0%, var(--bg) 42%, #fff4cd 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 12px clamp(18px, 5vw, 56px);
  border-bottom: 1px solid rgba(80, 51, 23, 0.12);
  background: rgba(255, 253, 245, 0.93);
  backdrop-filter: blur(16px);
}

.brand,
.text-button,
.icon-button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  text-align: left;
  cursor: default;
}

.brand small,
.hint,
.event-list span,
.section-title p,
.hero-copy p,
.event-meta p,
.detail-head p {
  color: var(--muted);
}

.mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--gold);
  box-shadow: 0 4px 12px rgba(8, 21, 82, 0.14);
  overflow: hidden;
}

.mark img {
  display: block;
  width: 34px;
  height: 39px;
  object-fit: contain;
}

.topbar nav {
  display: flex;
  gap: 8px;
}

.text-button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 6px;
}

.text-button.active,
.text-button:hover {
  background: var(--surface-2);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.75fr);
  gap: clamp(28px, 6vw, 80px);
  align-items: center;
  min-height: calc(100vh - 170px);
  padding: clamp(46px, 8vw, 96px) 0 40px;
}

.event-hero {
  position: relative;
}

.welcome-hero {
  position: relative;
}

.event-hero::before {
  content: "";
  position: absolute;
  inset: 20px 0 auto;
  height: 76px;
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent 0 42%, #e31e13 43% 58%, transparent 59%) 0 0 / 78px 76px,
    linear-gradient(135deg, transparent 0 42%, #ffb400 43% 58%, transparent 59%) 26px 0 / 78px 76px,
    linear-gradient(135deg, transparent 0 42%, #08206d 43% 58%, transparent 59%) 52px 0 / 78px 76px;
  opacity: 0.72;
}

.welcome-hero::before {
  content: "";
  position: absolute;
  inset: 20px 0 auto;
  height: 76px;
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent 0 42%, #e31e13 43% 58%, transparent 59%) 0 0 / 78px 76px,
    linear-gradient(135deg, transparent 0 42%, #ffb400 43% 58%, transparent 59%) 26px 0 / 78px 76px,
    linear-gradient(135deg, transparent 0 42%, #08206d 43% 58%, transparent 59%) 52px 0 / 78px 76px;
  opacity: 0.72;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 0.94;
  letter-spacing: 0;
  color: var(--navy);
  text-transform: uppercase;
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.9);
}

.hero-copy > p:not(.eyebrow) {
  max-width: 630px;
  font-size: 20px;
  line-height: 1.6;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.event-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0;
}

.event-strip span {
  display: grid;
  gap: 3px;
  min-height: 74px;
  padding: 13px;
  border: 2px solid var(--navy);
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-weight: 900;
  box-shadow: 0 6px 0 rgba(8, 21, 82, 0.12);
}

.event-strip strong {
  color: var(--navy);
  font-size: 13px;
  text-transform: uppercase;
}

.mandir-address {
  display: grid;
  gap: 6px;
  max-width: 620px;
  margin: 24px 0;
  padding: 16px;
  border-left: 6px solid var(--accent);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 8px 24px rgba(8, 21, 82, 0.1);
}

.mandir-address strong {
  color: var(--navy);
}

.mandir-address span {
  color: var(--muted);
  font-weight: 800;
}

.hero-actions,
.detail-actions,
.kids-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 7px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-weight: 800;
}

.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 5px 0 var(--accent-dark);
}

.primary:hover {
  background: var(--accent-dark);
}

.secondary {
  border-color: var(--navy);
  background: var(--surface);
  color: var(--ink);
}

.small {
  min-height: 38px;
  padding: 0 12px;
  font-size: 14px;
}

.wide {
  width: 100%;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.preview-panel,
.event-card,
.form-panel,
.login-panel form,
.admin-sidebar,
.admin-main,
.editor {
  border: 1px solid rgba(80, 51, 23, 0.12);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.preview-panel {
  padding: 18px;
}

.flyer-panel {
  padding: 10px;
  background: var(--navy);
}

.flyer-panel img {
  display: block;
  width: 100%;
  max-height: min(72vh, 760px);
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}

.mandir-photo-panel {
  padding: 10px;
  background: #fff;
}

.mandir-photo-panel img {
  display: block;
  width: 100%;
  max-height: min(75vh, 780px);
  object-fit: cover;
  object-position: center top;
  border-radius: 6px;
}

.event-callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 20px;
  align-items: center;
  margin: 0 0 28px;
  padding: clamp(18px, 4vw, 28px);
  border: 3px solid var(--gold);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.event-callout h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1;
}

.event-callout p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.55;
}

.event-callout img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--navy);
}

.compact-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 18px 0;
}

.compact-strip span {
  min-height: 0;
}

.flyer-mock,
.flyer-placeholder {
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 28px;
  border-radius: 6px;
  color: #fff;
  text-align: center;
  background:
    linear-gradient(145deg, rgba(180, 59, 47, 0.92), rgba(216, 155, 34, 0.88)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cpath d='M70 12 82 46h36L89 67l11 35-30-22-30 22 11-35-29-21h36Z' fill='rgba(255,255,255,.18)'/%3E%3C/svg%3E");
}

.flyer-mock strong,
.flyer-placeholder strong {
  display: block;
  max-width: 320px;
  font-size: 40px;
  line-height: 1.05;
}

.flyer-mock span,
.flyer-placeholder span {
  font-size: 18px;
  font-weight: 900;
}

.mini-stats,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.mini-stats span,
.stats-grid article {
  padding: 14px;
  border-radius: 6px;
  background: var(--surface-2);
}

.mini-stats strong,
.stats-grid strong {
  display: block;
  font-size: 28px;
}

.activity-band {
  margin: -8px 0 20px;
  padding: 18px;
  border: 3px solid var(--gold);
  border-radius: 8px;
  background: var(--navy);
  box-shadow: var(--shadow);
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.activity-grid article {
  min-height: 116px;
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.activity-grid article:nth-child(1) span,
.activity-grid article:nth-child(5) span {
  background: var(--green);
}

.activity-grid article:nth-child(2) span,
.activity-grid article:nth-child(4) span {
  background: var(--accent);
}

.activity-grid span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  background: #145dd8;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.activity-grid strong {
  display: block;
  margin-top: 10px;
  color: var(--navy);
  font-size: 14px;
}

.band {
  padding: 44px 0 70px;
}

.section-title {
  margin-bottom: 20px;
}

.section-title h2,
.detail-head h2,
.login-panel h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0;
}

.section-title.compact h2 {
  font-size: 30px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.steps article {
  min-height: 188px;
  padding: 22px;
  border-radius: 8px;
  background: var(--surface);
  border: 2px solid var(--line);
}

.steps span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.rsvp-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1fr);
  gap: 22px;
  padding: 34px 0;
}

.event-card {
  overflow: hidden;
}

.event-card img {
  display: block;
  width: 100%;
  max-height: 760px;
  object-fit: contain;
  background: var(--navy);
}

.event-meta,
.form-panel,
.login-panel form,
.editor,
.admin-main {
  padding: clamp(20px, 4vw, 34px);
}

dl {
  display: grid;
  gap: 12px;
  margin: 24px 0 0;
}

.event-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 2px;
}

.event-badges span {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--navy);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.form-title {
  padding-bottom: 16px;
  border-bottom: 3px solid var(--gold);
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 2px 0 0;
  font-weight: 800;
}

form {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 7px;
}

label span,
.kids-head h3 {
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 2px solid #ead38f;
  border-radius: 6px;
  background: #fffdf8;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(255, 201, 40, 0.38);
  border-color: var(--accent);
}

textarea {
  resize: vertical;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.kids-head {
  justify-content: space-between;
}

.kids-head h3 {
  margin: 0;
}

#kids-list {
  display: grid;
  gap: 10px;
}

.add-child-button {
  width: 100%;
  border-style: dashed;
}

.kid-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 42px;
  gap: 10px;
  align-items: end;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdf8;
}

.hidden {
  visibility: hidden;
}

.error {
  margin: 0;
  padding: 12px;
  border-radius: 6px;
  background: #ffe9e6;
  color: #84251d;
  font-weight: 700;
}

.success-note {
  margin: 0;
  padding: 12px;
  border-radius: 6px;
  background: #e7f8ee;
  color: #165f35;
  font-weight: 800;
}

.success,
.empty,
.loading {
  padding: 64px 0;
  text-align: center;
}

.submitted-card {
  display: grid;
  gap: 18px;
  padding: 8px 0 0;
  text-align: left;
}

.submitted-card h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(28px, 7vw, 42px);
  line-height: 1.05;
}

.submitted-card > p:not(.eyebrow),
.share-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.submitted-overview {
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.submitted-overview h3 {
  margin: 0 0 12px;
}

.submitted-overview dl {
  margin: 0;
}

.success-actions {
  display: grid;
  gap: 10px;
}

.login-panel {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 120px);
}

.login-panel form {
  width: min(440px, 100%);
}

.admin-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  padding: 26px 0;
}

.admin-layout > *,
.admin-main,
.table-wrap,
.share-box {
  min-width: 0;
}

.admin-sidebar {
  align-self: start;
  padding: 18px;
  position: sticky;
  top: 92px;
}

.sidebar-head,
.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.event-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.event-list button {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdf8;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.event-list button.selected {
  border-color: var(--accent);
  background: #fff3e7;
}

.share-box {
  margin: 18px 0;
  padding: 13px;
  overflow-x: auto;
  border: 1px dashed var(--accent);
  border-radius: 6px;
  background: #fff5e9;
  color: var(--accent-dark);
  font-weight: 800;
}

.stats-grid {
  grid-template-columns: repeat(6, 1fr);
}

.stats-grid article span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.age-roster {
  margin-top: 24px;
}

.age-roster-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.age-roster-grid article {
  min-width: 0;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.age-roster-grid header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--navy);
  color: #fff;
}

.age-roster-grid header span {
  font-weight: 900;
}

.age-roster-grid header strong {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
}

.age-name-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.age-name {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 6px;
  background: var(--surface-2);
}

.age-name small,
.empty-age {
  color: var(--muted);
}

.empty-age {
  margin: 0;
  padding: 10px;
  text-align: center;
}

.table-wrap {
  margin-top: 18px;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.kid-pill {
  display: inline-flex;
  margin: 0 6px 6px 0;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  font-weight: 800;
  font-size: 13px;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  main {
    width: min(100% - 24px, 680px);
  }

  .hero,
  .rsvp-layout,
  .admin-layout,
  .event-callout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .steps,
  .mini-stats {
    grid-template-columns: 1fr;
  }

  .activity-grid,
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .admin-sidebar {
    position: static;
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .grid-2,
  .kid-row {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 42px;
  }

  .hero h1 {
    font-size: 46px;
  }

  .event-hero::before {
    inset: 10px 0 auto;
    height: 44px;
    background-size: 50px 44px;
  }

  .welcome-hero::before {
    inset: 10px 0 auto;
    height: 44px;
    background-size: 50px 44px;
  }

  .event-strip,
  .compact-strip,
  .activity-grid,
  .age-roster-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .event-strip span {
    min-height: 0;
  }

  .kid-row .icon-button {
    width: 100%;
  }

  .detail-head,
  .sidebar-head {
    flex-direction: column;
  }
}
