/* =========================================================================
   Competition form (/competition) and payment summary (/pay/{token})
   Builds on hbs.css tokens. Loaded via $page['styles'] = ['competition.css'].
   ========================================================================= */

/* [hidden] must beat component display rules (.alert, .row, .fields are flex/grid) */
.comp [hidden], .pay [hidden], .paybar[hidden] { display: none !important; }
.nowrap { white-space: nowrap; }

/* ---------- intro ---------- */
.comp-intro { max-width: 860px; margin-bottom: clamp(28px, 4vw, 44px); }
.comp-intro .display em,
.pay-intro .display em { font-style: italic; font-weight: 500; color: var(--red); }
.prize {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 16px;
  font-size: 1.05rem; font-weight: 500; color: var(--text);
}
.prize strong { font-weight: 800; font-stretch: 85%; letter-spacing: .01em; }
.prize img { display: none; } /* legacy clip-art stars clash with the editorial look; a gold seal dot stands in */
.prize::before {
  content: ""; width: 14px; height: 14px; flex: none; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold-light) 35%, var(--gold) 75%, #8a6420);
  box-shadow: 0 2px 6px -2px rgba(140, 100, 30, .7);
}
.js .prize::before { animation: spark .9s var(--ease) .45s both; }
@keyframes spark { from { opacity: 0; transform: scale(.4); } }
.comp-intro .lede { margin: 0 0 22px; }

.comp-facts {
  list-style: none; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--ink);
  display: flex; flex-wrap: wrap; gap: 10px 36px; font-size: 15px; font-weight: 600;
}
.comp-facts li { display: grid; gap: 2px; }
.comp-facts span { font-size: 13px; font-weight: 500; color: var(--muted); }
.comp-facts a { color: var(--text); text-decoration-color: var(--accent); text-underline-offset: 3px; }
.comp-facts a:hover { color: var(--accent-ink); }

/* ---------- form chrome ---------- */
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.opt-label { font-weight: 400; color: var(--muted); }
.panel-title { gap: 14px; }
.panel-lede { margin: -6px 0 18px; color: var(--muted); font-size: 15px; }
.cert-hint { margin: -8px 0 0; font-size: 13px; color: var(--muted); }

