/* =========================================================
   CAMPAMENTOS HÍPICA — publica.css
   Página pública: formulario, resumen, confirmación, reserva
   ========================================================= */

/* ── Variables ─────────────────────────────────────────── */
:root {
  --brand:        #1f6b3e;
  --brand-dark:   #164f2e;
  --brand-light:  #e8f5ee;
  --accent:       #2e9c5a;
  --text:         #1a1a1a;
  --text-muted:   #6b7280;
  --border:       #d1d5db;
  --border-focus: #1f6b3e;
  --bg:           #f7f8f9;
  --white:        #ffffff;
  --radius:       10px;
  --radius-sm:    6px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
  --shadow:       0 4px 12px rgba(0,0,0,.10);
  --font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width:    760px;
}

/* ── Reset / Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

/* ── Layout ────────────────────────────────────────────── */
.layout-publica {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.publica-header {
  background: var(--brand);
  color: var(--white);
  padding: 24px 20px;
  text-align: center;
}

.publica-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -.3px;
}

.publica-header p {
  margin-top: 4px;
  opacity: .85;
  font-size: .9rem;
}

.publica-main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 32px auto;
  padding: 0 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* sin-campamento: container directo */
.container {
  max-width: var(--max-width);
  margin: 48px auto;
  padding: 0 16px;
  text-align: center;
}

.container h1 { margin-bottom: 12px; color: var(--brand); }
.container p  { color: var(--text-muted); margin-bottom: 8px; }
.container a  { color: var(--brand); }

/* ── Form sections (cards) ─────────────────────────────── */
.form-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
}

.form-section h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand);
  border-bottom: 2px solid var(--brand-light);
  padding-bottom: 10px;
  margin-bottom: 20px;
  letter-spacing: -.2px;
}

.form-section h3 {
  font-size: .95rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.form-section p {
  color: var(--text-muted);
  margin-bottom: 12px;
  font-size: .9rem;
}

.form-section > p:last-child { margin-bottom: 0; }

/* ── Fields ────────────────────────────────────────────── */
.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .2px;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="date"],
.field textarea,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
textarea {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: .9rem;
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}

.field input:focus,
.field textarea:focus,
input:focus,
textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(31,107,62,.12);
}

.field small {
  font-size: .78rem;
  color: var(--text-muted);
}

.field-readonly {
  padding: 9px 0;
  color: var(--text-muted);
  font-size: .9rem;
}

.label-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: .88rem;
  color: var(--text);
  padding: 8px 0;
}

.label-check input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
}

/* ── Participante block ─────────────────────────────────── */
.participante-bloque {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  background: var(--bg);
}

.participante-bloque:last-child { margin-bottom: 0; }

.participante-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.participante-header h3 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--brand);
  margin: 0;
}

/* ── Semanas ────────────────────────────────────────────── */
.fieldset-semanas,
.fieldset-servicios {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-top: 16px;
  background: var(--white);
}

.fieldset-semanas legend,
.fieldset-servicios legend {
  font-size: .82rem;
  font-weight: 700;
  color: var(--brand);
  padding: 0 6px;
  letter-spacing: .2px;
}

.fieldset-servicios small {
  display: block;
  color: var(--text-muted);
  font-size: .78rem;
  margin-bottom: 12px;
  margin-top: 4px;
}

.semanas-grid,
.servicios-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.semanas-mes-grupo {
  margin-top: 12px;
}

.semanas-mes-grupo:first-child {
  margin-top: 8px;
}

.semanas-mes-titulo {
  font-size: .75rem !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--brand) !important;
  margin-bottom: 6px !important;
  padding-left: 2px;
}

.semana-opcion,
.servicio-opcion {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--white);
}

.semana-opcion:hover,
.servicio-opcion:hover {
  border-color: var(--brand);
  background: var(--brand-light);
}

