/* ─── RESET & BASE ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #000;
  min-height: 100vh;
  color: #1a1a2e;
}

/* ─── SPACE CANVAS ─────────────────────────────── */
#space-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ─── PAGE WRAP ─────────────────────────────────── */
.page-wrap {
  position: relative;
  z-index: 1;
  padding: 2rem 1rem 4rem;
  min-height: 100vh;
}

/* ─── FORM CONTAINER ────────────────────────────── */
.form-wrap {
  max-width: 760px;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 60px rgba(0,0,0,0.6);
}

/* ─── HEADER ─────────────────────────────────────── */
.form-header {
  background: #1a3c5e;
  padding: 2rem 2.5rem 1.75rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.logo-circle {
  width: 52px; height: 52px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; flex-shrink: 0;
}
.form-header h1 { font-size: 22px; font-weight: 600; color: #fff; line-height: 1.2; }
.form-header p  { font-size: 13px; color: rgba(255,255,255,0.7); margin-top: 3px; }

/* ─── PROGRESS ───────────────────────────────────── */
.progress-bar { background: rgba(255,255,255,0.12); height: 5px; }
.progress-fill { height: 5px; background: #5ec4e8; width: 0%; transition: width 0.4s ease; }

/* ─── FORM BODY ──────────────────────────────────── */
.form-body {
  background: #ffffff;
  border: 1px solid #e0e7ef;
  border-top: none;
  border-radius: 0 0 16px 16px;
  overflow: hidden;
}

/* ─── SECTIONS ───────────────────────────────────── */
.section {
  padding: 1.75rem 2.5rem;
  border-bottom: 1px solid #e8eef5;
}
.section:last-of-type { border-bottom: none; }

.section-title {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 1.25rem;
}
.section-title i {
  font-size: 18px; color: #1a3c5e;
  background: #e8f1f9; width: 34px; height: 34px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.section-title h2 { font-size: 15px; font-weight: 600; color: #1a1a2e; }

/* ─── GRIDS ──────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ─── FIELDS ─────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label,
.field-group-label {
  font-size: 11.5px; font-weight: 600;
  color: #5a6a7e;
  text-transform: uppercase; letter-spacing: 0.05em;
  display: block;
}
.req { color: #c0392b; margin-left: 2px; }

.field input,
.field select,
.field textarea {
  border: 1px solid #d0dae6;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  color: #1a1a2e;
  background: #f7fafd;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: #1a3c5e;
  box-shadow: 0 0 0 3px rgba(26,60,94,0.12);
  background: #fff;
}
.field textarea { resize: vertical; min-height: 72px; }

/* ─── RADIO GROUPS ───────────────────────────────── */
.radio-group { display: flex; gap: 8px; }
.radio-opt {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 12px; border: 1px solid #d0dae6; border-radius: 8px;
  cursor: pointer; font-size: 13px; font-weight: 600;
  color: #5a6a7e; background: #f7fafd;
  transition: all 0.15s; user-select: none;
}
.radio-opt input[type="radio"] { display: none; }
.radio-opt.sel-no  { border-color: #c0392b; background: #fdecea; color: #c0392b; }
.radio-opt.sel-si  { border-color: #1a7a4a; background: #e6f5ed; color: #1a7a4a; }

/* ─── TIPO CENTRO & CLIENTE ──────────────────────── */
.tipo-centro-group,
.radio-tipo-group {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px;
}
.tipo-centro-opt,
.radio-tipo-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border: 1px solid #d0dae6; border-radius: 8px;
  cursor: pointer; font-size: 13px; font-weight: 600;
  color: #5a6a7e; background: #f7fafd;
  transition: all 0.15s; user-select: none;
}
.tipo-centro-opt input,
.radio-tipo-opt input { display: none; }
.tipo-centro-opt i,
.radio-tipo-opt i { font-size: 16px; }
.sel-tc          { border-color: #1a3c5e !important; background: #e8f1f9 !important; color: #1a3c5e !important; }
.sel-colegio     { border-color: #0c447c !important; background: #e8f1f9 !important; color: #0c447c !important; }
.sel-empresa     { border-color: #854f0b !important; background: #faeeda !important; color: #633806 !important; }
.sel-particular  { border-color: #1a7a4a !important; background: #e6f5ed !important; color: #1a7a4a !important; }
.sel-administracion { border-color: #534ab7 !important; background: #eeedfe !important; color: #3c3489 !important; }

/* ─── PAGO ───────────────────────────────────────── */
.pago-group {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px;
}
.pago-opt {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 10px; border: 1px solid #d0dae6; border-radius: 12px;
  cursor: pointer; font-size: 13px; font-weight: 600;
  color: #5a6a7e; background: #f7fafd;
  transition: all 0.15s; user-select: none; text-align: center; line-height: 1.3;
}
.pago-opt input { display: none; }
.pago-opt i { font-size: 28px; margin-bottom: 2px; }
.pago-opt.sel-pago { border-color: #1a3c5e; background: #e8f1f9; color: #1a3c5e; }

/* ─── FOTO ───────────────────────────────────────── */
.foto-group { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.foto-opt {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 16px; border: 1px solid #d0dae6; border-radius: 8px;
  cursor: pointer; font-size: 13px; font-weight: 600;
  color: #5a6a7e; background: #f7fafd;
  transition: all 0.15s; user-select: none;
}
.foto-opt input { display: none; }
.foto-opt.sel-active { border-color: #1a3c5e; background: #e8f1f9; color: #1a3c5e; }

/* ─── CALENDAR ───────────────────────────────────── */
.calendar-wrap { border: 1px solid #d0dae6; border-radius: 10px; overflow: hidden; margin-top: 8px; }
.cal-header {
  background: #1a3c5e; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.cal-header span { font-size: 14px; font-weight: 600; color: #fff; }
.cal-nav {
  background: rgba(255,255,255,0.15); border: none; color: #fff;
  width: 30px; height: 30px; border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; transition: background 0.15s;
}
.cal-nav:hover { background: rgba(255,255,255,0.3); }
.cal-days-header {
  display: grid; grid-template-columns: repeat(7,1fr);
  background: #e8f1f9; border-bottom: 1px solid #d0dae6;
}
.cal-days-header div {
  text-align: center; padding: 7px 0;
  font-size: 11px; font-weight: 700; color: #1a3c5e;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); background: #fff; }
.cal-cell {
  text-align: center; padding: 10px 0; font-size: 13px; color: #5a6a7e;
  border-right: 1px solid #e8eef5; border-bottom: 1px solid #e8eef5;
  cursor: pointer; transition: all 0.12s;
  min-height: 40px; display: flex; align-items: center; justify-content: center;
}
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:hover:not(.empty):not(.past) { background: #e8f1f9; color: #1a3c5e; font-weight: 600; }
.cal-cell.empty  { cursor: default; color: transparent; pointer-events: none; }
.cal-cell.past   { color: #c8d4e0; cursor: default; pointer-events: none; }
.cal-cell.today  { font-weight: 700; color: #1a3c5e; background: #eef4fb; }
.cal-cell.selected { background: #1a3c5e !important; color: #fff !important; font-weight: 700; border-radius: 4px; }

.selected-dates  { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.placeholder-chip { font-size: 12px; color: #9aacbf; align-self: center; }
.date-chip {
  background: #e8f1f9; color: #0c447c; border: 1px solid #b5d4f4;
  border-radius: 20px; padding: 4px 10px; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; gap: 5px;
}
.date-chip button {
  background: none; border: none; color: #0c447c; cursor: pointer;
  padding: 0; font-size: 14px; line-height: 1; display: flex; align-items: center;
}

/* ─── DNI TOGGLE ─────────────────────────────────── */
.dni-toggle {
  display: flex; border: 1px solid #d0dae6; border-radius: 7px;
  overflow: hidden; margin-bottom: 5px; width: fit-content;
}
.dni-toggle button {
  background: #f7fafd; border: none; padding: 5px 14px;
  font-size: 11px; font-weight: 700; color: #5a6a7e;
  cursor: pointer; letter-spacing: 0.04em; transition: all 0.15s;
}
.dni-toggle button.active { background: #1a3c5e; color: #fff; }

/* ─── HEALTH QUESTIONS ───────────────────────────── */
.health-qrow {
  display: grid; grid-template-columns: 2fr 1fr; gap: 14px;
  align-items: end; margin-bottom: 14px;
}
.health-qrow .q-label {
  font-size: 13.5px; color: #1a1a2e; line-height: 1.4;
}

/* ─── INFO / WARNING BOXES ───────────────────────── */
.info-box {
  background: #e8f1f9; border: 1px solid #b5d4f4;
  border-radius: 8px; padding: 12px 14px;
  font-size: 13px; color: #0c447c; line-height: 1.55;
  margin-bottom: 10px;
}
.info-box i { vertical-align: -2px; margin-right: 5px; }

.info-text {
  font-size: 13px; color: #5a6a7e; margin-bottom: 14px; line-height: 1.6;
}

/* ─── SECURITY CODE ──────────────────────────────── */
.security-code { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.captcha-box {
  background: #f0f4f8; border: 1px solid #d0dae6;
  border-radius: 8px; padding: 10px 16px;
  font-family: 'Courier New', monospace; font-size: 20px;
  letter-spacing: 8px; color: #1a1a2e; user-select: none;
  font-weight: 700; min-width: 140px; text-align: center;
}
.captcha-refresh {
  background: none; border: 1px solid #d0dae6; color: #5a6a7e;
  border-radius: 8px; padding: 9px 11px; cursor: pointer;
  font-size: 17px; display: flex; align-items: center;
  transition: background 0.15s;
}
.captcha-refresh:hover { background: #f0f4f8; }

/* ─── CHECKBOXES ─────────────────────────────────── */
.check-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid #e8eef5;
}
.check-row:last-child { border-bottom: none; }
.check-row input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: #1a3c5e;
  flex-shrink: 0; margin-top: 2px; cursor: pointer;
}
.check-row label { font-size: 13px; color: #5a6a7e; line-height: 1.5; cursor: pointer; }
.check-row label a { color: #1a3c5e; text-decoration: underline; }

/* ─── DIVIDER ─────────────────────────────────────── */
.divider { height: 1px; background: #e8eef5; margin: 1rem 0; }

/* ─── SUBMIT ─────────────────────────────────────── */
.submit-section {
  padding: 1.5rem 2.5rem; background: #f7fafd;
  border-top: 1px solid #e8eef5;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.submit-note { font-size: 12px; color: #5a6a7e; display: flex; align-items: center; gap: 5px; }
.submit-note i { font-size: 16px; color: #1a7a4a; }
.submit-btn {
  background: #1a3c5e; color: #fff; border: none;
  padding: 12px 30px; border-radius: 9px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: background 0.15s, transform 0.1s;
}
.submit-btn:hover  { background: #12304f; }
.submit-btn:active { transform: scale(0.98); }

/* ─── SUCCESS MESSAGE ────────────────────────────── */
.success-msg {
  background: #fff;
  border-top: 1px solid #e8eef5;
  padding: 3rem 2.5rem;
  text-align: center;
}
.success-icon { font-size: 52px; margin-bottom: 1rem; }
.success-msg h2 { font-size: 22px; color: #1a3c5e; margin-bottom: 8px; }
.success-msg p  { font-size: 14px; color: #5a6a7e; line-height: 1.6; }

/* ─── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 600px) {
  .form-header, .section, .submit-section { padding-left: 1.25rem; padding-right: 1.25rem; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .tipo-centro-group, .radio-tipo-group { grid-template-columns: 1fr 1fr; }
  .pago-group { grid-template-columns: 1fr; }
  .health-qrow { grid-template-columns: 1fr; }
  .security-code { flex-wrap: wrap; }
}
