:root {
  --navy: #2b3a5c;
  --navy-dark: #232f4a;
  --teal: #4fae94;
  --teal-dark: #3d9482;
  --green-accent: #a9d18e;
  --bg: #f4f5f2;
  --border: #d9dce2;
  --text: #26324a;
  --muted: #7a869a;
  --danger: #d94f4f;
  --radius: 10px;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: #fff;
}

h1, h2, h3 { font-family: var(--serif); margin: 0; }

/* HEADER */
.topbar {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 20px 40px;
}
.logo { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 22px; font-weight: bold; color: var(--navy); }
.logo-img { height: 28px; width: auto; display: block; }
.hero-logo { height: 40px; width: auto; display: block; margin-bottom: 16px; }
.logo-icon { color: var(--navy); font-size: 26px; }
.breadcrumb { color: var(--text); font-size: 15px; }
.breadcrumb .muted { color: var(--muted); }
.breadcrumb .sep { margin: 0 8px; color: var(--muted); }

/* WIZARD LAYOUT */
.wizard {
  display: flex;
  align-items: flex-start;
  padding: 0 40px 40px;
  gap: 0;
}

.sidebar {
  background: var(--navy);
  color: #fff;
  width: 280px;
  flex-shrink: 0;
  border-radius: 0 24px 24px 0;
  padding: 28px 32px;
  min-height: 640px;
}
.exit-btn {
  background: none; border: none; color: #fff; font-size: 15px; cursor: pointer; padding: 0; margin-bottom: 24px;
}
.sidebar h2 { font-size: 28px; margin-bottom: 10px; }
.sidebar p { font-size: 14px; line-height: 1.4; color: #c9d2e0; margin: 0 0 28px; }

.stepper { list-style: none; margin: 0; padding: 0; position: relative; }
.stepper li {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; position: relative; color: #8896b3; font-size: 16px;
}
.stepper li:not(:last-child)::after {
  content: ''; position: absolute; left: 15px; top: 42px; bottom: -14px; width: 2px; background: #445070;
}
.stepper .dot {
  width: 32px; height: 32px; border-radius: 50%; border: 2px solid #55628a;
  display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; z-index: 1; background: var(--navy);
}
.stepper li.current { color: #fff; font-weight: 600; }
.stepper li.current .dot { border-color: var(--green-accent); box-shadow: 0 0 0 2px rgba(169,209,142,.35); }
.stepper li.done { color: #fff; }
.stepper li.done .dot { background: var(--green-accent); border-color: var(--green-accent); color: var(--navy-dark); }

/* CONTENT */
.content {
  flex: 1;
  background: var(--bg);
  border-radius: 0 24px 24px 0;
  padding: 36px 44px;
  min-height: 640px;
}

.content-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.content-head h1 { font-size: 30px; }

.plan-pill {
  background: var(--green-accent); color: var(--navy-dark); font-family: var(--sans); font-weight: 600;
  font-size: 14px; padding: 8px 18px; border-radius: 8px; white-space: nowrap;
}

/* PASO 1: imagen de portada al top, a ras del borde del card (sin margen) */
#step-1 {
  margin: -36px -44px 0;         /* anula el padding del .content en top/izq/der */
  padding: 36px 44px 0;          /* mantiene el contenido en su lugar */
  background: url('../../images/PortadaAfiliacion_medismart.png') no-repeat top center;
  background-size: 100% auto;
  background-origin: border-box;  /* pinta desde el borde del card, no desde el padding */
  border-radius: 0 24px 0 0;      /* iguala la esquina redondeada del .content */
}

/* HERO (paso 1) */
.hero {
  position: relative; border-radius: var(--radius); overflow: hidden; min-height: 240px; margin-bottom: 28px;
  background: transparent;
  display: flex; align-items: center; padding: 0;
}
.hero-text {
  max-width: 560px; background: rgba(255, 255, 255, 0.72); backdrop-filter: blur(4px);
  padding: 22px 26px; border-radius: var(--radius);
}
.hero-text h1 { font-size: 34px; color: var(--navy); margin-bottom: 12px; }
.hero-text p { font-size: 15px; color: #3a4460; line-height: 1.5; }

/* PLAN CARDS */
.plan-cards { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.plan-card {
  flex: 1 1 220px; min-width: 220px; border-radius: var(--radius); padding: 22px;
  background: linear-gradient(100deg, rgba(43, 58, 92, 0.9), rgba(79, 174, 148, 0.9)); backdrop-filter: blur(3px);
  color: #fff; cursor: pointer; border: 2px solid transparent; transition: transform .15s ease;
}
.plan-card:hover { transform: translateY(-2px); }
.plan-card.selected { background: linear-gradient(100deg, rgba(43, 58, 92, 0.92), rgba(79, 174, 148, 0.92)); border-color: #d5dae0; }
.plan-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.plan-card-head h3 { font-size: 20px; }
.radio-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; background: transparent; }
.plan-card.selected .radio-dot { background: var(--green-accent); border-color: var(--green-accent); }
.plan-price { display: flex; gap: 16px; align-items: flex-start; }
.plan-price .desde { font-size: 13px; color: #d7ddec; margin-top: 4px; }
.price-row { font-size: 13px; color: #d7ddec; }
.price-row strong { font-size: 18px; color: #fff; display: block; }
.price-row .sub { font-size: 11px; color: #c4cbde; }

/* ACTIONS / BUTTONS */
.actions { display: flex; gap: 14px; margin-top: 28px; }
.btn { font-family: var(--sans); font-size: 15px; font-weight: 600; padding: 12px 28px; border-radius: 8px; border: none; cursor: pointer; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-primary:disabled { background: #bcd8cf; cursor: not-allowed; color: #fff; }
.btn-outline { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-ghost { background: #fff; border: none; font-size: 13px; padding: 10px 16px; border-radius: 6px; cursor: pointer; }
.btn-light { background: #fff; color: var(--teal-dark); border: 1px solid var(--border); padding: 10px 18px; border-radius: 6px; font-weight: 600; cursor: pointer; }
.btn-add { background: var(--green-accent); color: var(--navy-dark); border: none; padding: 10px 20px; border-radius: 6px; font-weight: 600; cursor: pointer; }
.btn-block { width: 100%; margin-top: 18px; }
.link-btn { background: none; border: none; color: var(--navy); font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.link-btn.right { float: right; }

/* FORM GRID (paso 2 / mascota / tarjeta / cuenta) */
.grid-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 28px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-wide { grid-column: 1 / -1; }
.field label { font-size: 14px; font-weight: 600; color: var(--navy); }
.req { color: var(--danger); }
.field input, .field select {
  border: none; border-bottom: 1px solid var(--border); background: transparent; padding: 8px 2px;
  font-size: 15px; color: var(--text); font-family: var(--sans);
}
.field input::placeholder { color: #9aa5b8; }
.field input:focus, .field select:focus { outline: none; border-bottom-color: var(--teal); }
.section-title { grid-column: 1 / -1; font-size: 22px; color: var(--navy); margin-top: 12px; }

.phone-input { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); }
.phone-input .flag { font-size: 18px; }
.phone-input input { border: none; flex: 1; }

.checkbox { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.checkbox a { color: var(--teal-dark); }

.addon-card { display: flex; gap: 20px; background: linear-gradient(120deg, var(--teal-dark), var(--teal)); color: #fff; border-radius: var(--radius); padding: 22px; align-items: center; }
.addon-price { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 90px; font-size: 13px; }
.addon-price strong { font-size: 22px; }
.addon-price .checkbox { margin-top: 8px; font-size: 12px; }
.addon-body h3 { font-family: var(--serif); font-size: 22px; margin-bottom: 8px; }
.addon-body p { font-size: 14px; line-height: 1.4; margin: 0 0 12px; }

/* PLANES FÚNEBRES (paso 2): tarjetas pequeñas en una fila */
.funebre-hint { grid-column: 1 / -1; font-size: 14px; color: var(--muted); margin: -4px 0 4px; }
.funebre-cards { display: flex; gap: 16px; flex-wrap: wrap; }
.funebre-card {
  position: relative; flex: 1 1 200px; min-width: 200px; display: flex; flex-direction: column;
  background: linear-gradient(100deg, var(--navy), var(--teal)); color: #fff;
  border-radius: var(--radius); padding: 20px 20px 16px; cursor: pointer;
  border: 2px solid transparent; transition: transform .15s ease, box-shadow .15s ease;
}
.funebre-card:hover { transform: translateY(-2px); }
.funebre-card input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.funebre-card h3 { font-family: var(--serif); font-size: 18px; margin: 0 0 8px; padding-right: 26px; }
.funebre-precio { font-size: 22px; font-weight: 700; margin-bottom: 10px; }
.funebre-precio small { font-size: 12px; font-weight: 400; opacity: .85; }
.funebre-card p { font-size: 13px; line-height: 1.4; margin: 0 0 16px; flex: 1; }
.funebre-card .funebre-disclaimer { font-size: 11px; opacity: .8; font-style: italic; margin: 0 0 14px; flex: 0; }
.funebre-check {
  position: absolute; top: 16px; right: 16px; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.7); color: transparent; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; transition: all .15s ease;
}
/* CTA resaltado que invita a activar el servicio */
.funebre-toggle {
  display: block; text-align: center; margin-top: auto; padding: 11px 14px; border-radius: 8px;
  background: var(--green-accent); color: var(--navy-dark); font-weight: 700; font-size: 14px;
  box-shadow: 0 3px 10px rgba(0,0,0,.18); transition: all .15s ease;
}
.funebre-card:hover .funebre-toggle { filter: brightness(1.05); }
.funebre-card.selected { border-color: #d5dae0; box-shadow: 0 0 0 3px rgba(213, 218, 224, .45); }
.funebre-card.selected .funebre-check { background: var(--green-accent); border-color: var(--green-accent); color: var(--navy-dark); }
.funebre-card.selected .funebre-toggle { background: #fff; color: var(--teal-dark); }

/* PASO 3: BENEFICIARIOS */
.mini-title { font-size: 15px; font-weight: 700; margin: 20px 0 10px; }
.beneficiarios-list { background: #eceef1; border-radius: 8px; padding: 4px; margin-bottom: 24px; }
.empty-state { padding: 16px; margin: 0; color: var(--muted); font-size: 14px; }
.beneficiario-row { display: flex; align-items: center; gap: 12px; padding: 14px 18px; font-size: 14px; }
.beneficiario-row .icon { font-size: 18px; }
.beneficiario-row .name { flex: 1; }
.beneficiario-row .amount { font-weight: 600; }
.beneficiario-row .row-actions { display: flex; gap: 16px; }
.beneficiario-row button { background: none; border: none; color: var(--navy); font-size: 13px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }

.beneficiary-cards { display: flex; gap: 20px; flex-wrap: wrap; }
.beneficiary-card {
  flex: 1 1 260px; min-width: 260px; border-radius: var(--radius); padding: 22px;
  background: linear-gradient(150deg, #d7f0ea, #cfe6f2); position: relative; min-height: 180px;
  display: flex; flex-direction: column;
}
.beneficiary-card h3 { font-size: 22px; color: var(--navy); margin-bottom: 8px; }
.beneficiary-card p { font-size: 14px; color: #33415e; margin: 0 0 10px; }
.beneficiary-card .fineprint { font-size: 12px; color: #4e5c78; }
.beneficiary-card .btn-add { align-self: flex-start; }
.price-tag { align-self: flex-end; margin-top: 14px; background: var(--navy-dark); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 12px; text-align: right; }
.price-tag strong { font-size: 20px; display: block; }
.price-tag span { display: block; }

/* PASO 4: RESUMEN */
.plan-selector { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 30px; padding: 4px; width: fit-content; margin: 14px 0 18px; }
.plan-pill-option { background: none; border: none; padding: 10px 22px; border-radius: 24px; font-size: 14px; cursor: pointer; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.plan-pill-option .check { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--muted); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; }
.plan-pill-option.active { background: var(--green-accent); color: var(--navy-dark); font-weight: 600; }
.plan-pill-option.active .check { background: var(--green-accent); border-color: var(--navy-dark); color: var(--navy-dark); }

.hint { font-weight: 600; font-size: 14px; margin: 10px 0; }
.corte-selector { display: flex; gap: 12px; margin-bottom: 20px; }
.corte-option { border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 10px 26px; font-size: 13px; cursor: pointer; }
.corte-option strong { display: block; font-size: 20px; }
.corte-option.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.resumen-row { display: flex; align-items: center; gap: 12px; background: #eceef1; border-radius: 8px; padding: 14px 18px; font-size: 14px; margin-bottom: 4px; }
.resumen-row.empty { color: var(--muted); }
.resumen-row .icon { color: var(--green-accent); }
.resumen-row .name { flex: 1; }
.resumen-row .amount { font-weight: 600; margin-right: 12px; }

.resumen-footer { display: flex; gap: 28px; margin-top: 28px; flex-wrap: wrap; }
.cupon-box { flex: 1 1 300px; background: linear-gradient(120deg, var(--teal-dark), var(--teal)); color: #fff; border-radius: var(--radius); padding: 20px; }
.cupon-box p { font-size: 13px; margin: 4px 0 12px; }
.cupon-input { display: flex; gap: 10px; }
.cupon-input input { flex: 1; border: none; border-radius: 6px; padding: 10px 12px; font-size: 13px; }

.totales { flex: 1 1 280px; }
.totales-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.totales-row.total { font-weight: 700; font-size: 16px; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 6px; }
.totales-row.highlight span:last-child { color: #b98a1f; font-weight: 700; }

/* PASO 5: PAGO */
.pago-layout { display: flex; gap: 32px; flex-wrap: wrap; align-items: flex-start; }
.resumen-col { flex: 1 1 380px; min-width: 300px; }
.pago-col { flex: 1 1 380px; min-width: 320px; }
.pago-col .card-wrapper { display: flex; justify-content: center; margin: 40px 0; clear: both; }
.factura-card { flex: 1 1 420px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.factura-card h2 { font-size: 24px; }
.frecuencia { color: var(--teal-dark); font-size: 13px; font-weight: 600; margin: 4px 0 18px; }
.factura-tabla { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.factura-tabla th { text-align: left; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.factura-tabla td { padding: 8px 0; font-size: 14px; border-bottom: 1px solid #f0f1f3; }
.corte-bar { background: var(--navy); color: #fff; border-radius: 8px; padding: 12px 18px; font-size: 13px; margin: 18px 0 0; }

.card-mockup-wrap { flex: 1 1 320px; display: flex; justify-content: center; padding-top: 20px; }
.card-form-wrap { flex: 1 1 360px; min-width: 320px; }
.card-form-wrap .card-wrapper { display: flex; justify-content: center; margin-top: 10px; }
.card-mockup {
  width: 340px; height: 200px; background: linear-gradient(135deg, #d7dde6, #c3cbd9); border-radius: 16px; position: relative;
  padding: 24px; color: var(--navy);
}
.card-mockup .wifi { font-size: 20px; display: block; margin-bottom: 40px; }
.card-mockup .card-number { letter-spacing: 3px; font-size: 18px; color: #8a94a6; }
.add-card-btn {
  position: absolute; right: -18px; bottom: -18px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--navy); color: #fff; border: none; font-size: 22px; cursor: pointer;
}
.card-tooltip {
  position: absolute; right: 30px; bottom: 40px; background: var(--navy-dark); color: #fff; padding: 10px 16px;
  border-radius: 8px; font-size: 13px; white-space: nowrap;
}
.card-tooltip::after { content: ''; position: absolute; right: 18px; bottom: -6px; width: 12px; height: 12px; background: var(--navy-dark); transform: rotate(45deg); }

/* CUENTA / SUCCESS */
.success-box { text-align: center; padding: 60px 20px; }
.success-icon { display: inline-flex; width: 64px; height: 64px; border-radius: 50%; background: var(--green-accent); color: var(--navy-dark); align-items: center; justify-content: center; font-size: 30px; margin-bottom: 20px; }
.success-box p { color: var(--muted); max-width: 420px; margin: 10px auto 0; }

/* FOOTER */
.site-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 20px 0 36px; }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(20, 28, 48, .45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-overlay[hidden] { display: none; }
.modal { background: #fff; border-radius: var(--radius); padding: 40px; width: 460px; max-width: 90vw; position: relative; text-align: center; }
.modal-close { position: absolute; top: 18px; right: 18px; background: none; border: none; font-size: 18px; color: var(--teal-dark); cursor: pointer; }
.modal h2 { font-size: 24px; margin-bottom: 14px; }
.modal p { color: var(--text); font-size: 14px; }
.btn-sms { width: 100%; margin: 18px 0 6px; }
.numero-enviado { color: var(--muted); font-size: 13px; }
.codigo-label { font-size: 13px; font-weight: 600; margin: 22px 0 12px; }
.codigo-inputs { display: flex; justify-content: center; gap: 10px; margin-bottom: 18px; }
.code-box { width: 44px; height: 52px; text-align: center; font-size: 18px; border: 1px solid var(--border); border-radius: 6px; background: #f4f5f2; }
.code-box:focus { outline: none; border-color: var(--teal); background: #fff; }
.reenviar-link { font-size: 13px; color: var(--navy); }
.modal-actions { justify-content: center; }

/* RESPONSIVE */
@media (max-width: 900px) {
  .wizard { flex-direction: column; padding: 0 20px 20px; }
  .sidebar, .content { width: 100%; border-radius: 16px; min-height: auto; }
  .grid-form { grid-template-columns: 1fr; }
  .topbar { padding: 16px 20px; flex-direction: column; align-items: flex-start; gap: 8px; }
}
