:root {
  --azul-medico: #135D8C;
  --azul-medico-dark: #0C3E5E;
  --turquesa: #1FA8AE;
  --turquesa-light: #6FD6D9;
  --azul-claro: #A9D8E8;
  --accent-gold: #F2B705;
  --verde: #1F9D55;
  --bg: #F5F8FA;
  --white: #FFFFFF;
  --text-dark: #1E2A36;
  --text-gray: #5B6472;
  --border: #E3E9EF;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text-dark);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand-name {
  font-family: 'Manrope', 'Inter', sans-serif;
}

/* ---------- Header ---------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 48px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.nav-deco {
  position: absolute;
  left: 0;
  top: 0;
  width: 220px;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.brand-mark { width: 56px; height: 56px; flex-shrink: 0; object-fit: contain; display: block; }
.brand-mark.small { width: 32px; height: 32px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-size: 19px; font-weight: 500; color: var(--azul-medico); }
.brand-name strong { font-weight: 800; }
.brand-tag { font-size: 11px; color: var(--text-gray); letter-spacing: 0.02em; }

.nav-actions { display: flex; align-items: center; gap: 20px; }

.nav-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-gray);
  text-decoration: none;
  padding: 6px 2px;
  border-bottom: 1.5px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.nav-link:hover { color: var(--azul-medico); border-color: var(--turquesa); }

/* ---------- Buttons ---------- */
.btn {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:focus-visible {
  outline: 3px solid var(--turquesa-light);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--azul-medico);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(18, 58, 92, 0.25);
}
.btn-primary:hover { background: var(--azul-medico-dark); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--azul-medico);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { border-color: var(--azul-medico); background: #F0F5F9; }

.btn.large { padding: 14px 28px; font-size: 15px; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 88px 48px 100px;
}

.eyebrow {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--turquesa);
  background: #E4F8F5;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--azul-medico);
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}

.hero-sub {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-gray);
  max-width: 480px;
  margin: 0 0 32px;
}

.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }

.hero-note { font-size: 13px; color: var(--text-gray); max-width: 420px; margin: 0; }

/* ---------- Hero visual ---------- */
.hero-visual {
  position: relative;
  height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.helix-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 340px;
  height: auto;
  transform: translate(-50%, -50%);
}

.helix-strand {
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: draw 2.4s ease-out forwards;
}
.helix-strand.delay { animation-delay: 0.25s; }

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

.float-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 48px rgba(18, 58, 92, 0.14);
  border: 1px solid var(--border);
}

.card-main {
  position: relative;
  width: 300px;
  padding: 20px 22px 24px;
  animation: floaty 6s ease-in-out infinite;
  z-index: 2;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.card-top { display: flex; gap: 6px; margin-bottom: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.d1 { background: var(--accent-gold); } .d2 { background: var(--turquesa-light); } .d3 { background: var(--azul-claro); }

.card-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-gray);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 14px;
}

.card-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.card-row:first-of-type { border-top: none; }

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--azul-medico);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.avatar-alt { background: var(--turquesa); }

.card-row-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.p-name { font-size: 13.5px; font-weight: 600; color: var(--text-dark); }
.p-time { font-size: 12px; color: var(--text-gray); }

.pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill-green { background: #E5F6EA; color: var(--verde); }
.pill-gold { background: #FDF3D9; color: #B98A03; }

.card-chip {
  position: absolute;
  bottom: 20px;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  animation: floaty 6s ease-in-out infinite;
  animation-delay: 0.6s;
  z-index: 3;
}

.chip-icon { font-size: 20px; }
.chip-num { display: block; font-size: 16px; font-weight: 800; color: var(--azul-medico); font-family: 'Manrope', sans-serif; }
.chip-label { display: block; font-size: 11px; color: var(--text-gray); }

/* ---------- Features ---------- */
.features {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 48px 100px;
}

.features h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--azul-medico);
  text-align: center;
  margin: 0 0 44px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px 22px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(18, 58, 92, 0.1);
}

.feature-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text-dark);
}

.feature-card p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-gray);
  margin: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--azul-medico);
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
}

