/* ========== RACEMANAGER — PUBLIC ========== */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #e0e7ff;
  --accent: #f59e0b;
  --dark: #0f1117;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --bg: #f8fafc;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; color: var(--text); background: var(--bg); }

/* NAV */
.rm-nav {
  background: var(--dark);
  padding: .9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.rm-brand { font-size: 1.2rem; font-weight: 800; color: #fff; text-decoration: none; }
.rm-brand span { color: #818cf8; }
.rm-nav-links { display: flex; gap: 1rem; }
.rm-nav-links a { color: #9ca3af; text-decoration: none; font-size: .875rem; }
.rm-nav-links a:hover { color: #fff; }

/* HERO */
.event-hero {
  background: linear-gradient(135deg, var(--dark) 0%, #1e1b4b 100%);
  color: #fff;
  padding: 3rem 1.5rem;
  position: relative;
  overflow: hidden;
}
.event-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(99,102,241,.3) 0%, transparent 70%);
  pointer-events: none;
}
.event-hero .hero-date { color: #818cf8; font-size: .875rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.event-hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; line-height: 1.15; margin: .5rem 0; }
.event-hero .hero-location { color: #9ca3af; margin: .5rem 0 1.5rem; }
.event-hero .hero-badges { display: flex; flex-wrap: wrap; gap: .5rem; }

/* CONTAINER */
.rm-container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

/* SECTION */
.rm-section { padding: 2.5rem 0; }
.rm-section-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 1.25rem; display: flex; align-items: center; gap: .5rem; }
.rm-section-title::after { content: ''; flex: 1; height: 2px; background: var(--border); }

/* CATEGORY CARDS */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.cat-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, transform .15s, box-shadow .15s;
  cursor: pointer;
}
.cat-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(99,102,241,.15); transform: translateY(-2px); }
.cat-card.selected { border-color: var(--primary); background: var(--primary-light); }
.cat-name { font-size: 1.3rem; font-weight: 800; }
.cat-detail { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.cat-price { font-size: 1.5rem; font-weight: 800; color: var(--primary); margin-top: .75rem; }
.cat-places { font-size: .75rem; color: var(--muted); }
.cat-progress { height: 4px; background: #e2e8f0; border-radius: 20px; margin-top: .5rem; }
.cat-progress-bar { height: 100%; border-radius: 20px; }

/* FORM */
.rm-form-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}
.rm-form-section h4 { font-size: 1rem; font-weight: 700; margin-bottom: 1.25rem; padding-bottom: .5rem; border-bottom: 2px solid var(--primary-light); }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-group label { font-size: .875rem; font-weight: 600; color: var(--text); }
.form-group input, .form-group select, .form-group textarea {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: .6rem .85rem;
  font-size: .9rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
  background: #fff;
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.form-group .hint { font-size: .75rem; color: var(--muted); }
.required::after { content: ' *'; color: #ef4444; }

/* PAYMENT */
.payment-methods { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.pay-method {
  flex: 1;
  min-width: 160px;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  transition: border-color .15s;
  text-align: center;
}
.pay-method input { display: none; }
.pay-method:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }
.pay-method .pay-icon { font-size: 2rem; margin-bottom: .5rem; }
.pay-method .pay-label { font-weight: 700; font-size: .9rem; }
.pay-method .pay-desc { font-size: .75rem; color: var(--muted); margin-top: .25rem; }

/* SUMMARY */
.order-summary {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  position: sticky;
  top: 80px;
}
.order-summary .summary-row { display: flex; justify-content: space-between; padding: .4rem 0; font-size: .9rem; }
.order-summary .summary-total { font-size: 1.3rem; font-weight: 800; color: var(--primary); border-top: 2px solid var(--border); padding-top: .75rem; margin-top: .75rem; }

/* BTN */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .8rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-outline {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: transparent;
  border-radius: 8px;
  padding: .7rem 1.25rem;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background .15s;
}
.btn-outline:hover { background: var(--primary-light); }

/* RESULTS */
.results-table { width: 100%; border-collapse: collapse; }
.results-table th { background: var(--dark); color: #fff; padding: .6rem .75rem; font-size: .8rem; text-align: left; font-weight: 600; }
.results-table td { padding: .55rem .75rem; border-bottom: 1px solid var(--border); font-size: .875rem; vertical-align: middle; }
.results-table tr:hover td { background: #f8f7ff; }
.results-table .rank-1 td:first-child { color: #d97706; font-weight: 800; font-size: 1.1rem; }
.results-table .rank-2 td:first-child { color: #64748b; font-weight: 800; }
.results-table .rank-3 td:first-child { color: #92400e; font-weight: 800; }
.time-display { font-family: monospace; font-size: .95rem; font-weight: 600; }

/* CONFIRMATION */
.confirm-card {
  max-width: 580px;
  margin: 4rem auto;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,.08);
}
.confirm-header { background: linear-gradient(135deg,var(--primary),#8b5cf6); padding: 2.5rem; text-align: center; color: #fff; }
.confirm-header .check-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.confirm-body { padding: 2rem; }
.confirm-detail { display: flex; justify-content: space-between; padding: .5rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.confirm-detail:last-child { border-bottom: none; }
.confirm-detail .label { color: var(--muted); }
.confirm-detail .value { font-weight: 600; }

/* FOOTER */
.rm-footer { background: var(--dark); color: #6b7280; text-align: center; padding: 1.5rem; font-size: .8rem; margin-top: 4rem; }
.rm-footer a { color: #818cf8; text-decoration: none; }

/* ALERT */
.alert { padding: .85rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .9rem; }
.alert-danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.alert-warning { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }

@media (max-width: 768px) {
  .event-hero { padding: 2rem 1rem; }
  .rm-form-section { padding: 1.25rem; }
  .order-summary { position: static; margin-top: 1.5rem; }
}
