/* ====== 1. Reset & Variables ====== */
:root {
  --primary: #1e88e5;       /* Azul Principal */
  --primary-50: #e8f2ff;    /* Fondo items seleccionados */
  --primary-700: #1565c0;
  
  --secondary: #00bfa5;     /* Turquesa (Acciones) */
  --secondary-600: #008f7a;
  --secondary-50: #e0f2f1;

  --surface: #f4f6f8;       /* Fondo Pantalla */
  --card: #ffffff;          /* Fondo Contenedores */
  --border: #e0e6ed;
  
  --text: #1e293b;
  --text-dim: #64748b;

  --danger: #ef4444;
  --success: #10b981;

  --focus-ring: 0 0 0 4px rgba(30, 136, 229, 0.15);
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* IMPORTANTE: Soluciona problemas de visualización */
[hidden] { display: none !important; }

.muted { color: var(--text-dim); }
.muted-label { color: var(--text-dim); font-size: 14px; margin-bottom: 12px; display: block; }
.info-msg { min-height: 20px; font-size: 14px; margin-top: 8px; color: var(--secondary-600); }
.success-msg { text-align: right; margin-top: 10px; font-weight: bold; color: var(--success); }

/* ====== 2. Header ====== */
.site-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.brand { display: flex; gap: 12px; align-items: center; }
.logo {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary); color: white;
}
.brand h1 { font-size: 18px; margin: 0; font-weight: 700; color: #0f172a; }
.brand .muted { margin: 0; font-size: 13px; }

/* ====== 3. Contenedor Principal (Wizard) ====== */
.wizard-card {
  max-width: 800px; margin: 24px auto; background: var(--card);
  border-radius: 20px; padding: 32px;
  box-shadow: var(--shadow-card);
  min-height: 400px;
  /* Animación suave de entrada */
  animation: fadeIn 0.4s ease-out;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

h2 { margin: 0 0 24px; font-size: 22px; color: var(--text); font-weight: 700; }

/* ====== 4. Stepper (Pasos) ====== */
.stepper {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 32px; padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.step-dot {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface); color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; transition: all 0.3s;
}
.step-dot.active { background: var(--primary); color: white; box-shadow: 0 0 0 4px var(--primary-50); }
.step-line {
  flex: 1; height: 3px; background: var(--surface);
  margin: 0 10px; max-width: 60px; border-radius: 2px;
}

/* ====== 5. Inputs & Botones ====== */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.row.end { flex-direction: row; justify-content: flex-end; align-items: center; margin-top: 30px; gap: 12px; }

label { font-size: 14px; font-weight: 600; color: #334155; }
input, select {
  padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px;
  font-size: 16px; color: var(--text); background: #fff; width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus {
  outline: none; border-color: var(--primary); box-shadow: var(--focus-ring);
}

.btn {
  border: none; border-radius: 12px; padding: 12px 24px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; filter: grayscale(1); }
.btn:active { transform: translateY(1px); }

.btn.primary { background: var(--primary); color: white; }
.btn.primary:hover:not(:disabled) { background: var(--primary-700); box-shadow: 0 4px 12px rgba(30,136,229,0.3); }

.btn.ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--surface); color: var(--text); border-color: #cbd5e1; }

.btn.success { background: var(--success); color: white; }
.btn.danger { background: #fee2e2; color: var(--danger); }

.btn.tiny { padding: 8px 14px; font-size: 14px; }

/* ====== 6. Tarjetas de Médico (Doctor Cards) ====== */
.doctor-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 24px;
}
.doctor-card { position: relative; cursor: pointer; display: block; }
.doctor-card input { position: absolute; opacity: 0; width: 0; height: 0; } /* Ocultar radio */

.doctor-card .card-content {
  display: flex; align-items: center; gap: 16px; padding: 16px;
  border: 2px solid var(--border); border-radius: 16px; background: #fff;
  transition: all 0.2s ease;
}
.doctor-card .avatar {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--surface);
}
.doctor-card .info { display: flex; flex-direction: column; }
.doctor-card .name { font-weight: 700; color: var(--text); font-size: 15px; }
.doctor-card .spec { font-size: 13px; color: var(--text-dim); margin-top: 2px; }

/* Estado seleccionado (Checked) */
.doctor-card input:checked + .card-content {
  border-color: var(--primary); background: var(--primary-50);
  box-shadow: 0 0 0 2px var(--primary-50);
}
.doctor-card:hover .card-content { border-color: #cbd5e1; transform: translateY(-2px); }

/* ====== 7. Botones Grandes (Inicio) ====== */
.big-choice {
  display: flex; gap: 16px; align-items: center; padding: 24px; width: 100%;
  border: 1px solid var(--border); border-radius: 16px; background: #fff;
  cursor: pointer; text-align: left; transition: all 0.2s;
}
.big-choice:hover {
  box-shadow: var(--shadow-hover); border-color: var(--primary); transform: translateY(-3px);
}
.big-choice .icon {
  width: 48px; height: 48px; border-radius: 12px; background: var(--primary-50);
  color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.big-choice h3 { margin: 0 0 4px; font-size: 18px; }
.big-choice p { margin: 0; font-size: 14px; color: var(--text-dim); }

/* ====== 8. Calendario ====== */
.calendar { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: #fff; }
.cal-header {
  display: flex; justify-content: space-between; align-items: center; padding: 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
#mesLabel { font-weight: 700; text-transform: capitalize; font-size: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); }
.cell {
  background: #fff; min-height: 80px; padding: 8px; display: flex; flex-direction: column; gap: 4px;
  cursor: default; transition: background 0.1s;
}
.cell .day { font-weight: 700; font-size: 13px; color: var(--text-dim); }
.cell.disabled { background: #f9fafb; color: #cbd5e1; opacity: 0.6; }
.cell.clickable { cursor: pointer; }
.cell.clickable:hover { background: #f0f9ff; }
.cell.selected { background: var(--primary-50); box-shadow: inset 0 0 0 2px var(--primary); }

.pill {
  font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px;
  background: var(--secondary-50); color: var(--secondary-600); width: fit-content;
}
.legend { padding: 12px; font-size: 12px; color: var(--text-dim); display: flex; gap: 16px; align-items: center; background: #fafafa; border-top: 1px solid var(--border); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dot.available { background: var(--secondary); }
.dot.none { background: #cbd5e1; }

/* ====== 9. Horarios (Chips) ====== */
.time-group h4 {
  margin: 20px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-dim);
  border-bottom: 1px solid var(--border); padding-bottom: 4px;
}
.slots-wrap { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.slot-btn {
  padding: 10px 18px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; font-weight: 600; color: var(--text); cursor: pointer;
  transition: all 0.2s;
}
.slot-btn:hover { border-color: var(--secondary); background: var(--secondary-50); color: var(--secondary-600); }

/* ====== 10. Confirmación & Resumen ====== */
.summary {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  background: var(--surface); padding: 20px; border-radius: 16px; margin-bottom: 20px;
}
.sum-row { display: flex; gap: 12px; align-items: flex-start; }
.sum-row .icon { font-size: 20px; }
.sum-row small { color: var(--text-dim); font-size: 11px; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px; }

.notice {
  background: #fffbeb; color: #92400e; padding: 14px; border-radius: 12px;
  text-align: center; font-size: 14px; border: 1px solid #fcd34d; margin-bottom: 20px;
}

/* ====== 11. Responsive ====== */
@media (max-width: 600px) {
  .wizard-card { padding: 20px; border-radius: 0; box-shadow: none; margin: 0; min-height: 100vh; }
  .grid2 { grid-template-columns: 1fr; }
  .actions { display: none; } /* Ocultar botones extra en header movil */
  .cal-grid .cell { min-height: 60px; padding: 4px; }
  .summary { grid-template-columns: 1fr; }
  .doctor-grid { grid-template-columns: 1fr; }
}
/* ====== Footer Logo ====== */
.footer-logo {
  height: 18px;            /* Altura discreta */
  vertical-align: middle;  /* Alineado con el texto */
  margin-left: 6px;        /* Separación del texto "Desarrollado por" */
  opacity: 0.8;            /* Un poco sutil */
  transition: opacity 0.2s;
}

.footer-logo:hover {
  opacity: 1;
}