/* ============================================================
   Portal Familias — Premium, editorial.
   Serif + terracota/beige, whitespace generoso.
   ============================================================ */

:root {
  --fam-bg: #fbf6f0;
  --fam-cream: #fdf6f0;
  --fam-terracota: #a3621f;
  --fam-terracota-dark: #7d4513;
  --fam-warm: #f5e6d3;
  --fam-text: #2a2522;
}

body {
  background: var(--fam-bg);
  color: var(--fam-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
}

/* --- Header --- */
.fam-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 56px;
  max-width: var(--container-max);
  margin: 0 auto;
}
.fam-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
}
.fam-logo {
  width: 36px; height: 36px;
  background: var(--fam-terracota);
  color: white;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-serif);
  font-size: 20px; font-weight: 700;
}
.fam-nav {
  display: flex; align-items: center; gap: 32px;
  font-size: 14px;
}
.fam-nav a {
  color: var(--neutral-700);
  font-weight: 500;
}
.fam-nav a:hover { color: var(--fam-terracota-dark); }
.fam-user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 6px;
  border-radius: var(--r-full);
  background: var(--neutral-0);
  border: 1px solid var(--neutral-200);
  font-size: 14px; font-weight: 500;
}
.fam-user-chip .avatar {
  width: 28px; height: 28px;
  background: var(--fam-terracota) url('https://i.pravatar.cc/80?img=12') center/cover;
  border-radius: 50%;
}

/* --- Main routes --- */
#fam-main {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 40px 56px 80px;
}
.fam-route { display: none; animation: fadeIn 250ms ease; }
.fam-route.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* --- Hero --- */
.fam-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 64px;
  align-items: center;
  padding: 24px 0 80px;
}
.fam-eyebrow {
  font-size: 12px; text-transform: uppercase; letter-spacing: 2px;
  color: var(--fam-terracota);
  font-weight: 600;
  margin-bottom: 16px;
}
.fam-hero-title {
  font-family: var(--font-serif);
  font-size: clamp(36px, 4.5vw, 56px);
  font-weight: 400;
  letter-spacing: -1px;
  line-height: 1.1;
  color: var(--fam-text);
}
.fam-hero-title em { font-style: italic; color: var(--fam-terracota); }
.fam-hero-sub {
  margin-top: 18px;
  font-size: 17px;
  color: var(--neutral-600);
  max-width: 460px;
}
.fam-hero-actions {
  display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap;
}
.fam-hero-photo {
  border-radius: 24px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.fam-hero-photo img { width: 100%; height: 100%; object-fit: cover; }

/* --- Buttons premium --- */
.btn-fam {
  padding: 14px 28px;
  background: var(--fam-terracota);
  color: white;
  border-radius: var(--r-full);
  font-size: 15px;
  font-weight: 500;
  font-family: var(--font-sans);
  transition: var(--t-base);
  letter-spacing: 0.2px;
  border: 1px solid var(--fam-terracota);
}
.btn-fam:hover { background: var(--fam-terracota-dark); border-color: var(--fam-terracota-dark); }
.btn-fam-ghost {
  background: transparent;
  color: var(--fam-text);
  border-color: var(--neutral-300);
}
.btn-fam-ghost:hover { background: var(--neutral-0); border-color: var(--fam-text); }

/* --- Headings --- */
.fam-h2 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 400;
  letter-spacing: -0.7px;
  line-height: 1.1;
  margin-bottom: 12px;
}
.fam-h2 em { font-style: italic; color: var(--fam-terracota); }
.fam-sub { color: var(--neutral-600); margin-bottom: 32px; font-size: 16px; }
.muted-sm { font-size: 13px; color: var(--neutral-500); }

/* --- Feature cards --- */
.fam-secciones {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--neutral-200);
}
.fam-feature {
  padding: 28px;
  background: var(--neutral-0);
  border-radius: 18px;
  border: 1px solid var(--neutral-200);
}
.fam-feature-icon {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px;
  background: var(--fam-warm);
  color: var(--fam-terracota);
  border-radius: 50%;
  margin-bottom: 16px;
  font-size: 20px;
  font-family: var(--font-serif);
}
.fam-feature h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 6px;
}
.fam-feature p { color: var(--neutral-600); font-size: 14px; }

/* --- Wizard --- */
.wizard-frame {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 0;
}
.wizard-back {
  font-size: 22px;
  color: var(--neutral-600);
  margin-bottom: 24px;
}
.wizard-back:hover { color: var(--fam-terracota-dark); }
.wizard-progress {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 32px;
  font-size: 13px;
  color: var(--neutral-500);
}
.wizard-bar {
  flex: 1;
  height: 4px;
  background: var(--neutral-200);
  border-radius: 2px;
  overflow: hidden;
}
.wizard-fill {
  height: 100%;
  background: var(--fam-terracota);
  width: 20%;
  transition: width 300ms ease;
}
.wizard-step { display: none; }
.wizard-step.active { display: block; animation: fadeIn 250ms ease; }
.wizard-step h2 {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 400;
  letter-spacing: -0.5px;
  margin-bottom: 24px;
}
.wizard-actions {
  display: flex; justify-content: space-between;
  margin-top: 40px;
}
.wizard-actions .btn-fam[disabled] { opacity: 0.3; cursor: not-allowed; }

