:root{
  --page-bg:#f5f7fa;
  --card-bg:#ffffff;
  --text:#172033;
  --muted:#687386;
  --border:#dfe4ea;
  --accent:#0d6efd;
  --accent-dark:#0b5ed7;
  --success-bg:#eaf7ef;
  --success-border:#b7e0c3;
  --success-text:#176b34;
  --danger-bg:#fff1f1;
  --danger-border:#f0b9b9;
  --danger-text:#9c2525;
}

*{
  box-sizing:border-box;
}

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

body{
  margin:0;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:var(--page-bg);
  color:var(--text);
}

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

.party-shell{
  width:min(calc(100% - 28px),720px);
  margin:0 auto;
  padding:24px 0 48px;
}

.party-header{
  margin-bottom:20px;
}

.party-header h1{
  margin:0 0 8px;
  font-size:clamp(1.75rem,7vw,2.4rem);
  line-height:1.08;
}

.party-header p{
  margin:0;
  color:var(--muted);
  line-height:1.5;
}

.package-card,
.booking-card{
  background:var(--card-bg);
  border:1px solid var(--border);
  border-radius:18px;
  padding:20px;
  margin-bottom:14px;
  box-shadow:0 4px 18px rgba(0,0,0,.04);
}

.package-card h2,
.booking-card h2{
  line-height:1.25;
}

.package-card h2{
  margin:0 0 6px;
  font-size:1.3rem;
}

.package-price{
  font-size:1.6rem;
  font-weight:800;
  margin:8px 0;
}

.package-card p{
  margin:0 0 18px;
  color:var(--muted);
  line-height:1.45;
}

.btn-primary,
.btn-secondary{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:52px;
  padding:12px 18px;
  border-radius:12px;
  font-weight:750;
  font-size:1rem;
  text-decoration:none;
  cursor:pointer;
}

.btn-primary{
  border:0;
  background:var(--accent);
  color:#fff;
}

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

.btn-primary:disabled{
  opacity:.65;
  cursor:not-allowed;
}

.btn-secondary{
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
}

.btn-secondary:hover{
  background:#f8f9fa;
}

/* ---------- Calendar / slots ---------- */

.slot-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}

.slot-button{
  margin:0;
}

.no-slots{
  margin:4px 0 0;
  color:var(--muted);
  line-height:1.5;
}

.calendar-head{
  display:grid;
  grid-template-columns:44px 1fr 44px;
  align-items:center;
  gap:8px;
  margin-bottom:14px;
}

.calendar-head h2{
  margin:0;
  text-align:center;
  font-size:1.2rem;
}

.calendar-nav{
  height:44px;
  border:1px solid var(--border);
  border-radius:11px;
  background:#fff;
  font-size:1.7rem;
  line-height:1;
  cursor:pointer;
  color:var(--text);
}

.calendar-nav:disabled{
  opacity:.3;
  cursor:not-allowed;
}

.calendar-weekdays,
.calendar-grid{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:6px;
}

.calendar-weekdays{
  margin-bottom:6px;
}

.calendar-weekdays span{
  text-align:center;
  color:var(--muted);
  font-size:.78rem;
  font-weight:700;
}

.calendar-day{
  aspect-ratio:1/1;
  border-radius:10px;
  border:1px solid var(--border);
  font:inherit;
  font-weight:750;
  min-width:0;
}

.calendar-day.is-available{
  background:var(--accent);
  border-color:var(--accent);
  color:#fff;
  cursor:pointer;
}

.calendar-day.is-available:hover{
  background:var(--accent-dark);
}

.calendar-day.is-selected{
  outline:3px solid rgba(13,110,253,.25);
  outline-offset:2px;
}

.calendar-day.is-unavailable{
  background:#f1f3f5;
  color:#a2a9b3;
  cursor:not-allowed;
}

.calendar-blank{
  aspect-ratio:1/1;
}

