/* CRL 2027 — custom styles layered on top of the compiled Tailwind build (assets/css/tailwind.css). */
:root {
  --ink-950: #070b14;
  --ink-900: #0b1120;
  --ink-800: #111a2e;
  --line: rgba(255, 255, 255, 0.07);
  --orange: #f7941d;
  --yellow: #fbb616;
  --blue: #29a9e0;
  --accent: var(--orange);
}
html { color-scheme: dark; }
body { background: var(--ink-950); }

.text-gradient {
  background: linear-gradient(90deg, var(--orange), var(--yellow) 45%, var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Logo sits on a white chip so the dark wordmark stays legible on the dark theme. */
.logo-chip {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border-radius: 10px;
  padding: 3px 8px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 6px 20px -8px rgba(247, 148, 29, 0.45);
}

/* Buttons */
.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border-radius: 0.65rem; padding: 0.55rem 0.95rem;
  font-weight: 600; font-size: 0.875rem; line-height: 1.25rem;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.btn-primary { background: linear-gradient(135deg, var(--orange), #f26b1d); color: #fff; box-shadow: 0 8px 24px -10px rgba(247, 148, 29, 0.7); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 28px -10px rgba(247, 148, 29, 0.85); }
.btn-ghost { border: 1px solid rgba(255, 255, 255, 0.14); color: #e2e8f0; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }
.btn-lg { padding: 0.8rem 1.25rem; font-size: 0.95rem; }
.btn-primary:focus-visible, .btn-ghost:focus-visible, .tab:focus-visible, .seg button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Hero background */
.hero-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 30% 20%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 30% 20%, #000 30%, transparent 75%);
}
.hero-glow {
  position: absolute; width: 720px; height: 720px; right: -220px; top: -260px; border-radius: 9999px;
  background: radial-gradient(circle, rgba(247, 148, 29, 0.22), rgba(41, 169, 224, 0.12) 45%, transparent 70%);
  filter: blur(20px);
}

/* Competition tabs: horizontal scroll rail on mobile, 3/6-column grid on larger screens. */
.tab-rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px, 62%);
  gap: 0.75rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 0.5rem;
  scrollbar-width: thin; scrollbar-color: #1a2540 transparent;
}
@media (min-width: 640px) { .tab-rail { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; } }
@media (min-width: 1100px) { .tab-rail { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.tab {
  --a: var(--orange);
  scroll-snap-align: start;
  position: relative; text-align: left;
  border: 1px solid var(--line); background: rgba(17, 26, 46, 0.6);
  border-radius: 1rem; padding: 1rem;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
}
.tab:hover { border-color: rgba(255, 255, 255, 0.16); transform: translateY(-2px); }
.tab[aria-selected="true"] {
  border-color: color-mix(in srgb, var(--a) 60%, transparent);
  background: linear-gradient(160deg, color-mix(in srgb, var(--a) 16%, transparent), rgba(17, 26, 46, 0.7) 60%);
  box-shadow: 0 10px 30px -18px var(--a);
}
.tab .tab-icon {
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 0.7rem;
  color: var(--a); background: color-mix(in srgb, var(--a) 14%, transparent);
}
.tab .tab-num { position: absolute; top: 0.9rem; right: 1rem; font-family: "Space Grotesk", sans-serif; font-size: 0.75rem; color: #475569; }
.tab[aria-selected="true"] .tab-num { color: var(--a); }

/* Rulebook panel */
.panel {
  border: 1px solid var(--line); border-radius: 1.25rem;
  background: linear-gradient(180deg, rgba(17, 26, 46, 0.85), rgba(11, 17, 32, 0.9));
  overflow: hidden; outline: none;
}
.panel-enter { animation: panelIn 0.35s ease both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.panel-head { position: relative; padding: 1.5rem; border-bottom: 1px solid var(--line); }
@media (min-width: 640px) { .panel-head { padding: 2rem; } }
.panel-head::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.accent-text { color: var(--accent); }
.accent-bg { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }

.card { border: 1px solid var(--line); border-radius: 1rem; background: rgba(7, 11, 20, 0.45); padding: 1.25rem; }
.card h3 { font-family: "Space Grotesk", sans-serif; font-weight: 600; color: #fff; font-size: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.card h3::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); }
.card.warn h3::before { background: #f87171; }

.spec-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; border-top: 1px dashed rgba(255, 255, 255, 0.07); font-size: 0.875rem; }
.spec-row:first-child { border-top: 0; }
.spec-row dt { color: #94a3b8; flex-shrink: 0; }
.spec-row dd { color: #f1f5f9; font-weight: 500; text-align: right; }

.rule-list li { position: relative; padding-left: 1.4rem; font-size: 0.9rem; line-height: 1.55; }
.rule-list li + li { margin-top: 0.6rem; }
.rule-list li::before {
  content: ""; position: absolute; left: 0.2rem; top: 0.55em; width: 0.45rem; height: 0.45rem;
  border-radius: 9999px; border: 2px solid var(--accent);
}
.card.warn .rule-list li::before { border-color: #f87171; }

.ordered { counter-reset: step; }
.ordered li { counter-increment: step; position: relative; padding-left: 2.3rem; font-size: 0.9rem; line-height: 1.5; min-height: 1.6rem; }
.ordered li + li { margin-top: 0.65rem; }
.ordered li::before {
  content: counter(step); position: absolute; left: 0; top: -0.05rem;
  width: 1.6rem; height: 1.6rem; border-radius: 0.5rem; display: grid; place-items: center;
  font: 600 0.75rem "Space Grotesk", sans-serif; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.mini-table { width: 100%; font-size: 0.875rem; border-collapse: collapse; }
.mini-table th { text-align: left; font-weight: 500; color: #64748b; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; padding-bottom: 0.5rem; }
.mini-table th:last-child, .mini-table td:last-child { text-align: right; }
.mini-table td { padding: 0.5rem 0; border-top: 1px dashed rgba(255, 255, 255, 0.07); }
.mini-table td:last-child { color: #fff; font-weight: 600; font-family: "Space Grotesk", sans-serif; white-space: nowrap; padding-left: 1rem; }

.seg { display: inline-flex; padding: 0.25rem; border-radius: 0.7rem; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); flex-wrap: wrap; }
.seg button { padding: 0.35rem 0.8rem; font-size: 0.8rem; font-weight: 600; border-radius: 0.5rem; color: #94a3b8; transition: background-color 0.2s, color 0.2s; }
.seg button[aria-pressed="true"] { background: var(--accent); color: #0b1120; }

.cta-card {
  display: flex; flex-direction: column; gap: 1.25rem; padding: 2rem; border-radius: 1.5rem;
  border: 1px solid rgba(247, 148, 29, 0.25);
  background: radial-gradient(ellipse at top right, rgba(247, 148, 29, 0.18), transparent 60%), var(--ink-900);
}
@media (min-width: 768px) { .cta-card { flex-direction: row; align-items: center; justify-content: space-between; padding: 2.5rem; } }

.dl-item { display: flex; align-items: center; gap: 0.9rem; padding: 0.9rem 1rem; border-radius: 0.9rem; border: 1px solid var(--line); background: rgba(17, 26, 46, 0.5); transition: border-color 0.2s, background-color 0.2s; }
.dl-item:hover { border-color: rgba(255, 255, 255, 0.18); background: rgba(17, 26, 46, 0.9); }

/* Eligibility notice (landing + registration pages) */
.notice {
  display: flex; align-items: flex-start; gap: 0.85rem; padding: 1rem 1.15rem; border-radius: 1rem;
  border: 1px solid rgba(251, 182, 22, 0.35); background: rgba(251, 182, 22, 0.08); color: #fde68a; font-size: 0.95rem; line-height: 1.5;
}
.notice-icon { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; flex-shrink: 0; border-radius: 0.65rem; background: rgba(251, 182, 22, 0.15); color: var(--yellow); }
.notice p { padding-top: 0.35rem; }

/* Venue & schedule banner */
.venue-card {
  display: grid; overflow: hidden; border-radius: 1.5rem; border: 1px solid var(--line);
  background: radial-gradient(ellipse at top left, rgba(41, 169, 224, 0.12), transparent 55%), var(--ink-900);
}
@media (min-width: 1024px) { .venue-card { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); } }
.schedule-days { display: grid; gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
@media (min-width: 640px) { .schedule-days { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .schedule-days { border-top: 0; border-left: 1px solid var(--line); } }
.day-col { background: rgba(11, 17, 32, 0.92); padding: 1.5rem; }
@media (min-width: 640px) { .day-col { padding: 2rem; } }
.day-item {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.7rem; border-radius: 0.8rem;
  border: 1px solid transparent; transition: border-color 0.2s, background-color 0.2s;
}
.day-item:hover, .day-item:focus-visible { border-color: rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.04); outline: none; }

.day-badge {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.6rem; border-radius: 9999px;
  font-size: 0.72rem; font-weight: 600; color: var(--orange); background: rgba(247, 148, 29, 0.12); border: 1px solid rgba(247, 148, 29, 0.25);
}
.day-badge.muted { color: #94a3b8; background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.08); font-weight: 500; }

/* Form fields (registration page + admin portal) */
.field label, .field .field-label { display: block; font-size: 0.8rem; font-weight: 500; color: #cbd5e1; margin-bottom: 0.4rem; }
.field input:not([type="radio"]):not([type="checkbox"]), .field select, .field textarea {
  width: 100%; border-radius: 0.7rem; border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(7, 11, 20, 0.7);
  color: #f1f5f9; padding: 0.7rem 0.85rem; font-size: 0.95rem; transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { min-height: 6rem; resize: vertical; }
.field select:disabled { opacity: 0.55; cursor: not-allowed; }
.field input[type="date"] { color-scheme: dark; min-height: 2.9rem; }
.field input[type="file"] { padding: 0.55rem; font-size: 0.85rem; color: #cbd5e1; }
.field input[type="file"]::file-selector-button {
  margin-right: 0.75rem; border: 0; border-radius: 0.5rem; padding: 0.45rem 0.8rem; font-weight: 600; font-size: 0.8rem;
  background: rgba(41, 169, 224, 0.15); color: #7dd3fc; cursor: pointer;
}
.field input::placeholder, .field textarea::placeholder { color: #475569; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(41, 169, 224, 0.2); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #f87171; }
.field .hint { display: flex; align-items: center; gap: 0.4rem; color: #fcd34d; font-size: 0.78rem; margin-top: 0.45rem; }
.field .err, .form-step > .err { color: #fca5a5; font-size: 0.78rem; margin-top: 0.35rem; min-height: 1rem; }
.req { color: var(--orange); }

/* Team registration form */
.form-step { border: 1px solid var(--line); border-radius: 1.25rem; background: rgba(11, 17, 32, 0.85); padding: 1.25rem; min-width: 0; }
@media (min-width: 640px) { .form-step { padding: 1.75rem; } }
.step-head { display: flex; align-items: center; gap: 0.65rem; font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: 1.1rem; color: #fff; padding: 0 0.25rem; margin-bottom: 1rem; }
.step-num { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 0.6rem; font-size: 0.85rem; color: var(--orange); background: rgba(247, 148, 29, 0.14); }
.day-hint { margin-top: 0.75rem; padding: 0.65rem 0.85rem; border-radius: 0.75rem; font-size: 0.85rem; color: #bae6fd; background: rgba(41, 169, 224, 0.08); border: 1px solid rgba(41, 169, 224, 0.25); }
.day-hint strong { color: #fff; }
.student-card { border: 1px solid var(--line); border-radius: 1rem; background: rgba(7, 11, 20, 0.5); padding: 1rem; }
@media (min-width: 640px) { .student-card { padding: 1.25rem; } }
.student-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.9rem; }
.student-num { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 9999px; font: 600 0.75rem "Space Grotesk", sans-serif; color: #0b1120; background: var(--yellow); }
.choice-row { display: flex; gap: 0.5rem; border-radius: 0.7rem; }
.choice-row[aria-invalid="true"] { outline: 1px solid #f87171; outline-offset: 2px; }
.choice { flex: 1; display: flex; align-items: center; gap: 0.5rem; cursor: pointer; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 0.7rem; padding: 0.7rem 0.85rem; background: rgba(7, 11, 20, 0.7); font-size: 0.95rem; color: #e2e8f0; }
.choice:has(input:checked) { border-color: var(--orange); background: rgba(247, 148, 29, 0.1); }
.choice:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.choice input { accent-color: var(--orange); width: 1rem; height: 1rem; }
.combo { position: relative; }
.combo-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% - 1.2rem); max-height: 16rem; overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 0.75rem; background: #0d1528; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.7); padding: 0.3rem;
}
.combo-list li { padding: 0.55rem 0.7rem; border-radius: 0.5rem; font-size: 0.9rem; color: #e2e8f0; cursor: pointer; }
.combo-list li:hover, .combo-list li.active { background: rgba(41, 169, 224, 0.15); }
.combo-list li[aria-selected="true"] { color: var(--orange); }
.combo-list .combo-other { border-top: 1px solid var(--line); margin-top: 0.25rem; color: #fcd34d; }
.combo-list .combo-empty { color: #64748b; cursor: default; font-size: 0.82rem; }
.pay-grid { display: grid; gap: 1.25rem; }
@media (min-width: 640px) { .pay-grid { grid-template-columns: auto 1fr; align-items: start; } }
.pay-qr { margin: 0; text-align: center; }
.pay-qr img { width: 220px; height: 220px; object-fit: contain; border-radius: 0.9rem; background: #fff; padding: 0.5rem; }
.pay-qr figcaption { margin-top: 0.4rem; font-size: 0.75rem; color: #94a3b8; }
.check-row { display: flex; gap: 0.75rem; align-items: flex-start; cursor: pointer; font-size: 0.92rem; color: #e2e8f0; padding: 0.85rem; border-radius: 0.8rem; border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(7, 11, 20, 0.6); }
.check-row[aria-invalid="true"] { border-color: #f87171; }
.check-row input { accent-color: var(--orange); width: 1.15rem; height: 1.15rem; margin-top: 0.1rem; flex-shrink: 0; }

/* Registration confirmation */
.confirm-card { display: grid; gap: 1.5rem; border: 1px solid rgba(247, 148, 29, 0.25); border-radius: 1.5rem; padding: 1.5rem; background: radial-gradient(ellipse at top right, rgba(247, 148, 29, 0.14), transparent 60%), var(--ink-900); }
@media (min-width: 640px) { .confirm-card { padding: 2rem; } }
.confirm-id { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between; }
.qr-box { width: 168px; height: 168px; background: #fff; border-radius: 1rem; padding: 0.35rem; flex-shrink: 0; }
.qr-box svg { width: 100%; height: 100%; display: block; }
.confirm-summary { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: 1px dashed rgba(255, 255, 255, 0.1); padding-top: 1.25rem; }
.confirm-summary dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: #64748b; }
.confirm-summary dd { margin-top: 0.2rem; color: #f1f5f9; font-weight: 500; }
.student-mini { border: 1px solid var(--line); border-radius: 0.85rem; padding: 0.75rem 0.9rem; background: rgba(7, 11, 20, 0.45); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Printing the registration confirmation (register page → Print) */
@media print {
  @page { margin: 14mm; }
  html, body { background: #fff !important; color: #0f172a !important; color-scheme: light; }
  header, footer, .hero-grid, .hero-glow, .no-print, #closed-view, #open-view, #find-view { display: none !important; }
  #done-view { padding: 0 !important; max-width: none !important; }
  #done-view h1, #done-view .text-white, #done-view dd { color: #0f172a !important; }
  #done-view .text-slate-400, #done-view .text-slate-500, #done-view dt { color: #475569 !important; }
  .confirm-card, .student-mini { background: #fff !important; border: 1px solid #cbd5e1 !important; break-inside: avoid; }
  .qr-box { border: 1px solid #cbd5e1; width: 190px; height: 190px; }
}

/* Registration fee summary (payment step) */
.fee-box { padding: 0.8rem 1rem; border-radius: 0.85rem; border: 1px solid rgba(247, 148, 29, 0.35); background: rgba(247, 148, 29, 0.08); color: #fde68a; font-size: 0.92rem; line-height: 1.5; }
.fee-box strong { color: #fff; }
.fee-total { font-family: "Space Grotesk", sans-serif; font-size: 1.35rem; }
.fee-calc { display: block; color: #cbd5e1; font-size: 0.82rem; }