.zona-grid, .req-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.dias-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.opt-chip {
  padding: 12px 14px;
  text-align: center;
  background: var(--neutral-0);
  border: 1.5px solid var(--neutral-200);
  border-radius: var(--r-md);
  font-size: 14px;
  cursor: pointer;
  transition: var(--t-fast);
  font-weight: 500;
}
.opt-chip:hover { border-color: var(--fam-terracota); }
.opt-chip.selected {
  background: var(--fam-warm);
  border-color: var(--fam-terracota);
  color: var(--fam-terracota-dark);
}
.dias-grid .opt-chip { padding: 12px 4px; }

.modo-cards {
  display: grid; gap: 14px;
}
.modo-card {
  display: flex; gap: 14px;
  padding: 20px;
  background: var(--neutral-0);
  border: 1.5px solid var(--neutral-200);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: var(--t-fast);
}
.modo-card:has(input:checked) {
  border-color: var(--fam-terracota);
  background: var(--fam-warm);
}
.modo-card input { margin-top: 4px; accent-color: var(--fam-terracota); }
.modo-card strong { font-family: var(--font-serif); font-size: 18px; display: block; margin-bottom: 4px; }
.modo-card p { font-size: 14px; color: var(--neutral-600); }

/* --- Shortlist --- */
.shortlist-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 24px;
}
.cand-fam-card {
  background: var(--neutral-0);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--neutral-200);
  cursor: pointer;
  transition: var(--t-base);
}
.cand-fam-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.cand-fam-photo {
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  position: relative;
}
.cand-fam-rating {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(255,255,255,0.95);
  padding: 4px 10px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 700;
  color: var(--fam-text);
}
.cand-fam-body { padding: 18px; }
.cand-fam-body h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 4px;
}
.cand-fam-body .cand-fam-bio {
  font-size: 13px; color: var(--neutral-600);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cand-fam-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cand-fam-tag {
  font-size: 11px;
  background: var(--fam-warm);
  color: var(--fam-terracota-dark);
  padding: 3px 10px;
  border-radius: var(--r-full);
}

/* --- Perfil enfermera (premium) --- */
.perfil-hero-fam {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
  align-items: flex-start;
  margin-top: 24px;
}
.perfil-hero-fam .perfil-foto {
  aspect-ratio: 4 / 5;
  background-size: cover;
  background-position: center;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.perfil-hero-fam h2 {
  font-family: var(--font-serif);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 400;
  letter-spacing: -0.7px;
  margin-bottom: 8px;
}
.perfil-hero-fam .perfil-bio {
  font-size: 17px; color: var(--neutral-700);
  margin: 16px 0 24px;
  line-height: 1.6;
}
.perfil-stats {
  display: flex; gap: 32px;
  margin: 24px 0;
  padding: 20px 0;
  border-top: 1px solid var(--neutral-200);
  border-bottom: 1px solid var(--neutral-200);
}
.perfil-stats > div { display: flex; flex-direction: column; }
.perfil-stats strong {
  font-family: var(--font-serif);
  font-size: 28px; font-weight: 500;
}
.perfil-stats span { font-size: 12px; color: var(--neutral-500); }
.perfil-section-fam {
  margin-top: 20px;
}
.perfil-section-fam h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--neutral-500);
  margin-bottom: 8px;
}
.perfil-actions-fam {
  display: flex; gap: 12px; margin-top: 32px;
}

/* --- Pago --- */
.pago-frame {
  max-width: 640px; margin: 0 auto;
}
#pago-resumen {
  background: var(--neutral-0);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid var(--neutral-200);
}
#pago-resumen h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  margin-bottom: 14px;
}
.pago-row {
  display: flex; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--neutral-100);
  font-size: 14px;
}
.pago-row:last-child { border-bottom: 0; padding-top: 14px; font-size: 18px; font-weight: 600; }
.pago-row span { color: var(--neutral-600); }