.calendar-loading{
  grid-column:1/-1;
  padding:24px 6px;
  text-align:center;
  color:var(--muted);
}

.calendar-legend{
  display:flex;
  gap:18px;
  flex-wrap:wrap;
  margin-top:14px;
  color:var(--muted);
  font-size:.88rem;
}

.calendar-legend span{
  display:flex;
  align-items:center;
  gap:6px;
}

.legend-box{
  display:inline-block;
  width:14px;
  height:14px;
  border-radius:4px;
  border:1px solid var(--border);
}

.legend-box.available{
  background:var(--accent);
  border-color:var(--accent);
}

.legend-box.unavailable{
  background:#f1f3f5;
}

/* ---------- Reservation status ---------- */

.hold-banner{
  display:flex;
  flex-direction:column;
  gap:4px;
  background:var(--success-bg);
  color:var(--success-text);
  border:1px solid var(--success-border);
  border-radius:14px;
  padding:14px 16px;
  margin-bottom:18px;
}

.hold-banner span{
  font-variant-numeric:tabular-nums;
}

.summary-row{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:20px;
  padding:11px 0;
  border-bottom:1px solid var(--border);
}

.summary-row:first-child{
  padding-top:0;
}

.summary-row:last-child{
  border-bottom:0;
  padding-bottom:0;
}

.summary-row span{
  color:var(--muted);
}

.summary-row strong{
  text-align:right;
}

.total-row{
  font-size:1.08rem;
}

/* ---------- Forms ---------- */

.field{
  display:block;
  width:100%;
  margin:0 0 18px;
}

.field:last-child{
  margin-bottom:0;
}

.field > label{
  display:block;
  width:100%;
  margin:0 0 7px;
  padding:0;
  font-weight:700;
  line-height:1.35;
}

.field > input,
.field > select,
.field > textarea{
  display:block;
  width:100%;
  max-width:100%;
  min-height:50px;
  margin:0;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  background:#fff;
  color:var(--text);
  transition:border-color .15s,box-shadow .15s;
}

.field > input:focus,
.field > select:focus,
.field > textarea:focus{
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(13,110,253,.12);
}

.field.field-invalid > input,
.field.field-invalid > select,
.field.field-invalid > textarea{
  border-color:#dc3545;
  box-shadow:0 0 0 3px rgba(220,53,69,.12);
}

.field-error{
  margin-top:6px;
  color:#b42318;
  font-size:.9rem;
  font-weight:650;
}

.field-error:empty{
  display:none;
}

.help-text{
  margin-top:6px;
  color:var(--muted);
  font-size:.93rem;
  line-height:1.45;
}

.optional-label{
  color:var(--muted);
  font-weight:500;
  font-size:.9rem;
}

.stepper{
  display:grid;
  grid-template-columns:52px minmax(0,1fr) 52px;
  gap:8px;
}

.stepper button{
  border:1px solid var(--border);
  background:#fff;
  border-radius:12px;
  font-size:1.5rem;
  cursor:pointer;
}

.stepper input{
  width:100%;
  min-width:0;
  min-height:50px;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  text-align:center;
  font-weight:700;
}

.option-card{
  border:1px solid var(--border);
  border-radius:14px;
  padding:14px;
}

.check-row{
  display:flex;
  gap:12px;
  align-items:flex-start;
  cursor:pointer;
}

.check-row input[type="checkbox"]{
  width:22px;
  height:22px;
  min-width:22px;
  flex:0 0 22px;
  margin:1px 0 0;
}

.check-row span{
  display:flex;
  flex-direction:column;
  gap:3px;
}

.check-row small{
  color:var(--muted);
}

.error-box{
  background:var(--danger-bg);
  border:1px solid var(--danger-border);
  color:var(--danger-text);
  padding:13px 15px;
  border-radius:12px;
  margin-bottom:14px;
}

.pizza-field{
  margin-top:12px;
}

