/* Manrope servida desde este mismo sitio (sin Google Fonts: no se envía la IP del visitante a terceros) */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/manrope-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/manrope-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #04060A;
  --bg-soft: #080B11;
  --bg-card: #0D1118;
  --bg-card-alt: #1A1F29;
  --accent: #0A7CFF;
  --accent-strong: #0068E0; /* fondo con texto blanco: contraste 5,2:1 (WCAG AA) */
  --accent-strong-hover: #0058BD;
  --accent-hover: #3D9BFF;
  --accent-soft: #7FBBFF;
  --ok: #0b7b6a;
  --ok-soft: #156574;
  --text: #F4F6FA;
  --text-soft: #C9D2E0;
  --muted: #8B97AA;
  --border: rgba(255, 255, 255, 0.08);
  --danger: #FF6B6B;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

html { background: var(--bg); }

body {
  background: radial-gradient(1200px 600px at 50% -10%, #0E1830 0%, var(--bg) 55%) fixed;
  color: var(--text);
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Topbar */
.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(4, 6, 10, 0.7);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  font-weight: 800;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.brand span {
  color: var(--accent-soft);
  font-weight: 600;
}

.back-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.15s ease;
}

.back-link:hover { color: var(--accent-soft); }

/* Page */
.page {
  flex: 1;
  padding: 48px 20px 80px;
}

.page-head {
  text-align: center;
  margin-bottom: 32px;
}

.page-head h1 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.page-head p {
  color: var(--text-soft);
  font-size: 16px;
  margin: 0;
  max-width: 480px;
  margin-inline: auto;
}

/* Steps */
.steps {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0;
  margin: 0 0 28px;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-card-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.step.is-active {
  color: var(--text);
  border-color: rgba(10, 124, 255, 0.4);
  background: rgba(10, 124, 255, 0.08);
}

.step.is-active .step-num {
  background: var(--accent-strong);
  color: #fff;
}

.step.is-done .step-num {
  background: var(--ok);
  color: #fff;
}

@media (max-width: 560px) {
  .step-label { display: none; }
  .steps { gap: 6px; }
}

/* Card */
.card {
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 20px 60px -30px rgba(10, 124, 255, 0.25), 0 0 0 1px rgba(255,255,255,0.02) inset;
}

@media (max-width: 560px) {
  .card { padding: 24px 18px; }
}

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

.panel-header h2 {
  margin: 8px 0 0;
  font-size: 20px;
  font-weight: 800;
}

.btn-back {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.btn-back:hover { color: var(--accent-soft); }

/* Form */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 560px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.field input,
.field textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 124, 255, 0.18);
}

.field textarea { resize: vertical; }

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* Buttons */
.btn-primary {
  width: 100%;
  background: var(--accent-strong);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 14px 22px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  margin-top: 4px;
}

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

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-back:focus-visible,
.btn-icon:focus-visible,
.day-cell:focus-visible,
.slot-btn:focus-visible,
.consent input:focus-visible,
.site-footer a:focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
}
.btn-primary:active:not(:disabled) { transform: scale(0.99); }

.btn-primary:disabled {
  background: var(--bg-card-alt);
  color: var(--muted);
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 12px 24px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.btn-secondary:hover { border-color: var(--accent-soft); color: var(--accent-soft); }

.btn-icon {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  color: var(--text);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover { border-color: var(--accent-soft); }
.btn-icon:disabled { opacity: 0.35; cursor: not-allowed; }

.form-error {
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  margin: 12px 0 0;
}

/* Calendar */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 16px;
}

#cal-month-label {
  font-weight: 800;
  font-size: 15px;
  min-width: 160px;
  text-align: center;
  text-transform: capitalize;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

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

.day-cell {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--bg-card-alt);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.day-cell:hover:not(:disabled) {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.day-cell.is-selected {
  background: var(--accent-strong);
  color: #fff;
}

.day-cell.is-empty {
  background: transparent;
  cursor: default;
}

.day-cell:disabled {
  color: var(--muted);
  background: transparent;
  cursor: not-allowed;
  opacity: 0.4;
}

.day-cell .dot {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
}

.legend {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
}

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

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.dot-available { background: var(--accent-soft); }
.dot-full { background: var(--muted); }

/* Slots */
.slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

@media (max-width: 560px) {
  .slots-grid { grid-template-columns: repeat(2, 1fr); }
}

.slot-btn {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.slot-btn:hover:not(:disabled) { border-color: var(--accent); }

.slot-btn.is-selected {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}

.slot-btn:disabled {
  color: var(--muted);
  text-decoration: line-through;
  cursor: not-allowed;
  opacity: 0.45;
}

.slot-btn.is-past { opacity: 0.3; }

/* Confirm */
#panel-confirm {
  text-align: center;
}

.confirm-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

#panel-confirm h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
}

.confirm-sub {
  color: var(--text-soft);
  margin: 0 0 24px;
}

.confirm-summary {
  text-align: left;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 0 0 28px;
}

.confirm-summary div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.confirm-summary div:last-child { border-bottom: none; }

.confirm-summary dt { color: var(--muted); font-weight: 600; }
.confirm-summary dd { margin: 0; font-weight: 700; text-align: right; }

/* Privacidad y consentimiento */
.privacy-info {
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 14px;
}

.privacy-info a,
.consent a { color: var(--accent-soft); }

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text-soft);
  margin: 0 0 18px;
  cursor: pointer;
}

.consent input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--accent-strong);
  cursor: pointer;
}

/* Campo trampa anti-bots: invisible para personas */
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  margin-top: 10px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-links a:hover { color: var(--accent-soft); }

/* Loading spinner in buttons */
.btn-primary.is-loading .btn-text::after {
  content: "…";
}

[hidden] { display: none !important; }
