/* ---------- Tokens ---------- */
:root {
  --mint-light: #5FD6B0;
  --mint-dark: #22B594;
  --ink: #16302B;
  --ink-soft: #4B6B63;
  --paper: #FFFFFF;
  --mint-tint: #EAF9F4;
  --mint-tint-2: #F5FBF9;
  --line: #D8ECE5;

  --font-display: 'Sora', 'Segoe UI', sans-serif;
  --font-body: 'Manrope', 'Segoe UI', sans-serif;

  --container: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0 0 0.5em;
  line-height: 1.15;
  font-weight: 600;
}

p { margin: 0 0 1em; color: var(--ink-soft); }

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--mint-dark);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--mint-dark);
  outline-offset: 3px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.9);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.site-header.is-scrolled {
  border-color: var(--line);
  box-shadow: 0 1px 0 rgba(22,48,43,0.03);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  display: block;
  object-fit: contain;
}
.brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand-x { color: var(--mint-dark); }

.main-nav {
  display: flex;
  gap: 32px;
  font-size: 0.95rem;
  font-weight: 500;
}
.main-nav a {
  color: var(--ink-soft);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.main-nav a:hover { color: var(--mint-dark); border-color: var(--mint-light); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 80px 0 0;
  background:
    radial-gradient(circle at 14% 18%, rgba(255,255,255,0.16), transparent 42%),
    linear-gradient(135deg, #34D6AB 0%, #1FAE8C 48%, #0E7566 100%);
  color: #fff;
}

.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.16) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 80% 70% at 60% 20%, #000 40%, transparent 85%);
  pointer-events: none;
}

.hero-watermark {
  position: absolute;
  top: -14%;
  right: -12%;
  width: 62%;
  max-width: 640px;
  pointer-events: none;
  opacity: 0.14;
  filter: brightness(0) invert(1);
  transform: rotate(6deg);
}
.hero-watermark img { width: 100%; height: auto; display: block; }

.hero-divider {
  display: block;
  width: 100%;
  height: 64px;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
  padding-bottom: 56px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.35);
  padding: 7px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
  backdrop-filter: blur(4px);
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255,255,255,0.5);
  animation: pulseDot 2.2s ease-in-out infinite;
}
@keyframes pulseDot {
  0%   { box-shadow: 0 0 0 0 rgba(255,255,255,0.5); }
  70%  { box-shadow: 0 0 0 7px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

.hero h1 {
  color: #fff;
  font-size: clamp(2.3rem, 4.4vw, 3.4rem);
  max-width: 12ch;
}
.hero-sub {
  color: rgba(255,255,255,0.86);
  font-size: 1.1rem;
  max-width: 42ch;
  margin-bottom: 32px;
}

.store-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.store-row-center { justify-content: center; }

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(4px);
  color: rgba(255,255,255,0.9);
  cursor: default;
  user-select: none;
}
.store-badge svg { color: #fff; flex-shrink: 0; }
.store-text {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  line-height: 1.25;
}
.store-text small {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.75);
}

.hero-note {
  margin-top: 16px;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.75);
}

.hero-visual { width: 100%; position: relative; }
#networkSvg { display: block; }

.net-path {
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: drawLine 1.4s ease forwards;
}
.net-path:nth-child(1) { animation-delay: .05s; }
.net-path:nth-child(2) { animation-delay: .15s; }
.net-path:nth-child(3) { animation-delay: .25s; }
.net-path:nth-child(4) { animation-delay: .35s; }
.net-path:nth-child(5) { animation-delay: .45s; }
.net-path:nth-child(6) { animation-delay: .5s; }
.net-path:nth-child(7) { animation-delay: .55s; }
.net-path:nth-child(8) { animation-delay: .6s; }
@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}