.mp-card {
  background: var(--neutral-0);
  border-radius: 20px;
  padding: 28px;
  border: 1px solid var(--neutral-200);
  text-align: center;
}
.mp-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.mp-qr {
  width: 200px; height: 200px;
  margin: 18px auto;
  background: white;
  border: 1px solid var(--neutral-200);
  border-radius: 12px;
  display: grid; place-items: center;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" shape-rendering="crispEdges"><rect fill="white" width="100" height="100"/><g fill="black"><rect x="5" y="5" width="20" height="20"/><rect x="10" y="10" width="10" height="10" fill="white"/><rect x="75" y="5" width="20" height="20"/><rect x="80" y="10" width="10" height="10" fill="white"/><rect x="5" y="75" width="20" height="20"/><rect x="10" y="80" width="10" height="10" fill="white"/><rect x="30" y="5" width="5" height="5"/><rect x="40" y="5" width="5" height="5"/><rect x="50" y="10" width="5" height="5"/><rect x="60" y="5" width="5" height="5"/><rect x="30" y="30" width="5" height="5"/><rect x="40" y="35" width="10" height="5"/><rect x="55" y="30" width="5" height="10"/><rect x="65" y="30" width="5" height="5"/><rect x="75" y="35" width="10" height="5"/><rect x="30" y="45" width="10" height="5"/><rect x="45" y="50" width="5" height="5"/><rect x="55" y="45" width="5" height="10"/><rect x="65" y="50" width="10" height="5"/><rect x="80" y="45" width="5" height="5"/><rect x="30" y="60" width="5" height="5"/><rect x="40" y="65" width="5" height="5"/><rect x="50" y="60" width="10" height="5"/><rect x="65" y="65" width="5" height="5"/><rect x="75" y="60" width="5" height="10"/><rect x="85" y="60" width="5" height="5"/><rect x="30" y="80" width="5" height="5"/><rect x="40" y="85" width="5" height="5"/><rect x="50" y="80" width="5" height="5"/><rect x="60" y="85" width="10" height="5"/><rect x="75" y="80" width="5" height="5"/><rect x="85" y="85" width="5" height="5"/></g></svg>');
  background-size: contain;
}
.mp-monto {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 500;
  margin: 14px 0;
  letter-spacing: -0.5px;
}

/* --- Servicio activo --- */
.servicio-card {
  background: var(--neutral-0);
  border-radius: 24px;
  padding: 32px;
  border: 1px solid var(--neutral-200);
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 32px;
  align-items: center;
}
.servicio-card .servicio-avatar {
  width: 160px; height: 200px;
  border-radius: 16px;
  background-size: cover; background-position: center;
}
.servicio-info h3 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  margin-bottom: 4px;
}
.servicio-info .servicio-meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  color: var(--neutral-600);
  margin-top: 12px;
  font-size: 14px;
}
.servicio-actions {
  display: flex; flex-direction: column; gap: 8px;
}

.servicio-cal {
  background: var(--neutral-0);
  border-radius: 24px;
  padding: 28px;
  border: 1px solid var(--neutral-200);
}
.servicio-cal h3 {
  font-family: var(--font-serif);
  font-size: 22px; font-weight: 500;
  margin-bottom: 16px;
}
.servicio-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.servicio-week-day {
  background: var(--fam-cream);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  font-size: 13px;
}
.servicio-week-day.active {
  background: var(--fam-terracota);
  color: white;
}
.servicio-week-day strong { display: block; font-size: 18px; margin: 4px 0; font-family: var(--font-serif); }
.servicio-week-day .servicio-week-status { font-size: 10px; opacity: 0.85; }

/* --- Reemplazo confirmado --- */
.reemplazo-frame {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  padding: 40px 0;
}
.reemplazo-frame .reemplazo-icon {
  width: 80px; height: 80px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: grid; place-items: center;
  margin: 0 auto 24px;
  font-size: 36px;
}
.reemplazo-frame .reemplazo-img {
  width: 180px; height: 180px;
  border-radius: 50%;
  margin: 32px auto 24px;
  background-size: cover; background-position: center;
  box-shadow: var(--shadow-md);
}
.reemplazo-frame h2 {
  font-family: var(--font-serif);
  font-size: 36px; font-weight: 400;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}
.reemplazo-frame em { color: var(--fam-terracota); font-style: italic; }

/* --- Historial --- */
.historial-list {
  display: flex; flex-direction: column; gap: 14px;
}
.historial-item {
  background: var(--neutral-0);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--neutral-200);
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 16px;
  align-items: center;
}
.historial-item img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }

/* --- Footer --- */
.fam-footer {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 32px 56px;
  border-top: 1px solid var(--neutral-200);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px;
  color: var(--neutral-500);
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .fam-header, #fam-main, .fam-footer { padding-left: 24px; padding-right: 24px; }
  .fam-hero, .perfil-hero-fam { grid-template-columns: 1fr; gap: 32px; }
  .fam-secciones, .shortlist-grid { grid-template-columns: 1fr; }
  .servicio-card { grid-template-columns: 1fr; text-align: center; }
  .servicio-card .servicio-avatar { width: 100%; height: 240px; margin: 0 auto; }
  .zona-grid, .req-grid { grid-template-columns: repeat(2, 1fr); }
  .fam-nav a { display: none; }
}
