/* mejora IM · buzón anónimo del equipo de IM Clinic
   Paleta: tinta (chocolate profundo) · crema papel · salvia · cristal (de la fachada) */

:root {
  --tinta: #1E1410;
  --chocolate: #3B2418;
  --crema: #F4EFE7;
  --papel: #FBF8F3;
  --salvia: #7C8F76;
  --salvia-oscura: #4F6349;
  --cristal: #C9D3D6;
  --cristal-oscuro: #66767C;
  --gris-texto: #5C524C;

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --cuerpo: "Figtree", "Helvetica Neue", Arial, sans-serif;

  --ancho: 1120px;
  --radio: 18px;
  --transicion: 220ms cubic-bezier(.2,.7,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--cuerpo);
  font-size: 17px;
  line-height: 1.6;
  color: var(--tinta);
  background: var(--crema);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--salvia); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
h1 {
  font-size: clamp(2.6rem, 6.2vw, 5.4rem);
  line-height: 1.02;
  font-variation-settings: "opsz" 144, "SOFT" 70, "WONK" 1;
}
h2 {
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  line-height: 1.12;
  font-variation-settings: "opsz" 96, "SOFT" 50, "WONK" 1;
}
h3 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  line-height: 1.2;
  font-variation-settings: "opsz" 72, "SOFT" 40;
}
p { margin: 0 0 1.1em; }

.ceja {
  font-family: var(--cuerpo);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--salvia);
  margin: 0 0 1rem;
}
.ceja-oscura { color: var(--salvia-oscura); }

.contenedor { width: min(var(--ancho), 100% - 2.5rem); margin-inline: auto; }
.contenedor.estrecho { max-width: 780px; }
.seccion { padding-block: clamp(4rem, 9vw, 7.5rem); }

/* ---------- botones ---------- */
.boton {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-weight: 600; font-size: 0.98rem;
  text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent;
  transition: background var(--transicion), color var(--transicion), border-color var(--transicion), transform var(--transicion);
}
.boton:active { transform: translateY(1px); }
.boton-crema { background: var(--crema); color: var(--tinta); }
.boton-crema:hover { background: #fff; }
.boton-chocolate { background: var(--chocolate); color: var(--crema); }
.boton-chocolate:hover { background: var(--salvia-oscura); }
.boton-chocolate[disabled] { opacity: .6; cursor: progress; }
.boton-linea { border-color: rgba(244,239,231,.55); color: var(--crema); background: transparent; }
.boton-linea:hover { background: rgba(244,239,231,.12); }
.boton-linea-oscura { border-color: var(--chocolate); color: var(--chocolate); background: transparent; }
.boton-linea-oscura:hover { background: var(--chocolate); color: var(--crema); }
.enlace-suave { color: var(--crema); opacity: .85; font-size: .95rem; text-underline-offset: 4px; }
.enlace-suave:hover { opacity: 1; }

/* ---------- barra ---------- */
.barra {
  position: absolute; inset: 0 0 auto 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem clamp(1.25rem, 4vw, 2.5rem);
  color: var(--crema);
}
.marca { font-family: var(--display); text-decoration: none; font-size: 1.45rem; line-height: 1; display: inline-flex; align-items: baseline; gap: .25rem; }
.marca-mejora { font-style: italic; font-weight: 300; font-variation-settings: "opsz" 40, "SOFT" 100, "WONK" 1; }
.marca-im { font-weight: 600; letter-spacing: .04em; font-variation-settings: "opsz" 40, "SOFT" 0; }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 92svh; display: grid; align-items: end;
  color: var(--crema); isolation: isolate; overflow: hidden;
  background: var(--tinta);
}
.hero-foto, .hero-foto img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-foto { z-index: -2; pointer-events: none; }
.hero-foto img { object-fit: cover; object-position: center 55%; }
.hero-velo {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(30,20,16,.62) 0%, rgba(30,20,16,.32) 42%, rgba(30,20,16,.05) 75%, rgba(30,20,16,0) 100%),
    linear-gradient(180deg, rgba(30,20,16,.38) 0%, rgba(30,20,16,.08) 30%, rgba(30,20,16,.18) 55%, rgba(30,20,16,.9) 100%);
}
.hero-texto { text-shadow: 0 1px 2px rgba(30,20,16,.45), 0 8px 30px rgba(30,20,16,.35); }
.hero-texto {
  width: min(var(--ancho), 100% - 2.5rem); margin-inline: auto;
  padding-block: clamp(3rem, 8vw, 6rem) clamp(3rem, 7vw, 5.5rem);
  max-width: 760px; margin-left: max(1.25rem, calc((100% - var(--ancho)) / 2));
}
.hero .ceja { color: var(--cristal); }
.hero-sub { font-size: clamp(1.05rem, 1.6vw, 1.3rem); max-width: 34em; margin-top: 1.4rem; opacity: .95; }
.hero-acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; margin-top: 1.6rem; }

