/* Santyamen, consultorios de salud: los papeles del consultorio.
   Una fórmula en papel de seguridad, una hoja de resultados y un sello. */

@font-face {
  font-family: "Literata";
  src: url("/salud/fonts/literata-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("/salud/fonts/literata-italic-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

:root {
  --papel: #ffffff;
  --seguridad: #e6f0e8;
  --guilloche: #c5dccb;
  --tinta: #1d2f86;
  --texto: #1f2537;
  --texto-suave: #4c5468;
  --sello: #6a3fa3;
  --sello-hondo: #55308a;
  --regla: #dfe4ec;

  --ancho: 74rem;
  --margen: clamp(1rem, 4vw, 2.5rem);
  --seccion: clamp(3.5rem, 8vw, 6rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  margin: 0;
  overflow-x: clip; /* el sello entra escalado y no debe correr la página hacia los lados */
  background: var(--papel);
  color: var(--texto);
  font-family: "Literata", Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  font-size: 1.0625rem;
  line-height: 1.7;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--tinta);
  font-weight: 600;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 5.6vw, 4.1rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
}

h2 {
  font-size: clamp(1.85rem, 3.4vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.15rem;
  line-height: 1.3;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--tinta);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--sello);
  outline-offset: 3px;
}

mark.pendiente {
  background: #fff1b8;
  color: var(--texto);
  padding: 0 0.2em;
  font-size: 0.92em;
}

.mano {
  font-style: italic;
  color: var(--tinta);
}

.envoltura {
  width: 100%;
  max-width: var(--ancho);
  margin-inline: auto;
  padding-inline: var(--margen);
}

.saltar {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  background: var(--tinta);
  color: #fff;
}

.saltar:focus {
  top: 1rem;
}

.oculto {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Botones y enlaces */

.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.7rem 1.5rem;
  border: 2px solid var(--sello);
  border-radius: 999px;
  background: var(--sello);
  color: #fff;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.boton:hover {
  background: var(--sello-hondo);
  border-color: var(--sello-hondo);
}

.boton--chico {
  white-space: nowrap;
  min-height: 2.6rem;
  padding: 0.4rem 1.1rem;
  font-size: 0.95rem;
}

.boton--borde {
  background: transparent;
  color: var(--sello);
}

.boton--borde:hover {
  background: var(--sello);
  color: #fff;
}

.enlace {
  font-weight: 600;
}

/* Cabecera */

.cabecera {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--regla);
}

.cabecera__fila {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.25rem;
}

.marca {
  display: grid;
  line-height: 1.1;
  text-decoration: none;
  color: var(--tinta);
}

.marca__nombre {
  font-size: 1.35rem;
  font-weight: 650;
}

.marca__linea {
  white-space: nowrap;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--texto-suave);
}

.menu {
  display: none;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu a {
  color: var(--texto);
  text-decoration: none;
}

.menu a:hover {
  color: var(--tinta);
  text-decoration: underline;
}

/* Portada */

.portada {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) var(--seccion);
}

.portada__rejilla {
  display: grid;
  gap: 3rem;
  align-items: start;
}

.entrada {
  margin-top: 1.5rem;
  max-width: 33rem;
  font-size: 1.2rem;
  color: var(--texto-suave);
}

.acciones {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.75rem;
  margin-top: 2rem;
}

.nota {
  margin-top: 2rem;
  max-width: 30rem;
  padding-top: 1rem;
  border-top: 1px solid var(--regla);
  font-size: 0.95rem;
  color: var(--texto-suave);
}

/* La fórmula */

.formula {
  position: relative;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  background-color: var(--seguridad);
  background-image:
    repeating-radial-gradient(circle at 0 0, transparent 0 11px, rgba(110, 160, 125, 0.17) 11px 12px),
    repeating-radial-gradient(circle at 100% 100%, transparent 0 11px, rgba(110, 160, 125, 0.17) 11px 12px);
  border: 1px solid var(--guilloche);
  border-radius: 3px;
  box-shadow: 0 1.5rem 2.5rem -1.75rem rgba(29, 47, 134, 0.45);
}

