@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800&family=DM+Sans:wght@400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #014dab;
  --blue-dark: #013a82;
  --blue-light: #e7f6ff;
  --blue-mid: #d0e8f8;
  --text: #0f172a;
  --text2: #364151;
  --text3: #7a8fa6;
  --border: #d1dae5;
  --white: #ffffff;
  --green: #25d366;
  --radius: 14px;
  --shadow-sm: 0 2px 8px rgba(1,77,171,0.08);
  --shadow-md: 0 8px 32px rgba(1,77,171,0.12);
}

body {
  font-family: 'DM Sans', sans-serif;
  background: #f0f6ff;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ─── HERO ─── */
.hero {
  width: 100%;
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 60%, #0a6fd4 100%);
  padding: 48px 24px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-emoji {
  font-size: 4rem;
  display: block;
  margin-bottom: 12px;
  position: relative;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.2));
}

.hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.6rem;
  font-weight: 800;
  color: white;
  position: relative;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.hero h1 span {
  opacity: 0.75;
  font-weight: 400;
  font-size: 1.8rem;
  display: block;
  margin-bottom: 4px;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tagline {
  color: rgba(255,255,255,0.7);
  font-size: 0.95rem;
  margin-top: 8px;
  position: relative;
}

.horario-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
  position: relative;
}

.chip {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(10px);
  color: white;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* ─── CARD ─── */
.card-wrap {
  width: 100%;
  max-width: 640px;
  padding: 0 20px;
  margin-top: -44px;
  position: relative;
  z-index: 2;
  flex: 1;
}

.card {
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  padding: 36px 32px;
  border: 1px solid rgba(1,77,171,0.08);
}

.card h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.card-sub {
  color: var(--text3);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

/* ─── FIELDS ─── */
.field { margin-bottom: 20px; }

.field label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 7px;
}

.field-icon { font-size: 0.9rem; }

.field input, .field select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fafcff;
  color: var(--text);
  font-size: 0.95rem;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}

.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(1,77,171,0.1);
  background: white;
}

.field input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0.5; cursor: pointer; }
.field input[type="time"]::-webkit-calendar-picker-indicator { opacity: 0.5; cursor: pointer; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ─── HORARIO INFO ─── */
.horario-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 20px;
}