.site-footer p {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-gray);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding: 56px 28px 60px; }
  .hero-copy { order: 1; }
  .hero-visual { order: 2; height: 380px; }
  .hero h1 { font-size: 34px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .nav { padding: 16px 20px; }
  .brand-tag { display: none; }
  .hero { padding: 40px 20px 48px; }
  .hero h1 { font-size: 28px; }
  .hero-ctas .btn { flex: 1; text-align: center; }
  .feature-grid { grid-template-columns: 1fr; }
  .features { padding: 10px 20px 60px; }
  .site-footer { flex-direction: column; text-align: center; padding: 24px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .helix-strand, .card-main, .card-chip { animation: none; }
  .helix-strand { stroke-dashoffset: 0; }
}

/* ---------- Autenticación y Registro ---------- */
.auth-body {
  position: relative;
  overflow-x: hidden; /* Solo ocultamos el scroll horizontal por la animación */
  overflow-y: auto; /* Permite hacer scroll hacia abajo si la pantalla es pequeña */
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 60px 20px; /* Aumentamos el padding para que no choque con los bordes superior e inferior */
}

.auth-container, 
.payment-container {
  position: relative;
  z-index: 2; 
}

.geo-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none; /* Para que no interfiera al hacer clic en el formulario */
}

.geo-bg svg {
  width: 100%;
  height: 100%;
  opacity: 0.7;
  animation: panBackground 25s linear infinite alternate;
}

/* Animación estilo Index (Las líneas se dibujan solas) */
.draw-line {
  stroke-dasharray: 3000;
  stroke-dashoffset: 3000;
  animation: drawGeometry 2.5s ease-out forwards;
}

/* Animación de los puntos flotantes */
.float-shape {
  animation: floaty 6s ease-in-out infinite;
}

/* Tiempos de retraso para que no aparezca todo al mismo tiempo */
.delay-1 { animation-delay: 0.4s; }
.delay-2 { animation-delay: 0.8s; }
.delay-3 { animation-delay: 1.2s; }

/* Keyframes (Motores de la animación) */
@keyframes drawGeometry {
  to { stroke-dashoffset: 0; }
}

@keyframes panBackground {
  0% { transform: scale(1.05) translate(0, 0); }
  100% { transform: scale(1.05) translate(-30px, -20px); }
}

.auth-container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.payment-container {
  max-width: 800px; /* Más ancho para dos columnas */
}

.auth-brand {
  margin-bottom: 10px;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 48px rgba(18, 58, 92, 0.08);
  border: 1px solid var(--border);
  padding: 40px;
  width: 100%;
}

.flex-row {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.flex-row > div {
  flex: 1;
}

@media (max-width: 768px) {
  .flex-row {
    flex-direction: column;
  }
}

.auth-title {
  font-size: 24px;
  color: var(--azul-medico);
  margin: 0 0 8px;
  text-align: center;
}

.auth-subtitle {
  text-align: left !important;
  color: var(--text-gray);
  font-size: 14px;
  margin-bottom: 20px; /* Antes estaba en 24px */
}

.section-title {
  font-size: 15px;
  color: var(--text-dark);
  margin: 24px 0 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

/* ---------- Formularios ---------- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px; /* Antes estaba en 16px */
  margin-top: 14px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-row {
  display: flex;
  gap: 16px;
}

.input-row .input-group {
  flex: 1;
}

.input-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
}

.input-group input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus {
  outline: none;
  border-color: var(--turquesa);
  box-shadow: 0 0 0 3px rgba(31, 168, 174, 0.15);
}

/* ---------- Tooltip flotante de error sobre un campo ---------- */
.field-anchor {
  position: relative;
}

.field-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #E0242F;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(224, 36, 47, 0.25);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 5;
  white-space: nowrap;
}

.field-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 18px;
  border: 6px solid transparent;
  border-top-color: #E0242F;
}

.field-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

.field-anchor input.input-error {
  border-color: #E0242F !important;
  box-shadow: 0 0 0 3px rgba(224, 36, 47, 0.12) !important;
}

@keyframes shakeField {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

.field-anchor input.input-shake {
  animation: shakeField 0.35s ease;
}

.pass-hint {
  font-size: 11px;
  color: var(--text-gray);
}

.full-width {
  width: 100%;
}

.mt-4 {
  margin-top: 16px;
}

/* ---------- Selección Visual de Pagos ---------- */
.payment-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.pay-card {
  cursor: pointer;
  position: relative;
}

.pay-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.pay-card-content {
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  transition: all 0.2s ease;
  background: var(--bg);
}

.pay-card-content img {
  max-width: 100%;
  max-height: 24px;
  object-fit: contain;
  opacity: 0.7;
}

/* Estado seleccionado */
.pay-card input[type="radio"]:checked + .pay-card-content {
  border-color: var(--turquesa);
  background: #E4F8F5; /* Tono turquesa claro */
  box-shadow: 0 4px 12px rgba(31, 168, 174, 0.15);
}

.pay-card input[type="radio"]:checked + .pay-card-content img {
  opacity: 1;
}

/* ---------- Resumen de Pago ---------- */
.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14.5px;
  color: var(--text-gray);
}

