/* ═══════════════════════════════════════════════════════════════════════
   BASE · Consultorio Dra. Cecilia López
   Sistema de diseño compartido por index, citas y admin.
   Siempre en modo claro: rosado muy suave sobre blanco.
   Espaciado en múltiplos de 4. Tipografías: Fraunces (títulos), Inter (texto),
   Pinyon Script (solo para la firma "Cecilia López").
   ═══════════════════════════════════════════════════════════════════════ */
:root {
  color-scheme: light;
  /* Rosado suave (el color de la barra) */
  --rosa-50: #FFF9FA;
  --rosa-100: #F7ECF0;
  --rosa-200: #F0DAE2;
  --rosa-300: #E4BDCA;
  /* Rosa profundo: botones, enlaces y números (contraste AA con blanco) */
  --rosa: #A63D5F;
  --rosa-fuerte: #862F4A;
  /* Azul del flyer, solo como acento */
  --azul: #1F6A94;
  --azul-claro: #E6F1F8;
  --tinta: #2A1A22;
  --tinta-2: #5A4650;
  --tinta-3: #6E5A64;
  --linea: #F0DDE4;
  --linea-fuerte: #E2C6D0;
  --blanco: #FFFFFF;
  --ok: #1E7A4C;     --ok-fondo: #E6F4EC;
  --aviso: #8A5A00;  --aviso-fondo: #FFF3D4;
  --error: #B3261E;  --error-fondo: #FCE9E7;

  --e1: 4px; --e2: 8px; --e3: 12px; --e4: 16px; --e5: 24px; --e6: 32px; --e7: 48px; --e8: 64px;
  --r1: 8px; --r2: 12px; --r3: 16px; --r4: 24px;
  --sombra: 0 1px 2px rgba(90, 40, 60, .05), 0 6px 20px rgba(90, 40, 60, .06);
  --sombra-alta: 0 24px 60px rgba(60, 20, 40, .22);
  --t: 160ms cubic-bezier(.2, .7, .3, 1);

  --f-texto: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-titulo: "Fraunces", Georgia, "Times New Roman", serif;
  --f-firma: "Pinyon Script", "Brush Script MT", cursive;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 400 15px/1.6 var(--f-texto); color: var(--tinta); background: var(--rosa-50); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; font-family: var(--f-titulo); font-weight: 500; line-height: 1.2; letter-spacing: -.01em; color: var(--tinta); }