/* mobile gate */
.input-group { position: relative; }
.input-group .input { padding-right: 44px; }
.gate-icon { position: absolute; right: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; pointer-events: none; }
.is-checking .gate-icon { border: 2px solid var(--mist-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
.is-ok .gate-icon {
  background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3.2L15 7' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat;
  border-radius: 50%; animation: pop .35s var(--ease);
}
.gate-status:empty { display: none; }
.gate-card {
  margin-top: 18px; padding: 16px 18px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--mist); display: grid; gap: 12px; font-size: 15px; animation: rise .4s var(--ease) both;
}
.gate-card p { margin: 0; }
.gate-card strong { display: block; font-size: 16px; margin-bottom: 2px; }
.gate-card .actions { margin: 0; }
.gate-card .btn { min-height: 44px; font-size: 16px; padding: 0 20px; }
.gate-card.is-registered { background: var(--ok-wash); border-color: #bfe3cf; }
.gate-card.is-pending { background: var(--warn-wash); border-color: #f1d9a3; }

/* progressive reveal of steps 2-4 */
.gated { margin-top: 20px; }
.js .gated:not(.is-open) { display: none; }
.js .gated.is-open > .panel { animation: rise .6s var(--ease) both; }
.js .gated.is-open > .panel:nth-child(2) { animation-delay: .08s; }
.js .gated.is-open > .panel:nth-child(3) { animation-delay: .16s; }

/* ---------- competition cards ---------- */
.offer-ribbon {
  display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline;
  margin: 0 0 22px; padding: 12px 16px; border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--accent) 7%, #fff); border-left: 3px solid var(--accent);
  font-size: 14px;
}
.offer-ribbon strong { color: var(--accent-ink); font-weight: 800; font-stretch: 85%; font-size: 16px; }
.comp-field { gap: 0; }
.opt-group { margin: 0; }
.opt-group + .opt-group { margin-top: 28px; }
.grp-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.grp-head h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); }
.grp-head a { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; }
.grp-head a:hover { color: var(--accent-ink); }
.comp .options { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.comp .opt { gap: 12px; padding: 14px 16px; align-items: center; }
.opt-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.comp .opt .opt-name { font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.comp .opt .opt-price { font-size: 17px; }
.opt:has(input:focus-visible) { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.opt:has(input:checked) { background: color-mix(in srgb, var(--accent) 4%, #fff); }
.opt input:checked { animation: pop .3s var(--ease); }
/* Sold out: no tick box, name stays readable, red SOLD OUT tag (#b8141b on #fdecec ≈ 5.6:1) */
.comp .opt.is-sold { grid-template-columns: 20px 1fr auto; cursor: default; background: #fafafa; border-style: dashed; border-color: #e3c4c5; }
.comp .opt.is-sold:hover { border-color: #e3c4c5; transform: none; }
.comp .opt.is-sold .opt-body { grid-column: 2; }
.comp .opt.is-sold .sold-tag { grid-column: 3; }   /* empty tick-box column keeps names lined up with open cards */
.comp .opt.is-sold .opt-name { color: var(--muted); }
.sold-tag {
  justify-self: end; white-space: nowrap; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--red-deep); background: var(--red-wash); border: 1px solid #f3b9bb; border-radius: 999px; padding: 4px 10px;
}
.comp-field.has-error .options .opt { border-color: #f1b8b9; }
.comp-field .error { margin-top: 12px; }

/* coupon */
.coupon-row { display: flex; gap: 10px; }
.coupon-row .input { flex: 1; min-width: 0; }
.coupon-row .btn { flex: none; min-width: 108px; }
.coupon-ok {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--ok-wash); color: var(--ok); border: 1px solid #bfe3cf; font-size: 15px;
  animation: rise .35s var(--ease) both;
}
.coupon-ok svg { flex: none; }
.coupon-ok b { letter-spacing: .04em; }
.link-btn {
  margin-left: auto; padding: 4px 2px; background: none; border: 0; cursor: pointer;
  font-weight: 700; font-size: 14px; color: inherit; text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--ink); }
.mono { text-transform: uppercase; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.mono::placeholder { letter-spacing: .04em; }
.gst-fields { padding: 18px; border-radius: var(--r-md); background: var(--mist); animation: rise .35s var(--ease) both; }

/* ---------- order summary (ticket) ---------- */
.order {
  background: var(--paper); border: 1px solid var(--ink); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow-2);
}
.order-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 18px 22px; background: var(--ink); color: #fff;
}
.order-head h2 { margin: 0; font-family: var(--f-display); font-weight: 600; font-size: 1.5rem; line-height: 1.1; }
.order-count { font-size: 13px; color: rgba(255, 255, 255, .72); white-space: nowrap; }
.order-body { padding: 20px 22px 22px; }
.order-empty { margin: 0; font-size: 14px; color: var(--muted); }
.order-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-height: 300px; overflow: auto; }
.order-lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 14px; font-size: 14px; animation: line-in .3s var(--ease) both; }
.order-lines .l-name { font-weight: 650; line-height: 1.3; }
.order-lines .l-group { font-size: 12px; color: var(--muted); }
.order-lines .l-amt { grid-column: 2; grid-row: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
@keyframes line-in { from { opacity: 0; transform: translateY(-4px); } }
.order .summary { margin-top: 18px; font-size: 14px; }
.order .summary .row span:last-child { font-variant-numeric: tabular-nums; }
.order .summary .row.total { align-items: baseline; font-size: 15px; font-stretch: 100%; font-weight: 700; }
/* money stays in Archivo: Bodoni's hairline comma reads like a decimal point at display size */
.order .amount {
  font-weight: 800; font-stretch: 78%; font-size: 2.05rem; line-height: 1;
  letter-spacing: -.01em; font-variant-numeric: tabular-nums;
}
.amount.tick { animation: tick .45s var(--ease); }
@keyframes tick { from { opacity: .25; transform: translateY(6px); } }
.order-msg { margin: 14px 0 0; font-size: 14px; line-height: 1.45; animation: rise .35s var(--ease) both; }
.order .btn-lg { margin-top: 18px; }
.order .btn { gap: 0; }
.order .btn .spin { margin-right: 10px; }
.btn-amt:not(:empty)::before { content: "·"; margin: 0 9px; opacity: .65; }
.order-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.order-secure { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 6px 0 0; font-size: 12px; color: var(--faint); text-align: center; }

@media (max-width: 980px) {
  .reg-aside.order-aside { display: block; order: 0; position: static; }
  /* phones: an empty ₹0 summary with a "Continue to payment" button under step 1 reads as the
     next action — show the summary once the number is checked (same as the conference form) */
  .js .comp-grid:not(:has(.gated.is-open)) .order-aside { display: none; }
}

/* ---------- mobile pay bar ---------- */
.paybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: none;
  align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); box-shadow: 0 -12px 30px -20px rgba(0, 0, 0, .45);
  transform: translateY(110%); transition: transform .35s var(--ease);
}
.paybar.is-on { transform: none; }
.paybar-sum { display: grid; line-height: 1.15; }
.paybar-sum span { font-size: 12px; color: var(--muted); }
.paybar-sum b { font-weight: 800; font-stretch: 80%; font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.paybar .btn { min-height: 46px; }
@media (max-width: 980px) { .paybar { display: flex; } }
body.has-paybar .toast-stack { bottom: 86px; }
body.has-paybar .site-foot { padding-bottom: 96px; }

/* ---------- closed / empty ---------- */
.comp-closed { max-width: 640px; }
.comp-closed p { margin: 0 0 10px; }

/* ---------- payment summary page ---------- */
.pay-intro { max-width: 760px; margin-bottom: clamp(24px, 4vw, 40px); }
.pay-intro .display { margin-bottom: 12px; }
.pay-intro .lede { margin: 0; }
.pay .result-grid { grid-template-columns: minmax(0, 1fr) 400px; }
.pay-block + .pay-block { margin-top: 30px; }
.pay-h { margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 16px; font-weight: 700; color: var(--ink); }
.pay .kv { margin: 0; }
.pay-items { list-style: none; margin: 0; padding: 0; }
.pay-items li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 18px; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.pay-items li:last-child { border-bottom: 0; }
.pay-items .i-name { font-weight: 700; }
.pay-items .i-meta { font-size: 13px; color: var(--muted); }
.pay-items .i-amt { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-weight: 800; font-stretch: 85%; font-size: 17px; font-variant-numeric: tabular-nums; }
.pay-fine { margin-top: 28px; font-size: 14px; color: var(--muted); }
.pay-fine a { color: var(--text); }
.pay-aside { position: sticky; top: 88px; }
.pay-status:empty { display: none; }
.pay-status { margin-top: 14px; }
.pay-status .alert { font-size: 14px; line-height: 1.45; }
.pay-status .alert a, .pay-status .alert button { color: inherit; font-weight: 700; }
.pay-offline { margin-top: 18px; display: grid; gap: 10px; }
.pay-offline p { margin: 0; }
.pay-contacts { display: grid; gap: 4px; font-size: 14px; }
.pay-contacts a { color: var(--text); font-weight: 600; }
.pay-card-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); text-align: center; }
.pay-card-foot a { color: var(--text); }
@media (max-width: 900px) {
  .pay .result-grid { grid-template-columns: 1fr; }
  .pay-aside { position: static; order: -1; }
}
.pay-missing { max-width: 620px; }

@media (max-width: 520px) {
  .prize { align-items: flex-start; }
  .prize::before { margin-top: 5px; }
  .comp-facts { gap: 12px 24px; }
}