.formula__membrete {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--tinta);
}

.formula__estudio {
  font-size: 1.3rem;
  font-weight: 650;
  color: var(--tinta);
  line-height: 1.2;
}

.formula__sub {
  font-size: 0.9rem;
  color: var(--texto-suave);
}

.formula__membrete h2 {
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 500;
}

.formula__datos {
  display: grid;
  gap: 0.6rem;
  margin: 1.25rem 0 0;
}

.formula__datos > div {
  display: grid;
  gap: 0 0.75rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px dotted rgba(29, 47, 134, 0.45);
}

.formula__datos dt {
  font-size: 0.85rem;
  color: var(--texto-suave);
}

.formula__datos dd {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.45;
}

.formula__rp {
  margin-top: 1.5rem;
  font-size: 2.4rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  color: var(--tinta);
}

.formula__items {
  margin: 0.75rem 0 0;
  padding-left: 1.6rem;
}

.formula__items li {
  padding-left: 0.4rem;
}

.formula__items li + li {
  margin-top: 1.1rem;
}

.formula__items li::marker {
  font-weight: 700;
  color: var(--tinta);
}

.formula__items p {
  margin-top: 0.2rem;
  font-size: 0.98rem;
  line-height: 1.6;
}

.formula__indicaciones {
  margin-top: 1.5rem;
  padding: 0.75rem 0;
  border-block: 1px solid var(--guilloche);
}

.formula__indicaciones strong {
  color: var(--tinta);
}

.formula__pie {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
}

.formula__firma {
  display: grid;
  min-width: 11rem;
  font-size: 0.85rem;
  color: var(--texto-suave);
}

.formula__firma .mano {
  font-size: 1.6rem;
  line-height: 1.2;
  padding-inline: 0.25rem;
  border-bottom: 1px solid var(--texto);
}

.sello {
  flex: none;
  width: clamp(6.5rem, 22vw, 8.5rem);
  height: auto;
  margin: -1rem -0.25rem -0.5rem 0;
  color: var(--sello);
  opacity: 0.88;
  transform: rotate(-14deg);
  font-family: "Literata", Georgia, serif;
}

/* Secciones */

.seccion {
  padding-block: var(--seccion);
}

.seccion--linea {
  border-top: 1px solid var(--regla);
}

.seccion__intro {
  margin-top: 1rem;
  max-width: 42rem;
  color: var(--texto-suave);
}

/* Resultados */

.resultados {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.resultados__texto p {
  margin-top: 1rem;
  max-width: 30rem;
  font-size: 1.15rem;
  color: var(--texto-suave);
}

.hoja {
  margin: 0;
  max-width: 32rem;
}

.hoja__rotulo {
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--texto-suave);
}

.hoja__papel {
  padding: clamp(1.25rem, 4vw, 2rem);
  background: var(--papel);
  border: 1px solid var(--regla);
  border-top: 6px solid var(--tinta);
  border-radius: 3px;
  box-shadow: 0 1.25rem 2rem -1.5rem rgba(31, 37, 55, 0.35);
}

.hoja__encabezado {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  font-size: 0.92rem;
  color: var(--texto-suave);
  text-align: right;
}

.hoja__titulo {
  font-size: 1.5rem;
  font-weight: 650;
  color: var(--tinta);
  text-align: left;
}

.hoja table {
  width: 100%;
  margin-top: 1.25rem;
  border-collapse: collapse;
}

.hoja th,
.hoja td {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--regla);
  text-align: left;
  vertical-align: baseline;
}

.hoja thead th {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--texto-suave);
  border-bottom: 1px solid var(--texto);
}

.hoja tbody th {
  font-weight: 400;
}

.hoja td {
  text-align: right;
  font-size: 1.35rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--tinta);
}

.hoja thead th:last-child {
  text-align: right;
}

.hoja__obs {
  margin-top: 1rem;
  font-size: 0.95rem;
}