p { margin: 0 0 var(--e3); }
a { color: var(--rosa); }
img, svg { max-width: 100%; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--rosa); outline-offset: 2px; }
[hidden] { display: none !important; }
.oculto-visual { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
svg.i.g { width: 24px; height: 24px; }
svg.i.p { width: 16px; height: 16px; }

/* ── Botones ─────────────────────────────────────────────────────────── */
.btn { display: inline-flex; gap: var(--e2); align-items: center; justify-content: center; min-height: 44px; padding: var(--e2) var(--e5); border: 1px solid transparent; border-radius: 999px; background: var(--rosa); color: #fff; font-weight: 600; text-decoration: none; cursor: pointer; transition: background var(--t), transform var(--t), box-shadow var(--t), opacity var(--t); }
.btn:hover { background: var(--rosa-fuerte); box-shadow: 0 6px 16px rgba(134, 47, 74, .22); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn.suave { background: transparent; color: var(--rosa); border-color: var(--linea-fuerte); }
.btn.suave:hover { background: var(--rosa-100); box-shadow: none; }
.btn.peligro { background: var(--error); }
.btn.peligro:hover { background: #8E1D17; box-shadow: none; }
.btn.chico { min-height: 36px; padding: var(--e1) var(--e4); font-size: 14px; }
.btn.bloque { width: 100%; }
.btn:disabled, .btn[aria-busy="true"] { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn[aria-busy="true"]::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: giro .7s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }
.btn-icono { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--tinta-2); cursor: pointer; transition: background var(--t), color var(--t); }
.btn-icono:hover { background: var(--rosa-100); color: var(--rosa); }

/* ── Campos de formulario ────────────────────────────────────────────── */
.campo { margin-bottom: var(--e4); min-width: 0; }
.campo > label { display: block; margin-bottom: var(--e1); font-size: 13px; font-weight: 600; color: var(--tinta-2); }
.campo .ayuda { margin-top: var(--e1); font-size: 12px; color: var(--tinta-3); }
.campo .req { color: var(--rosa); }
.fila { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--e4); }
.fila.tres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
input[type=text], input[type=number], input[type=email], input[type=password], input[type=tel], input[type=search], textarea {
  width: 100%; min-height: 44px; padding: var(--e2) var(--e3); border: 1px solid var(--linea-fuerte); border-radius: var(--r2); background: var(--blanco); color: var(--tinta); font: inherit; transition: border-color var(--t), box-shadow var(--t);
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:hover, textarea:hover { border-color: var(--rosa-300); }
input:focus, textarea:focus { outline: 0; border-color: var(--rosa); box-shadow: 0 0 0 4px var(--rosa-100); }
input::placeholder, textarea::placeholder { color: #9A8791; }
.err-campo { margin-top: var(--e1); font-size: 12px; color: var(--error); }
.campo.con-error input, .campo.con-error textarea, .campo.con-error .ui-campo { border-color: var(--error); }
.form-error { margin: var(--e3) 0 0; padding: var(--e3); border-radius: var(--r2); background: var(--error-fondo); color: var(--error); font-size: 14px; }
.chk { display: flex; gap: var(--e3); align-items: center; cursor: pointer; font-weight: 400; }
.chk input { width: 18px; height: 18px; accent-color: var(--rosa); }

/* Botón que reemplaza al selector de fecha y a la lista desplegable del navegador */
.ui-campo { display: flex; align-items: center; justify-content: space-between; gap: var(--e2); width: 100%; min-height: 44px; padding: var(--e2) var(--e3); border: 1px solid var(--linea-fuerte); border-radius: var(--r2); background: var(--blanco); color: var(--tinta); text-align: left; cursor: pointer; transition: border-color var(--t), box-shadow var(--t); }
.ui-campo:hover { border-color: var(--rosa-300); }
.ui-campo:focus-visible, .ui-campo[aria-expanded="true"] { outline: 0; border-color: var(--rosa); box-shadow: 0 0 0 4px var(--rosa-100); }
.ui-campo .ph { color: #9A8791; }
.ui-campo svg { color: var(--tinta-3); }
.ui-campo:disabled { opacity: .55; cursor: not-allowed; }
.tel-grupo { display: flex; gap: var(--e2); }
.tel-pais { flex: none; width: auto; min-width: 112px; font-weight: 500; }
.tel-num { flex: 1; min-width: 0; letter-spacing: .02em; }
.nativo-oculto { position: absolute !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ── Tarjetas, etiquetas, tablas ─────────────────────────────────────── */
.tarjeta { background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--r3); padding: var(--e5); box-shadow: var(--sombra); min-width: 0; }
.tarjeta h2, .tarjeta h3 { font-size: 18px; }
.tag { display: inline-flex; align-items: center; gap: var(--e1); padding: 2px var(--e3); border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.6; background: var(--rosa-100); color: var(--rosa-fuerte); }
.tag.ok { background: var(--ok-fondo); color: var(--ok); }
.tag.aviso { background: var(--aviso-fondo); color: var(--aviso); }
.tag.error { background: var(--error-fondo); color: var(--error); }
.tag.azul { background: var(--azul-claro); color: var(--azul); }
.tag.gris { background: #F1ECEE; color: var(--tinta-2); }
.tabla-wrap { overflow-x: auto; }
table.tabla { width: 100%; border-collapse: collapse; }
.tabla th { padding: var(--e2) var(--e3); border-bottom: 1px solid var(--linea); text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--tinta-3); }
.tabla td { padding: var(--e3); border-bottom: 1px solid var(--linea); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tr.click { cursor: pointer; transition: background var(--t); }
.tabla tr.click:hover td, .tabla tr.click:focus-visible td { background: var(--rosa-50); }
.sub { font-size: 12px; color: var(--tinta-3); }
.vacio { display: grid; justify-items: center; gap: var(--e2); padding: var(--e6) var(--e4); color: var(--tinta-3); text-align: center; }
.vacio svg { width: 36px; height: 36px; color: var(--rosa-300); }
.vacio b { color: var(--tinta); font-weight: 600; }
.esqueleto { border-radius: var(--r2); background: linear-gradient(90deg, var(--rosa-100) 25%, var(--rosa-50) 50%, var(--rosa-100) 75%); background-size: 200% 100%; animation: brillo 1.2s linear infinite; }
@keyframes brillo { to { background-position: -200% 0; } }

/* ── Ventanas propias (modales) ──────────────────────────────────────── */
.ui-fondo { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: var(--e4); background: rgba(60, 25, 40, .42); backdrop-filter: blur(2px); animation: aparece var(--t); }
.ui-modal { display: flex; flex-direction: column; width: min(560px, 100%); max-height: min(92vh, 860px); border-radius: var(--r4); background: var(--blanco); box-shadow: var(--sombra-alta); animation: sube 200ms cubic-bezier(.2, .8, .3, 1); }
.ui-modal.ancho { width: min(760px, 100%); }
.ui-modal.chico { width: min(420px, 100%); }
.ui-modal-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--e3); padding: var(--e5) var(--e5) var(--e3); }
.ui-modal-cab h2 { font-size: 22px; }
.ui-modal-cab p { margin: var(--e1) 0 0; font-size: 14px; color: var(--tinta-3); }
.ui-modal-cuerpo { padding: var(--e2) var(--e5) var(--e3); overflow-y: auto; }
.ui-modal-pie { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--e3); padding: var(--e4) var(--e5) var(--e5); border-top: 1px solid var(--linea); }
.ui-modal.alerta .ui-modal-cab { align-items: center; }
.ui-icono-modal { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--rosa-100); color: var(--rosa); }
.ui-icono-modal.peligro { background: var(--error-fondo); color: var(--error); }
@keyframes aparece { from { opacity: 0; } }
@keyframes sube { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* Aviso breve */
.ui-avisos { position: fixed; z-index: 400; left: 50%; bottom: var(--e5); display: grid; gap: var(--e2); transform: translateX(-50%); width: min(420px, calc(100% - 32px)); pointer-events: none; }
.ui-aviso { display: flex; gap: var(--e3); align-items: center; padding: var(--e3) var(--e4); border-radius: var(--r2); background: var(--tinta); color: #fff; box-shadow: var(--sombra-alta); font-weight: 500; animation: sube 200ms ease; }
.ui-aviso.error { background: var(--error); }
.ui-aviso svg { flex: none; }

/* ── Calendario (selector de fecha, agenda y agenda en línea) ────────── */
.cal { user-select: none; }
.cal-cab { display: flex; align-items: center; justify-content: space-between; gap: var(--e2); margin-bottom: var(--e3); }
.cal-cab strong { font-family: var(--f-titulo); font-size: 18px; font-weight: 500; text-transform: capitalize; }
.cal-titulo { display: inline-flex; align-items: center; gap: var(--e1); padding: var(--e1) var(--e3); border: 0; border-radius: 999px; background: transparent; color: var(--tinta); font-family: var(--f-titulo); font-size: 18px; text-transform: capitalize; cursor: pointer; transition: background var(--t); }
.cal-titulo:hover { background: var(--rosa-100); }
.cal-meses { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--e2); }
.cal-mes { min-height: 48px; border: 1px solid var(--linea); border-radius: var(--r2); background: var(--blanco); color: var(--tinta); font-weight: 500; text-transform: capitalize; cursor: pointer; transition: background var(--t), border-color var(--t); }
.cal-mes:hover { background: var(--rosa-100); border-color: var(--rosa-300); }
.cal-mes.sel { background: var(--rosa); border-color: var(--rosa); color: #fff; }
.cal-sem, .cal-rejilla { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--e1); }
.cal-sem span { padding: var(--e1) 0; text-align: center; font-size: 12px; font-weight: 600; color: var(--tinta-3); text-transform: uppercase; letter-spacing: .04em; }
.cal-dia { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 40px; padding: 0; border: 1px solid transparent; border-radius: var(--r2); background: transparent; color: var(--tinta); font-weight: 500; cursor: pointer; transition: background var(--t), color var(--t), border-color var(--t); }
.cal-dia:hover:not(:disabled) { background: var(--rosa-100); }
.cal-dia.fuera { color: #B8A8B0; }
.cal-dia.hoy { border-color: var(--rosa-300); font-weight: 700; color: var(--rosa); }
.cal-dia.sel, .cal-dia.sel:hover { background: var(--rosa); border-color: var(--rosa); color: #fff; }
.cal-dia:disabled { color: #CDBFC6; cursor: not-allowed; }
.cal-dia .punto { width: 5px; height: 5px; border-radius: 50%; background: var(--rosa); }
.cal-dia.sel .punto { background: #fff; }
.cal-pie { display: flex; justify-content: space-between; margin-top: var(--e3); }
.cal-pie button { border: 0; background: none; color: var(--rosa); font-weight: 600; cursor: pointer; padding: var(--e1) var(--e2); border-radius: var(--r1); }
.cal-pie button:hover { background: var(--rosa-100); }

/* Ventana flotante del selector (junto al campo en computadora, desde abajo en el teléfono) */
.ui-pop-fondo { position: fixed; inset: 0; z-index: 300; }
.ui-pop { position: fixed; z-index: 310; width: 320px; max-height: 70vh; overflow-y: auto; padding: var(--e4); border: 1px solid var(--linea); border-radius: var(--r3); background: var(--blanco); box-shadow: var(--sombra-alta); animation: sube 160ms ease; }
.ui-pop.lista { width: auto; min-width: 200px; padding: var(--e1); }
.ui-opcion { display: flex; align-items: center; justify-content: space-between; gap: var(--e3); width: 100%; padding: var(--e3); border: 0; border-radius: var(--r1); background: transparent; color: var(--tinta); text-align: left; cursor: pointer; }
.ui-opcion:hover, .ui-opcion:focus-visible { background: var(--rosa-100); outline: 0; }
.ui-opcion[aria-selected="true"] { color: var(--rosa); font-weight: 600; }

@media (max-width: 700px) {
  .fila, .fila.tres { grid-template-columns: minmax(0, 1fr); }
  .ui-fondo { align-items: end; padding: 0; }
  .ui-modal, .ui-modal.ancho, .ui-modal.chico { width: 100%; max-height: 92vh; border-radius: var(--r4) var(--r4) 0 0; animation: sube-movil 240ms cubic-bezier(.2, .8, .3, 1); }
  .ui-pop { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: 100%; max-height: 80vh; border-radius: var(--r4) var(--r4) 0 0; padding-bottom: var(--e6); }
  .ui-pop-fondo { background: rgba(60, 25, 40, .35); }
}
@keyframes sube-movil { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media print {
  .ui-avisos, .ui-pop, .ui-pop-fondo { display: none !important; }
}