/* entrada del hero */
@media (prefers-reduced-motion: no-preference) {
  .hero-texto > * { opacity: 0; transform: translateY(14px); animation: subir .9s cubic-bezier(.2,.7,.2,1) forwards; }
  .hero-texto > :nth-child(1) { animation-delay: .15s; }
  .hero-texto > :nth-child(2) { animation-delay: .3s; }
  .hero-texto > :nth-child(3) { animation-delay: .5s; }
  .hero-texto > :nth-child(4) { animation-delay: .65s; }
  @keyframes subir { to { opacity: 1; transform: none; } }
}

/* ---------- secciones de texto + foto ---------- */
.dos-columnas { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; }
.dos-columnas.invertida { grid-template-columns: .9fr 1.1fr; }
.texto-largo p { font-size: 1.06rem; color: var(--gris-texto); max-width: 38em; }
.texto-largo h2 { margin-bottom: 1.4rem; color: var(--tinta); }
.figura { margin: 0; border-radius: var(--radio); overflow: hidden; aspect-ratio: 4 / 5; box-shadow: 0 30px 60px -30px rgba(30,20,16,.45); }
.figura img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 860px) {
  .dos-columnas, .dos-columnas.invertida { grid-template-columns: 1fr; }
  .dos-columnas.invertida .figura { order: 2; }
  .figura { aspect-ratio: 4 / 3; }
}

/* ---------- el buzón ---------- */
.escribir h2 { margin-bottom: 1.8rem; }
.tarjeta {
  background: var(--papel); border: 1px solid var(--cristal);
  border-radius: var(--radio); padding: clamp(1.4rem, 4vw, 2.6rem);
  box-shadow: 0 24px 60px -36px rgba(30,20,16,.35);
}