/* ---------- Payment ---------- */

.payment-spinner{
  width:42px;
  height:42px;
  margin:22px auto 4px;
  border:4px solid #dfe4ea;
  border-top-color:var(--accent);
  border-radius:50%;
  animation:party-spin .8s linear infinite;
}

@keyframes party-spin{
  to{transform:rotate(360deg)}
}

/* ---------- Party management / invitations ---------- */

.copy-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  margin-bottom:12px;
}

.copy-row input{
  width:100%;
  min-width:0;
  min-height:48px;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  background:#fff;
}

.compact-btn{
  width:auto;
  min-width:88px;
}

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

.stat-box{
  border:1px solid var(--border);
  border-radius:14px;
  padding:14px 10px;
  text-align:center;
  background:#fff;
}

.stat-box strong{
  display:block;
  font-size:1.5rem;
  line-height:1;
  margin-bottom:5px;
}

.stat-box span{
  color:var(--muted);
  font-size:.85rem;
}

.guest-list{
  display:grid;
  gap:10px;
}

.guest-list-row{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:center;
  border-top:1px solid var(--border);
  padding-top:12px;
}

.guest-list-row:first-child{
  border-top:0;
  padding-top:0;
}

.guest-list-row > div{
  display:flex;
  flex-direction:column;
  gap:3px;
}

.guest-list-row small{
  color:var(--muted);
}

.status-pill{
  display:inline-flex;
  align-items:center;
  border-radius:999px;
  padding:6px 9px;
  font-size:.78rem;
  font-weight:750;
  white-space:nowrap;
}

.status-yes{
  background:#eaf7ef;
  color:#176b34;
}

.status-no{
  background:#f1f3f5;
  color:#596273;
}

.status-pending{
  background:#fff4d8;
  color:#7c5d00;
}

.invite-header{
  text-align:center;
}

.invite-big-name{
  text-align:center;
  font-size:1.7rem;
  font-weight:800;
  margin-bottom:18px;
}

.rsvp-choice-grid{
  display:grid;
  gap:10px;
}

.rsvp-choice{
  display:flex;
  align-items:center;
  gap:10px;
  border:1px solid var(--border);
  border-radius:12px;
  padding:14px;
  cursor:pointer;
}

.rsvp-choice input[type="radio"]{
  width:20px;
  height:20px;
  min-width:20px;
  margin:0;
}

.waiver-ok-text{
  color:#176b34 !important;
  font-weight:700;
}

.waiver-needed-text{
  color:#9c2525 !important;
  font-weight:700;
}

/* ---------- Waiver ---------- */

.waiver-document p{
  margin:0 0 16px;
  line-height:1.62;
}

.waiver-document h2{
  margin:26px 0 8px;
  font-size:1.08rem;
  line-height:1.3;
}

.waiver-document h2:first-of-type{
  margin-top:22px;
}

.waiver-complete{
  display:flex;
  flex-direction:column;
  gap:5px;
  padding:14px;
  border:1px solid var(--success-border);
  border-radius:12px;
  background:var(--success-bg);
  color:var(--success-text);
}

/*
 * IMPORTANT:
 * Acknowledgments are intentionally plain rows.
 * Checkbox at left, text at right. No card/box styling.
 */
.ack-list{
  display:block;
  width:100%;
  margin:0 0 22px;
}

.ack-item{
  display:flex;
  align-items:flex-start;
  width:100%;
  gap:10px;
  margin:0;
  padding:8px 0;
}

.ack-item input[type="checkbox"]{
  display:block;
  appearance:auto;
  -webkit-appearance:checkbox;
  width:18px;
  height:18px;
  min-width:18px;
  max-width:18px;
  flex:0 0 18px;
  margin:3px 0 0;
  padding:0;
  border:0;
  border-radius:0;
  box-shadow:none;
}