.horario-pill.abierto { background: #edfaf3; border: 1px solid #a7f3d0; color: #065f46; }
.horario-pill.cerrado { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* ─── PIZZA GRID ─── */
.pizza-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 4px;
}

.pizza-option {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: #fafcff;
}

.pizza-option:hover {
  border-color: var(--blue);
  background: var(--blue-light);
}

.pizza-option.selected {
  border-color: var(--blue);
  background: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(1,77,171,0.1);
}

.pizza-emoji { font-size: 1.8rem; display: block; margin-bottom: 6px; }
.pizza-name { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.pizza-price { font-size: 0.75rem; color: var(--text3); margin-top: 2px; }

/* ─── SUBMIT ─── */
.btn-submit {
  width: 100%;
  padding: 15px 24px;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(1,77,171,0.3);
  letter-spacing: 0.02em;
}

.btn-submit:hover { background: var(--blue-dark); box-shadow: 0 6px 20px rgba(1,77,171,0.4); }
.btn-submit:active { transform: scale(0.98); }
.btn-submit:disabled { background: #a0b4cc; box-shadow: none; cursor: not-allowed; }

.btn-icon { font-size: 1.1rem; }

/* ─── MENSAJES ─── */
.mensaje {
  padding: 14px 18px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-weight: 500;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mensaje.exito { background: #edfaf3; border: 1px solid #a7f3d0; color: #065f46; }
.mensaje.error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.oculto { display: none !important; }

/* ─── FOOTER ─── */
footer {
  text-align: center;
  color: var(--text3);
  font-size: 0.8rem;
  padding: 24px;
  margin-top: 24px;
  line-height: 1.8;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 520px) {
  .hero h1 { font-size: 2rem; }
  .card { padding: 24px 20px; }
  .two-col { grid-template-columns: 1fr; }
  .pizza-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── CALENDARIO PICKER ─── */
.cal-picker {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  user-select: none;
  box-shadow: var(--shadow-sm);
}

.cal-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.cal-titulo {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  text-transform: capitalize;
}

.cal-arrow {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: #fafcff;
  color: var(--text2);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  line-height: 1;
}

.cal-arrow:hover {
  background: var(--blue-light);
  border-color: var(--blue);
  color: var(--blue);
}

.cal-picker-dias-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 6px;
}

.cal-picker-dias-header span {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 0;
}

.cal-picker-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cal-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
  color: var(--text2);
  position: relative;
}

.cal-cell:hover:not(.vacio):not(.pasado):not(.cerrado) {
  background: var(--blue-light);
  color: var(--blue);
}

.cal-cell.vacio { cursor: default; }

.cal-cell.pasado {
  color: #c8d4e0;
  cursor: not-allowed;
}

.cal-cell.cerrado {
  color: #c8d4e0;
  cursor: not-allowed;
}

.cal-cell.cerrado::after {
  content: '';
  position: absolute;
  width: 60%;
  height: 1.5px;
  background: #dde5ee;
  border-radius: 2px;
}

.cal-cell.hoy {
  color: var(--blue);
  font-weight: 700;
}

.cal-cell.hoy::before {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--blue);
  opacity: 0.5;
}

.cal-cell.seleccionado {
  background: var(--blue) !important;
  color: white !important;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(1,77,171,0.35);
}

.cal-cell.seleccionado::before { display: none; }

/* LABEL FECHA SELECCIONADA */
.fecha-label {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--blue-light);
  border: 1px solid var(--blue-mid);
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: capitalize;
}

/* ─── HORA GRID ─── */
.hora-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.hora-option {
  padding: 10px 6px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  background: #fafcff;
  transition: all 0.12s;
  font-family: 'DM Sans', sans-serif;
}

.hora-option:hover {
  border-color: var(--blue);
  background: var(--blue-light);
  color: var(--blue);
}

.hora-option.selected {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
  box-shadow: 0 4px 12px rgba(1,77,171,0.3);
}

/* Animación de aparición de bloques */
#bloque-hora, #bloque-resto {
  animation: slideDown 0.25s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Separador visual entre pasos */
.field + #bloque-hora,
#bloque-hora + #bloque-resto {
  margin-top: 4px;
}

/* ─── CALENDARIO PICKER COMPACTO ─── */
.cal-picker {
  padding: 12px !important;
}

.cal-picker-header {
  margin-bottom: 10px !important;
}

.cal-titulo {
  font-size: 0.88rem !important;
}

.cal-arrow {
  width: 26px !important;
  height: 26px !important;
  font-size: 1rem !important;
  border-radius: 6px !important;
}

.cal-picker-dias-header span {
  font-size: 0.68rem !important;
  padding: 2px 0 !important;
}

.cal-picker-grid {
  gap: 2px !important;
}

.cal-cell {
  min-height: 0 !important;
  border-radius: 6px !important;
  font-size: 0.8rem !important;
  padding: 6px 2px !important;
  aspect-ratio: 1 !important;
}

.cal-cell.hoy::before {
  width: 3px !important;
  height: 3px !important;
  bottom: 2px !important;
}

/* ─── CALENDARIO MÁS PEQUEÑO ─── */
.cal-picker {
  padding: 10px !important;
  max-width: 280px !important;
}

.cal-picker-header {
  margin-bottom: 8px !important;
}

.cal-titulo {
  font-size: 0.82rem !important;
}

.cal-arrow {
  width: 22px !important;
  height: 22px !important;
  font-size: 0.9rem !important;
}

.cal-picker-dias-header span {
  font-size: 0.62rem !important;
  padding: 1px 0 !important;
}

.cal-picker-grid {
  gap: 1px !important;
}

.cal-cell {
  font-size: 0.75rem !important;
  padding: 4px 1px !important;
}

/* ─── CALENDARIO ANCHO COMPLETO DEL CARD ─── */
.cal-picker {
  max-width: 100% !important;
  padding: 14px !important;
}

.cal-titulo {
  font-size: 0.9rem !important;
}

.cal-arrow {
  width: 28px !important;
  height: 28px !important;
  font-size: 1rem !important;
}

.cal-picker-dias-header span {
  font-size: 0.7rem !important;
  padding: 3px 0 !important;
}

.cal-picker-grid {
  gap: 3px !important;
}

.cal-cell {
  font-size: 0.82rem !important;
  padding: 7px 2px !important;
}

/* ─── REDUCIR ALTURA CELDAS ─── */
.cal-cell {
  padding: 4px 2px !important;
  aspect-ratio: unset !important;
  height: 34px !important;
}

/* ─── ALTURA FINAL CELDAS ─── */
.cal-cell {
  height: 28px !important;
  font-size: 0.78rem !important;
}

/* ─── HORA PLACEHOLDER ─── */
.hora-grid-disabled {
  pointer-events: none;
  opacity: 0.4;
}

.hora-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text3);
  font-size: 0.85rem;
  padding: 12px;
  border: 1.5px dashed var(--border);
  border-radius: 10px;
}