.node {
  opacity: 0;
  animation: nodeIn .5s ease forwards;
  transform-origin: center;
}
.node-main { animation-delay: .05s; }
.net-nodes .node:nth-child(2) { animation-delay: .5s; }
.net-nodes .node:nth-child(3) { animation-delay: .55s; }
.net-nodes .node:nth-child(4) { animation-delay: .6s; }
.net-nodes .node:nth-child(5) { animation-delay: .65s; }
.net-nodes .node:nth-child(6) { animation-delay: .7s; }
@keyframes nodeIn {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: scale(1); }
}

/* ---------- Sections ---------- */
.section { padding: 84px 0; }
.section-tint { background: var(--mint-tint-2); }

.section-head { max-width: 62ch; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.section-head p { font-size: 1.02rem; }

/* Connections */
.connections {
  display: grid;
  gap: 28px;
}
.connection-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 20px;
  align-items: start;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.connection-row:last-child { border-bottom: 1px solid var(--line); }
.connection-mark {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: var(--mint-tint);
  border-radius: 14px;
}
.connection-row h3 { font-size: 1.15rem; margin-bottom: 6px; }
.connection-row p { margin: 0; max-width: 60ch; }

/* Phases */
.phases {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper);
}
.phase {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 22px;
  padding: 30px 28px;
  position: relative;
}
.phase + .phase { border-top: 1px solid var(--line); }
.phase-index {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  background: var(--mint-tint);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.phase-active .phase-index {
  background: linear-gradient(135deg, var(--mint-light), var(--mint-dark));
  color: #fff;
  border-color: transparent;
}
.phase-active { background: var(--mint-tint-2); }

.phase-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--mint-tint);
  border: 1px solid var(--line);
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.phase-tag-active {
  color: #fff;
  background: linear-gradient(135deg, var(--mint-light), var(--mint-dark));
  border-color: transparent;
}
.phase-body h3 { font-size: 1.2rem; margin-bottom: 6px; }
.phase-body p { margin: 0; max-width: 62ch; }

/* Download */
.download-section { text-align: center; }
.download-inner { max-width: 640px; margin: 0 auto; }
.download-inner p { font-size: 1.02rem; margin-bottom: 32px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
}
.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-copy {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 320px; margin: 0 auto; }
  .connection-row { grid-template-columns: 44px 1fr; }
  .connection-mark { width: 44px; height: 44px; }
}

@media (max-width: 680px) {
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 18px;
    display: none;
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav-toggle { display: flex; }
  .phase { grid-template-columns: 44px 1fr; padding: 24px 20px; }
  .phase-index { width: 36px; height: 36px; font-size: 0.9rem; }
  .store-row { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .net-path, .node, .status-dot {
    animation: none !important;
    stroke-dashoffset: 0 !important;
    opacity: 1 !important;
  }
}

/* Estilos para el módulo de invitación (/Invitacion/{code}).
   Pensados para pegarse al final de assets/styles.css (mismo archivo que ya
   usa _Layout.cshtml) — reutilizan las variables --paper, y la paleta menta
   #5FD6B0 / #22B594 ya establecida en el resto del sitio. */

.invite-section {
  padding-top: 64px;
  padding-bottom: 64px;
  min-height: 60vh;
  display: flex;
  align-items: center;
}

.invite-wrap {
  display: flex;
  justify-content: center;
}

.invite-card {
  width: 100%;
  max-width: 480px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(15, 42, 34, 0.08);
  padding: 40px 36px;
}

.invite-card-center {
  text-align: center;
}

.invite-card h1 {
  font-family: "Sora", sans-serif;
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.invite-sub {
  color: #5c6b66;
  margin-bottom: 24px;
  line-height: 1.5;
}

.invite-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.invite-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: "Manrope", sans-serif;
  font-size: 0.9rem;
  color: #2a3934;
}

.invite-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 520px) {
  .invite-field-row {
    grid-template-columns: 1fr;
  }
}

.invite-input {
  border: 1px solid #d9e3df;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 0.95rem;
  font-family: "Manrope", sans-serif;
}

