/* RA&ES — atención médica domiciliaria, Posadas
   Paleta tomada del logo: marino (#013954) y turquesa (#018593).
   Tipografía única: Atkinson Hyperlegible Next, pensada para lectura cómoda,
   porque buena parte de quienes leen son familias y adultos mayores. */

:root {
  --selva: #013954;      /* marino del logo */
  --selva-2: #0A4A69;
  --yerba: #017482;      /* turquesa oscuro, para texto/links (contraste AA) */
  --tierra: #018593;     /* turquesa del logo */
  --tierra-dark: #016C78;
  --agua: #EAF4F5;
  --white: #FFFFFF;
  --ink: #10283A;
  --ink-2: #4A5C68;
  --line: #CFDFE3;
  --wa: #1F8A4C;

  --font: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;
  --step--1: 0.889rem;
  --step-0: 1.125rem;   /* 18px base */
  --step-1: 1.333rem;
  --step-2: 1.777rem;
  --step-3: 2.369rem;
  --step-4: clamp(2.4rem, 5.4vw, 4rem);

  --radius-s: 6px;
  --radius-m: 14px;
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: var(--step-3); font-weight: 800; }
h3 { font-size: var(--step-1); font-weight: 700; }
p { margin: 0 0 1em; max-width: 62ch; }
a { color: var(--yerba); text-underline-offset: 3px; }
a:hover { color: var(--selva); }
img, svg { display: block; }

:focus-visible { outline: 3px solid var(--tierra); outline-offset: 3px; border-radius: 2px; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.narrow > * { max-width: 760px; }
.muted { color: var(--ink-2); font-size: var(--step--1); }

.skip { position: absolute; left: -999px; top: 0; background: var(--selva); color: var(--white); padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--white);
  color: var(--selva);
  border-bottom: 4px solid var(--tierra);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 1rem; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 48px; width: auto; }
.brand-name { font-weight: 800; font-size: 1.5rem; margin: 0; color: var(--selva); }
.nav { display: flex; align-items: center; gap: 1.4rem; }
.nav a:not(.btn) { color: var(--selva); text-decoration: none; font-size: 1rem; font-weight: 500; }
.nav a:not(.btn):hover { color: var(--tierra-dark); text-decoration: underline; }
.nav-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 52px; padding: 0 1.4rem;
  font: inherit; font-weight: 700; font-size: 1.05rem;
  border-radius: var(--radius-s); border: 2px solid transparent;
  text-decoration: none; cursor: pointer;
}
.btn-sm { min-height: 42px; padding: 0 1rem; font-size: .95rem; }
.btn-wa { background: var(--wa); color: var(--white); }
.btn-wa:hover { background: #18743F; color: var(--white); }
.btn-wa::before {
  content: ""; width: 1.1em; height: 1.1em; flex: none;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2zm5.3 14.1c-.2.6-1.3 1.2-1.8 1.2-.5.1-1 .2-3.4-.7-2.8-1.1-4.6-4-4.8-4.2-.1-.2-1.1-1.5-1.1-2.9s.7-2 1-2.3c.2-.3.5-.3.7-.3h.5c.2 0 .4 0 .6.5l.9 2.1c.1.2.1.4 0 .5l-.3.5-.4.4c-.1.1-.3.3-.1.6.2.3.8 1.3 1.7 2.1 1.2 1 2.1 1.4 2.4 1.5.3.1.5.1.7-.1l.9-1.1c.2-.3.4-.2.7-.1l2 .9c.3.2.5.2.6.4 0 .1 0 .7-.3 1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2zm5.3 14.1c-.2.6-1.3 1.2-1.8 1.2-.5.1-1 .2-3.4-.7-2.8-1.1-4.6-4-4.8-4.2-.1-.2-1.1-1.5-1.1-2.9s.7-2 1-2.3c.2-.3.5-.3.7-.3h.5c.2 0 .4 0 .6.5l.9 2.1c.1.2.1.4 0 .5l-.3.5-.4.4c-.1.1-.3.3-.1.6.2.3.8 1.3 1.7 2.1 1.2 1 2.1 1.4 2.4 1.5.3.1.5.1.7-.1l.9-1.1c.2-.3.4-.2.7-.1l2 .9c.3.2.5.2.6.4 0 .1 0 .7-.3 1.4z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.btn-ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.55); }
.btn-ghost:hover { border-color: var(--white); color: var(--white); background: rgba(255,255,255,.06); }
.btn-primary { background: var(--selva); color: var(--white); }
.btn-primary:hover { background: var(--selva-2); color: var(--white); }
.btn-light { background: var(--white); color: var(--selva); }
.btn-light:hover { background: var(--agua); color: var(--selva); }