.summary-item.total {
  border-bottom: none;
  font-size: 18px;
  font-weight: 700;
  color: var(--azul-medico);
  margin-top: 8px;
}

.method-display {
  font-size: 14px;
  background: var(--bg);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-dark);
  margin-bottom: 16px;
}

.auth-footer {
  text-align: center;
  font-size: 13.5px;
  margin-top: 24px;
  color: var(--text-gray);
}

.auth-footer a {
  color: var(--turquesa);
  font-weight: 600;
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* ---------- Rediseño de Registro a 2 Columnas ---------- */
.relative-body {
  position: relative;
}

.register-container {
  max-width: 900px; /* Tarjeta más ancha para las dos columnas */
}

/* Botón de regresar */
.back-link {
  position: absolute;
  top: 30px;
  left: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-gray);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  transition: color 0.2s ease, transform 0.2s ease;
}

.back-link:hover {
  color: var(--azul-medico);
  transform: translateX(-3px);
}

.back-link svg {
  width: 18px;
  height: 18px;
}

/* Clases de utilidad para el diseño Flex */
.p-0 {
  padding: 0 !important;
  overflow: hidden; /* Para mantener los bordes redondeados en las esquinas */
}

.align-stretch {
  align-items: stretch;
}

.left-align {
  text-align: left !important;
}

/* Panel Izquierdo (Beneficios) */
.benefits-panel {
  flex: 1;
  background: #F0F5F9; 
  padding: 40px 32px; 
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* Ahora todo se alinea hacia arriba */
}

/* Panel Derecho (Formulario) */
.form-panel {
  flex: 1.1; 
  padding: 40px 32px; /* Reducido para acompañar al panel izquierdo */
  background: var(--white);
}

/* Información de precio */
.pricing-info {
  margin: 24px 0; /* Antes estaba en 36px */
}

.pricing-info h3 {
  font-size: 14px;
  color: var(--turquesa);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
}

.pricing-info .price {
  font-size: 42px;
  color: var(--azul-medico);
  font-weight: 800;
  font-family: 'Manrope', sans-serif;
  line-height: 1;
}

.pricing-info .price span {
  font-size: 15px;
  color: var(--text-gray);
  font-weight: 500;
}

.pricing-info p {
  font-size: 14.5px;
  color: var(--text-gray);
  margin-top: 14px;
  line-height: 1.5;
}

/* Lista de beneficios */
.benefits-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.benefits-list li {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-dark);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.4;
}

.benefits-list .check {
  color: var(--verde);
  background: #E5F6EA;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
}

/* Responsive para la vista de registro */
@media (max-width: 860px) {
  .flex-row.align-stretch {
    flex-direction: column;
  }
  .benefits-panel {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 40px 24px;
  }
  .form-panel {
    padding: 40px 24px;
  }
  .back-link {
    top: 20px;
    left: 20px;
    position: relative;
    display: inline-flex;
    margin-bottom: 10px;
  }
}

/* ---------- Ojo de Contraseña ---------- */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  width: 100%;
  padding-right: 45px; /* Deja espacio para que el texto no choque con el ojo */
}

.eye-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-gray); /* Usa el mismo gris de tus subtítulos */
  transition: color 0.2s ease;
}

.eye-btn:hover {
  color: var(--azul-medico); /* Cambia al azul de tu marca al pasar el mouse */
}

.eye-btn svg {
  width: 20px;
  height: 20px;
}

/* ---------- Modales / Popups ---------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(18, 42, 54, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  animation: fadeIn 0.3s forwards;
}

.modal-content {
  background: var(--white);
  padding: 40px 32px;
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px rgba(0,0,0,0.15);
  max-width: 400px;
  width: 90%;
  text-align: center;
  transform: translateY(20px);
  animation: slideUp 0.3s forwards;
}

.modal-icon {
  width: 64px;
  height: 64px;
  background: #E5F6EA;
  color: var(--verde);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.modal-icon svg {
  width: 32px;
  height: 32px;
}

.modal-title {
  font-size: 22px;
  color: var(--azul-medico);
  margin: 0 0 12px;
}

.modal-text {
  font-size: 14.5px;
  color: var(--text-gray);
  margin: 0 0 24px;
  line-height: 1.5;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

@keyframes slideUp {
  to { transform: translateY(0); }
}