.invite-input:focus {
  outline: none;
  border-color: #5FD6B0;
  box-shadow: 0 0 0 3px rgba(95, 214, 176, 0.25);
}

.invite-input-locked {
  background: #f2f6f4;
  color: #6b7772;
}

.invite-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: #5c6b66;
  line-height: 1.4;
}

.invite-checkbox input {
  margin-top: 3px;
}

.invite-checkbox a {
  color: #22B594;
  font-weight: 600;
}

.invite-submit {
  border: none;
  border-radius: 999px;
  padding: 13px 20px;
  background: linear-gradient(135deg, #5FD6B0, #22B594);
  color: #ffffff;
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.invite-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(34, 181, 148, 0.3);
}

.invite-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.invite-alert {
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.85rem;
  margin-bottom: 20px;
  line-height: 1.4;
}

.invite-alert-error {
  background: #fdecec;
  color: #b3261e;
  border: 1px solid #f6c6c3;
}

.invite-alert-pending {
  background: #fff7e6;
  color: #8a6100;
  border: 1px solid #f5e0a3;
}

.invite-welcome {
  text-align: center;
}

.invite-welcome-check {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5FD6B0, #22B594);
  display: flex;
  align-items: center;
  justify-content: center;
}

.invite-welcome-check-error {
  background: linear-gradient(135deg, #e46a63, #b3261e);
}

/* Layout minimalista para páginas de cuenta (/Invitacion/*): solo logo arriba,
   sin nav ni footer del sitio. Pegar al final de assets/styles.css junto con
   las clases .invite-* que ya agregaste. */

.minimal-page {
  background: #f6f9f8;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.minimal-header {
  padding: 20px 0;
}

.minimal-header-row {
  display: flex;
  justify-content: center;
}

.minimal-main {
  flex: 1;
}

.minimal-footer {
  padding: 24px 0 32px;
  text-align: center;
}

.minimal-footer .footer-copy {
  color: #8a9691;
  font-size: 0.8rem;
  font-family: "Manrope", sans-serif;
}

/* Para el paso de validación de correo (/Invitacion/validar-correo).
   Pegar junto con las .invite-* y .minimal-* que ya agregaste. */

.invite-resend {
  margin-top: 16px;
  text-align: center;
}

.invite-link-button {
  background: none;
  border: none;
  color: #22B594;
  font-family: "Manrope", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px;
}

.invite-link-button:hover {
  color: #1a8e77;
}

/* Bloque de documentos legales en el footer (Doctores / Pacientes).
   Pegar al final de assets/styles.css. */

.footer-legal {
    display: flex;
    gap: 48px;
    flex-wrap: wrap;
    padding-top: 24px;
    margin-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.footer-legal-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
}

    .footer-legal-col h4 {
        font-family: "Sora", sans-serif;
        font-size: 0.8rem;
        font-weight: 600;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        margin: 0 0 4px;
        opacity: 0.8;
    }

    .footer-legal-col a {
        font-family: "Manrope", sans-serif;
        font-size: 0.9rem;
        color: inherit;
        text-decoration: none;
        opacity: 0.9;
    }

        .footer-legal-col a:hover,
        .footer-legal-col a:focus-visible {
            opacity: 1;
            text-decoration: underline;
        }

@media (max-width: 520px) {
    .footer-legal {
        gap: 28px;
    }
}

/* Pegar al final de assets/styles.css */
.main-nav .nav-login {
  display: inline-flex;
  align-items: center;
  padding: .5rem 1.1rem;
  border-radius: 999px;
  border: 1.5px solid #22B594;
  color: #0f2a22;
  font-weight: 600;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.main-nav .nav-login:hover,
.main-nav .nav-login:focus-visible {
  background: #22B594;
  color: #fff;
  transform: translateY(-1px);
}
@media (prefers-reduced-motion: reduce) {
  .main-nav .nav-login { transition: none; }
  .main-nav .nav-login:hover { transform: none; }
}