/* ---------- Hero ---------- */
.hero {
  background: var(--selva);
  color: var(--white);
  padding: clamp(3rem, 7vw, 6rem) 0 clamp(3.5rem, 8vw, 6.5rem);
  position: relative;
}
/* Corte diagonal turquesa, el mismo recurso de las placas de Instagram */
.hero { overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: var(--tierra);
  clip-path: polygon(68% 100%, 100% 38%, 100% 100%);
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: var(--selva-2);
  clip-path: polygon(62% 100%, 100% 26%, 100% 38%, 68% 100%);
}
.hero-grid { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero .lead { font-size: var(--step-1); line-height: 1.5; color: #D6E6EE; max-width: 36ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.8rem 0 1.4rem; }
.emergency { font-size: var(--step--1); color: #B5CCD8; margin: 0; }
.emergency a { color: var(--white); font-weight: 700; }
.emergency-light { color: var(--ink-2); margin-top: 1.5rem; padding-left: .9rem; border-left: 4px solid var(--tierra); }
.emergency-light a { color: var(--tierra-dark); }

/* Conversación de ejemplo */
.chat {
  margin: 0;
  background: #E9F1F3;
  border-radius: var(--radius-m);
  color: var(--ink);
  overflow: hidden;
  box-shadow: 0 24px 48px -20px rgba(0, 0, 0, .55);
  transform: rotate(1.2deg);
}
.chat-head { display: flex; align-items: center; gap: .7rem; padding: .8rem 1rem; background: var(--selva-2); color: var(--white); }
.chat-head small { display: block; font-size: .8rem; color: #B5CCD8; }
.chat-head strong { display: block; line-height: 1.2; }
.chat-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--white); }
.chat-body { padding: 1.1rem 1rem .6rem; display: flex; flex-direction: column; gap: .6rem; }
.msg { margin: 0; padding: .6rem .85rem; border-radius: 12px; font-size: 1rem; line-height: 1.45; max-width: 88%; }
.msg-in { background: var(--white); align-self: flex-start; border-top-left-radius: 3px; }
.msg-out { background: #D2ECEF; align-self: flex-end; border-top-right-radius: 3px; }
.chat figcaption { font-size: .85rem; color: var(--ink-2); padding: .3rem 1rem 1rem; }

@media (prefers-reduced-motion: no-preference) {
  .msg { opacity: 0; transform: translateY(6px); animation: msg-in .45s ease-out forwards; }
  .msg:nth-child(1) { animation-delay: .35s; }
  .msg:nth-child(2) { animation-delay: 1.3s; }
  .msg:nth-child(3) { animation-delay: 2.1s; }
  @keyframes msg-in { to { opacity: 1; transform: none; } }
}

/* ---------- Secciones ---------- */
.section { padding: clamp(3.5rem, 7vw, 5.5rem) 0; }
.section-tint { background: var(--agua); }
.section-deep { background: var(--selva); color: var(--white); }
.section-deep p, .section-deep li { color: #D6E6EE; }
.section-intro { font-size: var(--step-1); color: var(--ink-2); margin-bottom: 2.2rem; max-width: 46ch; line-height: 1.45; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }

/* Servicios: lista con reglas, no tarjetas */
.services { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(2rem, 5vw, 4.5rem); }
.services li { border-top: 2px solid var(--line); padding: 1.3rem 0 1.1rem; }
.services h3 { margin-bottom: .3rem; color: var(--selva); }
.services p { margin: 0; color: var(--ink-2); }

/* Pasos: secuencia real, numerada */
.steps { list-style: none; counter-reset: paso; margin: 2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.6rem; }
.steps li { counter-increment: paso; position: relative; padding-top: 4.2rem; }
.steps li::before {
  content: counter(paso);
  position: absolute; top: 0; left: 0;
  width: 3rem; height: 3rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--selva); color: var(--white);
  font-weight: 800; font-size: 1.3rem;
}
.steps li:not(:last-child)::after {
  content: ""; position: absolute; top: 1.5rem; left: 3.6rem; right: -1rem;
  border-top: 2px dashed var(--yerba); opacity: .5;
}
.steps p { color: var(--ink-2); font-size: 1.05rem; }

/* Etiquetas de coberturas y localidades */
.tags { list-style: none; padding: 0; margin: 1.2rem 0 1.2rem; display: flex; flex-wrap: wrap; gap: .55rem; }
.tags li { padding: .45rem .9rem; border: 2px solid var(--tierra); border-radius: 999px; font-weight: 700; font-size: 1rem; color: var(--tierra-dark); }

.checks { list-style: none; padding: 0; margin: 1.4rem 0 0; }
.checks li { padding-left: 2rem; position: relative; margin-bottom: .7rem; }
.checks li::before { content: ""; position: absolute; left: 0; top: .45em; width: 1.1rem; height: .6rem; border-left: 3px solid #4FC3CF; border-bottom: 3px solid #4FC3CF; transform: rotate(-45deg); }

/* ---------- Formularios ---------- */
.form { background: var(--agua); padding: clamp(1.4rem, 3vw, 2rem); border-radius: var(--radius-m); }
.form-dark { background: var(--selva-2); }
.form-dark label { color: var(--white); }
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; flex: 1; min-width: 0; }
.field-row { display: flex; gap: 1rem; }
label { font-weight: 700; font-size: 1rem; }
input, select, textarea {
  font: inherit; font-size: 1.05rem; color: var(--ink);
  padding: .7rem .8rem; min-height: 50px;
  border: 2px solid var(--line); border-radius: var(--radius-s); background: var(--white);
  width: 100%;
}
textarea { resize: vertical; min-height: 120px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--yerba); box-shadow: 0 0 0 3px rgba(1,133,147,.25); }
input[type="file"] { min-height: auto; padding: .55rem; background: rgba(255,255,255,.95); }
.form-dark input, .form-dark select { border-color: transparent; }
.consent { display: flex; gap: .7rem; align-items: flex-start; font-weight: 400; font-size: .95rem; margin: .4rem 0 1.3rem; color: var(--ink-2); }
.consent input { width: 22px; height: 22px; min-height: 0; flex: none; margin-top: .15rem; accent-color: var(--selva); }
.hp { position: absolute; left: -9999px; }
.form .btn { width: 100%; }

.contact-list { margin: 1.6rem 0 0; }
.contact-list div { padding: .9rem 0; border-top: 2px solid var(--line); }
.contact-list dt { font-size: var(--step--1); color: var(--ink-2); }
.contact-list dd { margin: 0; font-weight: 700; font-size: var(--step-1); }
.contact-list a { color: var(--selva); }

/* ---------- Preguntas ---------- */
details { border-top: 2px solid var(--line); }
details:last-of-type { border-bottom: 2px solid var(--line); }
summary { cursor: pointer; padding: 1.1rem 2.2rem 1.1rem 0; font-weight: 700; font-size: var(--step-1); list-style: none; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: .3rem; top: .95rem; font-size: 1.6rem; color: var(--tierra); line-height: 1; transition: transform .2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { color: var(--ink-2); padding-bottom: .6rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--selva); color: #B5CCD8; padding: 3rem 0 2.5rem; font-size: var(--step--1); border-top: 5px solid var(--tierra); }
.site-footer .brand-name { color: var(--white); font-weight: 800; font-size: 1.5rem; }
.site-footer p { margin: 0 0 .35rem; }
.site-footer a { color: var(--white); }
.footer-grid { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 2rem; align-items: end; }

/* ---------- Páginas simples ---------- */
.page-simple { padding: clamp(3rem, 8vw, 6rem) 0; min-height: 60vh; }
.page-simple h1 { font-size: var(--step-3); }
.page-simple h2 { font-size: var(--step-2); margin-top: 1.6em; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .steps { grid-template-columns: 1fr 1fr; row-gap: 2.4rem; }
  .steps li:nth-child(2)::after { display: none; }
}
@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem;
    background: transparent; color: var(--selva); font: inherit; font-weight: 700;
    border: 2px solid var(--line); border-radius: var(--radius-s); cursor: pointer;
  }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--white); padding: .5rem 1.25rem 1.25rem; border-bottom: 4px solid var(--tierra);
  }
  .nav.open { display: flex; }
  .nav a:not(.btn) { padding: .85rem 0; border-bottom: 1px solid var(--line); font-size: 1.1rem; }
  .brand img { height: 40px; }
  .hero::before, .hero::after { opacity: .35; }
  .nav .btn { margin-top: 1rem; }
  .hero-grid, .two-col { grid-template-columns: 1fr; }
  .chat { transform: none; max-width: 480px; }
  .services { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; align-items: start; }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; }
  .steps li::after { display: none; }
  .field-row { flex-direction: column; gap: 0; }
  .hero-actions .btn { width: 100%; }
}