/* la firma: la casilla que no existe */
.campo-inexistente {
  display: grid; gap: .35rem; margin-bottom: 2rem; padding-bottom: 1.6rem;
  border-bottom: 1px dashed var(--cristal);
}
.etiqueta-falsa { font-size: .82rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--cristal-oscuro); }
.linea-falsa {
  position: relative; height: 2.6rem; border: 1px solid var(--cristal); border-radius: 10px;
  background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(201,211,214,.18) 8px 9px);
}
.tachon { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tachon path {
  fill: none; stroke: var(--salvia-oscura); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 420; stroke-dashoffset: 420;
}
.tachon.visible path { transition: stroke-dashoffset 1.1s cubic-bezier(.2,.7,.2,1) .25s; stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) { .tachon path { stroke-dashoffset: 0; transition: none; } }
.aviso-falso { margin: .2rem 0 0; font-family: var(--display); font-style: italic; font-size: 1.08rem; line-height: 1.45; color: var(--salvia-oscura); font-variation-settings: "opsz" 30, "SOFT" 80, "WONK" 1; }

.grupo { border: 0; padding: 0; margin: 0 0 1.7rem; min-width: 0; }
legend, .etiqueta { font-weight: 600; font-size: 1rem; padding: 0; margin-bottom: .7rem; display: block; color: var(--tinta); }
.opcional { font-weight: 500; font-size: .8rem; color: var(--gris-texto); margin-left: .35rem; letter-spacing: .02em; }
.ayuda { font-size: .92rem; color: var(--gris-texto); margin: -.3rem 0 .8rem; }

.chips { display: flex; flex-wrap: wrap; gap: .55rem; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chips span {
  display: inline-block; padding: .5rem .95rem; border-radius: 999px;
  border: 1.5px solid var(--cristal); background: #fff; font-size: .93rem; font-weight: 500;
  color: var(--chocolate); transition: background var(--transicion), border-color var(--transicion), color var(--transicion);
}
.chips label:hover span { border-color: var(--salvia); }
.chips input:checked + span { background: var(--chocolate); border-color: var(--chocolate); color: var(--crema); }
.chips input:focus-visible + span { outline: 3px solid var(--salvia); outline-offset: 2px; }

textarea {
  width: 100%; font: inherit; font-size: 1.02rem; line-height: 1.55; color: var(--tinta);
  padding: .95rem 1.05rem; border-radius: 12px; border: 1.5px solid var(--cristal); background: #fff;
  resize: vertical; min-height: 9rem;
  transition: border-color var(--transicion), box-shadow var(--transicion);
}
textarea:focus { outline: none; border-color: var(--salvia); box-shadow: 0 0 0 4px rgba(124,143,118,.2); }
textarea::placeholder { color: #7B736D; }
textarea[aria-invalid="true"] { border-color: #B2452F; }
.pie-campo { display: flex; justify-content: space-between; gap: 1rem; margin-top: .45rem; font-size: .85rem; }
.contador { color: var(--gris-texto); font-variant-numeric: tabular-nums; }
.error { color: #B2452F; font-weight: 500; }

.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.4rem; margin-top: .4rem; }
.micro { font-size: .85rem; color: var(--gris-texto); }

.recibido { text-align: left; }
.recibido h3 { margin-bottom: .8rem; }
.recibido p { color: var(--gris-texto); margin-bottom: 1.4rem; }

/* ---------- todo cuenta ---------- */
.todo-cuenta { background: #EDE6DB; }
.lista-ideas { list-style: none; padding: 0; margin: .4rem 0 0; display: grid; gap: .9rem; max-width: 34em; }
.lista-ideas li {
  position: relative; padding-left: 2rem; font-family: var(--display); font-size: 1.35rem; line-height: 1.3;
  color: var(--tinta); font-variation-settings: "opsz" 36, "SOFT" 60, "WONK" 1;
}
.lista-ideas li::before {
  content: ""; position: absolute; left: 0; top: .62em; width: 1.1rem; height: 3px; border-radius: 2px; background: var(--salvia);
}

/* ---------- qué pasa después (bloque oscuro con la clínica de noche) ---------- */
.despues { position: relative; background: var(--tinta); color: var(--crema); isolation: isolate; overflow: hidden; }
.despues-fondo {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%;
  z-index: -1; pointer-events: none; opacity: .26; filter: saturate(.6) brightness(.85);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.3), rgba(0,0,0,1) 40%, rgba(0,0,0,.45));
  mask-image: linear-gradient(180deg, rgba(0,0,0,.3), rgba(0,0,0,1) 40%, rgba(0,0,0,.45));
}
.despues .contenedor { position: relative; }
.despues h2 { margin-bottom: 1.4rem; }
.despues p { font-size: 1.1rem; color: rgba(244,239,231,.85); max-width: 38em; }

/* ---------- pie ---------- */
.pie { background: var(--tinta); color: rgba(244,239,231,.75); padding: 2.2rem 0; font-size: .92rem; }
.pie p { margin: 0; }
.marca-pie { color: var(--crema); font-weight: 600; letter-spacing: .04em; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* ---------- ventana "qué se va haciendo" ---------- */
.novedades { border: 0; padding: 0; background: transparent; max-width: min(680px, 100% - 2rem); width: 100%; margin: auto; }
.novedades:not([open]) { display: none; }
.novedades::backdrop { background: rgba(30,20,16,.62); backdrop-filter: blur(3px); }
.novedades-caja {
  position: relative; background: var(--papel); color: var(--tinta); border-radius: var(--radio);
  padding: clamp(1.5rem, 4vw, 2.6rem); max-height: 86vh; overflow: auto; box-shadow: 0 40px 90px -30px rgba(30,20,16,.6);
}
.novedades h2 { margin-bottom: 1.4rem; }
.cerrar {
  position: absolute; top: .9rem; right: .9rem; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  border: 1.5px solid var(--cristal); background: #fff; color: var(--chocolate); font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.cerrar:hover { border-color: var(--salvia); }
.novedades-cargando, .novedades-vacio { color: var(--gris-texto); }
.novedades-mensaje { background: var(--tinta); color: var(--crema); border-radius: 14px; padding: 1.1rem 1.3rem; margin-bottom: 1.6rem; }
.novedades-mensaje .de { font-size: .76rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--cristal); margin: 0 0 .4rem; }
.novedades-mensaje .texto { margin: 0; font-family: var(--display); font-size: 1.15rem; line-height: 1.4; font-variation-settings: "opsz" 30, "SOFT" 60, "WONK" 1; white-space: pre-wrap; }
.novedades-grupo { margin-bottom: 1.8rem; }
.novedades-grupo h3 { font-family: var(--cuerpo); font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--salvia-oscura); margin-bottom: .8rem; }
.novedad { padding: 1rem 0; border-top: 1px solid var(--cristal); }
.novedad:last-child { border-bottom: 1px solid var(--cristal); }
.novedad h4 { font-family: var(--display); font-weight: 400; font-size: 1.3rem; line-height: 1.25; margin: 0 0 .35rem; font-variation-settings: "opsz" 36, "SOFT" 50; }
.novedad p { margin: 0; color: var(--gris-texto); font-size: .98rem; }
.novedad .plazo { display: inline-block; margin-top: .5rem; font-size: .82rem; font-weight: 600; letter-spacing: .04em; color: var(--salvia-oscura); }
.novedad.hecha { background: linear-gradient(90deg, rgba(124,143,118,.12), transparent 70%); margin-inline: -.8rem; padding-inline: .8rem; border-radius: 10px; }
.novedad.hecha .nota { font-family: var(--display); font-style: italic; font-size: 1.08rem; color: var(--salvia-oscura); margin-top: .4rem; font-variation-settings: "opsz" 30, "SOFT" 80, "WONK" 1; }
.despues .abrir-novedades { margin-top: .6rem; }