.ack-item label{
  display:block;
  flex:1 1 auto;
  width:auto;
  min-width:0;
  margin:0;
  padding:0;
  font-weight:400;
  line-height:1.45;
  text-align:left;
  cursor:pointer;
}

/* ---------- Desktop ---------- */

@media(min-width:700px){
  .package-card,
  .booking-card{
    padding:24px;
  }

  .hold-banner{
    flex-direction:row;
    justify-content:space-between;
    align-items:center;
  }

  .slot-grid{
    grid-template-columns:repeat(3,1fr);
    gap:12px;
  }

  .calendar-weekdays,
  .calendar-grid{
    gap:8px;
  }

  .rsvp-choice-grid{
    grid-template-columns:1fr 1fr;
  }
}


/* ---------- Phase 7C readability cleanup ---------- */

/* Human-readable label/value rows */
.summary-row{
  display:grid;
  grid-template-columns:minmax(82px,auto) minmax(0,1fr);
  column-gap:12px;
  align-items:start;
}

.summary-row > span{
  min-width:0;
}

.summary-row > span::after{
  content:":";
}

.summary-row > strong{
  min-width:0;
  text-align:right;
  overflow-wrap:anywhere;
}

/* Proper breathing room before form submit buttons */
.form-actions{
  margin-top:22px;
}

.form-actions .btn-primary{
  margin:0;
}

/* Keep the final field from visually colliding with the submit area */
.booking-card .field:last-of-type{
  margin-bottom:18px;
}

@media(max-width:430px){
  .summary-row{
    grid-template-columns:minmax(72px,auto) minmax(0,1fr);
    column-gap:10px;
  }
}
/* ---------- Phase 9 deposit agreement ---------- */

.deposit-terms-box{
  border:1px solid #dfe4ea;
  border-radius:14px;
  background:#f8f9fb;
  padding:15px;
}

.deposit-terms-row{
  display:flex;
  align-items:flex-start;
  gap:11px;
  margin:0;
  cursor:pointer;
  line-height:1.5;
}

.deposit-terms-row input[type="checkbox"]{
  appearance:auto;
  -webkit-appearance:checkbox;
  width:19px !important;
  height:19px !important;
  min-width:19px !important;
  max-width:19px !important;
  flex:0 0 19px !important;
  margin:3px 0 0 !important;
  padding:0 !important;
  border:0 !important;
  box-shadow:none !important;
}

.deposit-terms-row span{
  flex:1;
  min-width:0;
}
/* ---------- Phase 9A summary amount wrapping fix ---------- */

/*
 * Give the value column only the width it needs and let the label
 * use/wrap within the remaining space.
 */
.summary-row{
  grid-template-columns:minmax(0,1fr) auto !important;
}

/*
 * Monetary values and other summary values should never break
 * character-by-character on narrow screens.
 */
.summary-row > strong{
  width:auto !important;
  min-width:max-content !important;
  white-space:nowrap !important;
  overflow-wrap:normal !important;
  word-break:normal !important;
}
/* ---------- Phase 10 discounts ---------- */

.promo-code-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:stretch;
}

.promo-code-row input{
  min-width:0;
}

.promo-message{
  margin-top:10px;
  padding:10px 12px;
  border-radius:10px;
  font-size:14px;
  line-height:1.4;
}

.promo-ok{
  background:#edf8f0;
  border:1px solid #b9dfc3;
  color:#176b34;
}

.promo-error{
  background:#fff0f0;
  border:1px solid #efc0c0;
  color:#9f1c1c;
}

.link-button{
  border:0;
  background:transparent;
  padding:10px 0 0;
  color:#0d6efd;
  text-decoration:underline;
  cursor:pointer;
  font:inherit;
}

.discount-row strong{
  color:#176b34;
}

@media (max-width:420px){
  .promo-code-row{
    grid-template-columns:1fr;
  }

  .promo-code-row .compact-btn{
    width:100%;
  }
}