.hoja__obs span {
  font-weight: 600;
}

/* Proceso: una línea de tiempo */

.pasos {
  counter-reset: paso;
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
  max-width: 44rem;
}

.pasos li {
  counter-increment: paso;
  position: relative;
  padding: 0 0 2rem 3.75rem;
}

.pasos li::before {
  content: counter(paso);
  position: absolute;
  left: 0;
  top: -0.1rem;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 2px solid var(--tinta);
  border-radius: 50%;
  background: var(--papel);
  font-weight: 700;
  color: var(--tinta);
}

.pasos li::after {
  content: "";
  position: absolute;
  left: calc(1.25rem - 1px);
  top: 2.5rem;
  bottom: 0;
  width: 2px;
  background: var(--guilloche);
}

.pasos li:last-child {
  padding-bottom: 0;
}

.pasos li:last-child::after {
  display: none;
}

.pasos p {
  margin-top: 0.2rem;
  color: var(--texto-suave);
}

/* Planes: tabla de tarifas */

.tarifas {
  width: 100%;
  margin-top: 2.5rem;
  border-collapse: collapse;
}

.tarifas thead {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.tarifas tr {
  display: grid;
  gap: 0.5rem;
  padding-block: 1.5rem;
  border-top: 1px solid var(--regla);
}

.tarifas tbody tr:last-child {
  border-bottom: 1px solid var(--regla);
}

.tarifas th,
.tarifas td {
  padding: 0;
  text-align: left;
  vertical-align: top;
}

.tarifas tbody th {
  font-size: 1.6rem;
  font-weight: 650;
  color: var(--tinta);
}

.tarifas td {
  color: var(--texto-suave);
}

.tarifas td.cifra {
  display: grid;
  font-weight: 650;
  font-size: 1.15rem;
  color: var(--texto);
  font-variant-numeric: tabular-nums;
}

.tarifas td.cifra::before {
  content: attr(data-titulo);
  margin-top: 0.4rem;
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--texto-suave);
}

.tarifas__nota {
  margin-top: 1.75rem;
  max-width: 44rem;
}

/* Acuerdos */

.acuerdos {
  display: grid;
  gap: 3rem;
}

.acuerdos p {
  margin-top: 1rem;
  max-width: 34rem;
  font-size: 1.1rem;
}

.reglas {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.reglas li {
  position: relative;
  padding: 0.7rem 0 0.7rem 1.75rem;
  border-bottom: 1px solid var(--regla);
}

.reglas li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 1.3rem;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--sello);
}

/* Nosotros */

.nosotros {
  display: grid;
  gap: 1.25rem;
}

.nosotros p {
  max-width: 40rem;
  font-size: 1.1rem;
}

.nosotros p + p {
  margin-top: 1rem;
}

/* Contacto */

.contacto {
  display: grid;
  gap: 3rem;
}

.contacto__texto > p {
  margin-top: 1rem;
  max-width: 28rem;
  color: var(--texto-suave);
}

.canales {
  display: grid;
  justify-items: start;
  gap: 0.9rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.formulario {
  display: grid;
  gap: 1.2rem;
  padding: clamp(1.25rem, 4vw, 2.25rem);
  background-color: var(--seguridad);
  border: 1px solid var(--guilloche);
  border-radius: 3px;
}

.formulario__titulo {
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--tinta);
  font-size: 1.3rem;
  font-weight: 650;
  color: var(--tinta);
}

.campo {
  display: grid;
  gap: 0.3rem;
}

.campo-doble {
  display: grid;
  gap: 1.2rem;
}

.campo label {
  font-weight: 600;
}

.opcional {
  font-weight: 400;
  color: var(--texto-suave);
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid #8e9aae;
  border-radius: 4px;
  background: #fff;
  color: var(--texto);
  font: inherit;
}

textarea {
  resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--sello);
  outline-offset: 1px;
  border-color: var(--tinta);
}

.ayuda {
  font-size: 0.92rem;
  color: var(--texto-suave);
}