.semana-opcion input[type="checkbox"],
.servicio-opcion input[type="checkbox"] {
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.semana-nombre {
  flex: 1;
  font-size: .9rem;
  font-weight: 500;
}

.semana-precio {
  font-size: .85rem;
  font-weight: 700;
  color: var(--brand);
  white-space: nowrap;
}

.servicio-opcion span { font-size: .9rem; flex: 1; }
.servicio-opcion small { color: var(--text-muted); font-size: .78rem; }

/* ── Datos médicos (details) ────────────────────────────── */
.datos-medicos {
  margin-top: 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
}

.datos-medicos summary {
  padding: 12px 16px;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 600;
  color: var(--brand);
  -webkit-user-select: none;
  user-select: none;
  list-style: none;
}

.datos-medicos summary::before {
  content: '▶ ';
  font-size: .7rem;
}

.datos-medicos[open] summary::before { content: '▼ '; }

.datos-medicos > *:not(summary) {
  padding: 0 16px;
}

.datos-medicos > .field,
.datos-medicos > .field-row {
  margin-bottom: 12px;
}

.datos-medicos > *:last-child {
  padding-bottom: 16px;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  font-size: .88rem;
  font-weight: 600;
  font-family: var(--font);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brand);
  color: var(--white);
  border-color: var(--brand);
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

.btn-secondary {
  background: var(--white);
  color: var(--brand);
  border-color: var(--brand);
}
.btn-secondary:hover { background: var(--brand-light); }

.btn-danger {
  background: var(--white);
  color: #dc2626;
  border-color: #dc2626;
}
.btn-danger:hover { background: #fef2f2; }

.btn-sm {
  padding: 5px 12px;
  font-size: .8rem;
}

.btn-lg {
  padding: 13px 28px;
  font-size: 1rem;
}

/* ── Alerts ─────────────────────────────────────────────── */
.alert {
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  border-left: 4px solid;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #dc2626;
}

.alert-ok {
  background: #f0fdf4;
  color: #166534;
  border-color: var(--brand);
}

/* ── Form submit section ────────────────────────────────── */
.form-submit {
  text-align: center;
}

.form-submit p {
  margin-bottom: 16px;
  font-size: .9rem;
}

.actions-resumen {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Resumen / tables ───────────────────────────────────── */
.resumen-participante {
  margin-bottom: 24px;
}

.resumen-participante:last-child { margin-bottom: 0; }

.resumen-participante h3 {
  font-size: .92rem;
  font-weight: 700;
  color: var(--brand);
  padding: 8px 0;
  border-bottom: 1.5px solid var(--brand-light);
  margin-bottom: 12px;
}

.table-resumen,
.table-totales {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

.table-resumen th,
.table-resumen td,
.table-totales th,
.table-totales td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table-resumen th,
.table-totales th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: var(--bg);
}

.table-resumen tr:last-child td,
.table-totales tr:last-child td,
.table-totales tr:last-child th { border-bottom: none; }

.fila-destacada th,
.fila-destacada td {
  background: var(--brand-light);
  color: var(--brand-dark);
  font-weight: 700;
}

.resumen-total {
  margin-top: 20px;
  border: 2px solid var(--brand-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

/* ── Payment info ───────────────────────────────────────── */
.info-pago {
  margin-top: 20px;
  background: var(--brand-light);
  border: 1.5px solid #b8ddc9;
  border-radius: var(--radius-sm);
  padding: 18px 20px;
}

.info-pago h3 {
  font-size: .92rem;
  color: var(--brand-dark);
  margin-bottom: 10px;
}

.info-pago p {
  font-size: .88rem;
  color: var(--text);
  margin-bottom: 8px;
}

.iban {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.1rem !important;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--brand-dark) !important;
  background: var(--white);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #b8ddc9;
  display: inline-block;
  margin: 6px 0;
}

/* ── Confirmación page ──────────────────────────────────── */
.confirmacion-ok {
  text-align: center;
}

.confirmacion-icono {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--white);
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 4px 16px rgba(31,107,62,.3);
}

.confirmacion-ok h2 {
  font-size: 1.5rem;
  color: var(--brand);
  margin-bottom: 8px;
  border: none;
  padding: 0;
}

.confirmacion-ok > p {
  font-size: .95rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 24px;
}

.codigo-acceso-bloque {
  background: var(--brand-light);
  border: 2px solid var(--brand);
  border-radius: var(--radius);
  padding: 20px 28px;
  margin: 20px auto;
  max-width: 380px;
  display: inline-block;
  width: 100%;
}

.codigo-label {
  font-size: .8rem !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--brand-dark) !important;
  margin-bottom: 6px !important;
}

.codigo-valor {
  font-family: 'Courier New', Courier, monospace;
  font-size: 2rem !important;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--brand-dark) !important;
  margin-bottom: 10px !important;
}

.codigo-hint {
  font-size: .8rem !important;
  color: var(--text-muted) !important;
}

.confirmacion-pasos {
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  margin: 20px 0;
}

.confirmacion-pasos h3 {
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.confirmacion-pasos ol {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.confirmacion-pasos li {
  font-size: .88rem;
  color: var(--text);
}

.confirmacion-contacto {
  font-size: .88rem;
  color: var(--text-muted);
  margin: 12px 0;
}

.confirmacion-acciones {
  margin-top: 20px;
}

/* ── Reserva estado ─────────────────────────────────────── */
.reserva-estado-tabla {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.reserva-estado-fila {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.reserva-estado-concepto {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  min-width: 160px;
}

.reserva-estado-detalle {
  font-size: .85rem;
  color: var(--text-muted);
  flex: 1;
}

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.estado-verde   { background: #dcfce7; color: #166534; }
.estado-rojo    { background: #fee2e2; color: #991b1b; }
.estado-naranja { background: #fef9c3; color: #854d0e; }
.estado-gris    { background: #f3f4f6; color: #374151; }

/* ── Separador entre participantes ──────────────────────── */
#btn-add-participante {
  margin-top: 8px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .form-section {
    padding: 20px 18px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .publica-header h1 { font-size: 1.3rem; }

  .actions-resumen {
    flex-direction: column;
    align-items: stretch;
  }

  .actions-resumen .btn { width: 100%; }

  .table-resumen,
  .table-totales {
    font-size: .8rem;
  }

  .table-resumen th,
  .table-resumen td,
  .table-totales th,
  .table-totales td {
    padding: 8px 10px;
  }

  .codigo-valor {
    font-size: 1.5rem !important;
    letter-spacing: 2px;
  }

  .participante-bloque {
    padding: 16px;
  }
}

/* ── Print ──────────────────────────────────────────────── */
@media print {
  .publica-header { background: none; color: black; }
  .btn { display: none; }
  .form-section { box-shadow: none; border: 1px solid #ccc; }
  .datos-medicos[open] summary { display: none; }
}