.autoriza {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  font-size: 0.95rem;
}

.autoriza input {
  width: 1.3rem;
  height: 1.3rem;
  margin-top: 0.2rem;
  accent-color: var(--sello);
}

.formulario .boton {
  justify-self: start;
}

.formulario__estado:empty {
  display: none;
}

.formulario__estado {
  padding: 0.8rem 1rem;
  border-left: 4px solid var(--tinta);
  background: var(--papel);
}

.formulario__estado.es-error {
  border-left-color: #b3261e;
}

/* Pie */

.pie {
  padding-block: 2.5rem;
  border-top: 2px solid var(--tinta);
  font-size: 0.95rem;
  color: var(--texto-suave);
}

.pie__fila {
  display: grid;
  gap: 1rem;
}

.pie__marca {
  margin-right: 0.4rem;
  font-weight: 650;
  color: var(--tinta);
}

.pie ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Privacidad */

.texto-legal {
  padding-block: clamp(2.5rem, 7vw, 4.5rem) var(--seccion);
}

.texto-legal .envoltura {
  max-width: 44rem;
}

.texto-legal h1 {
  font-size: clamp(2.2rem, 6vw, 3.2rem);
}

.texto-legal h2 {
  margin-top: 2.5rem;
  font-size: 1.5rem;
}

.texto-legal p,
.texto-legal ul {
  margin-top: 1rem;
}

.texto-legal li + li {
  margin-top: 0.4rem;
}

.texto-legal .vigencia {
  font-style: italic;
  color: var(--texto-suave);
}

/* Tamaños mayores */

@media (max-width: 29.99rem) {
  .cabecera .solo-ancho {
    display: none;
  }
}

@media (min-width: 40rem) {
  .formula__datos > div {
    grid-template-columns: 9.5rem 1fr;
    align-items: baseline;
  }

  .campo-doble {
    grid-template-columns: 1fr 1fr;
  }

  .tarifas tr {
    grid-template-columns: 9rem 1fr;
    column-gap: 2rem;
  }

  .tarifas tbody th {
    grid-row: span 3;
  }
}

@media (min-width: 60rem) {
  .menu {
    display: flex;
  }

  .portada__rejilla {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 4.5rem;
  }

  .portada__texto {
    position: sticky;
    top: 7rem;
    padding-top: 2rem;
  }

  .resultados {
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
  }

  .hoja {
    justify-self: end;
    width: 100%;
  }

  .proceso {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 4rem;
  }

  .proceso h2 {
    position: sticky;
    top: 7rem;
    align-self: start;
  }

  .pasos {
    margin-top: 0.5rem;
  }

  .tarifas thead {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }

  .tarifas thead tr {
    border-top: 0;
    padding-block: 0 0.75rem;
  }

  .tarifas tr {
    grid-template-columns: 10rem 1fr 13rem 11rem;
    align-items: baseline;
  }

  .tarifas tbody th {
    grid-row: auto;
  }

  .tarifas thead th {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--texto-suave);
  }

  .tarifas td.cifra {
    display: block;
    font-size: 1.2rem;
  }

  .tarifas td.cifra::before {
    content: none;
  }

  .acuerdos {
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
  }

  .nosotros {
    grid-template-columns: 0.8fr 1.2fr;
    gap: 4rem;
  }

  .contacto {
    grid-template-columns: 0.8fr 1.2fr;
    gap: 4rem;
    align-items: start;
  }

  .pie__fila {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

/* El único movimiento: el sello cae sobre la fórmula cuando la hoja aparece */

@media (prefers-reduced-motion: no-preference) {
  .anima .sello {
    opacity: 0;
    transform: rotate(-4deg) scale(1.7);
  }

  .anima .formula.sellada .sello {
    animation: sellar 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.25) 0.6s forwards;
  }

  @keyframes sellar {
    to {
      opacity: 0.88;
      transform: rotate(-14deg) scale(1);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .boton {
    transition: none;
  }
}
