/*
 * Glamour Esbelt · cronograma de seguimiento de tirzepatida
 * Colores tomados de la hoja impresa: rosa, vino y dorado del logo.
 */

:root {
  --fondo: #fff5f7;
  --panel: #ffffff;
  --rosa-50: #fff0f4;
  --rosa-100: #fde3ec;
  --rosa-200: #f8c6d7;
  --rosa-400: #e8749f;
  --rosa-500: #d9467f;
  --rosa-600: #bf2f68;
  --vino: #7a1f45;
  --texto: #4b2735;
  --suave: #84586a;
  --linea: #f2cfdc;
  --wa: #1c9e50;
  --wa-oscuro: #178643;

  --radio: 20px;
  --sombra: 0 1px 2px rgb(122 31 69 / 0.05), 0 12px 26px -16px rgb(122 31 69 / 0.28);
  --sans: "Quicksand", ui-rounded, "Segoe UI", system-ui, -apple-system, sans-serif;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --script: "Dancing Script", "Segoe Script", "Brush Script MT", cursive;

  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

body:has(dialog[open]) {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  flex: none;
  width: 1.25em;
  height: 1.25em;
}

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

:focus-visible {
  outline: 3px solid var(--rosa-400);
  outline-offset: 2px;
}

.contenedor {
  width: min(100% - 32px, 760px);
  margin-inline: auto;
}

/* ── Cabecera ──────────────────────────────────────────────────────────── */
.cabecera {
  position: relative;
  padding: 52px 16px 26px;
  text-align: center;
  background:
    radial-gradient(circle at 12% 18%, rgb(248 198 215 / 0.55), transparent 42%),
    radial-gradient(circle at 92% 8%, rgb(253 227 236 / 0.9), transparent 38%),
    linear-gradient(#fff, var(--fondo));
  border-bottom: 1px solid var(--linea);
}

.cabecera__volver {
  position: absolute;
  top: 10px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 10px;
  color: var(--suave);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
}

.cabecera__volver:hover {
  color: var(--vino);
  background: var(--rosa-50);
}

.cabecera__logo {
  width: 128px;
  height: auto;
  margin: 0 auto 10px;
}

.titulo {
  display: grid;
  gap: 2px;
}

.titulo__serif {
  color: var(--vino);
  font-family: var(--serif);
  font-size: clamp(21px, 5.9vw, 34px);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
  text-transform: uppercase;
}

.titulo__script {
  color: var(--rosa-500);
  font-family: var(--script);
  font-size: clamp(27px, 7.6vw, 44px);
  font-weight: 600;
  line-height: 1.15;
}

.adorno {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 300px;
  margin: 10px auto 6px;
  color: var(--rosa-400);
}

.adorno::before,
.adorno::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rosa-200);
}

.adorno .icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.lema {
  color: var(--suave);
  font-size: 15px;
}

/* ── Aviso de privacidad ───────────────────────────────────────────────── */
.aviso {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 20px 0 16px;
  padding: 12px 14px;
  color: var(--suave);
  font-size: 14px;
  background: var(--rosa-50);
  border: 1px solid var(--linea);
  border-radius: 14px;
}

.aviso .icon {
  margin-top: 1px;
  color: var(--rosa-500);
}

.aviso strong {
  color: var(--vino);
}

/* ── Paneles ───────────────────────────────────────────────────────────── */
.panel {
  margin-bottom: 16px;
  padding: 18px 16px 20px;
  background: var(--panel);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}

.panel__titulo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--vino);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
}

.panel__titulo + .panel__ayuda {
  margin-top: -6px;
}

.panel__ayuda {
  margin-bottom: 14px;
  color: var(--suave);
  font-size: 14px;
}

.panel__ayuda strong {
  color: var(--vino);
}

.panel__icono {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  color: var(--rosa-500);
  background: var(--rosa-100);
  border-radius: 50%;
}

.subtitulo {
  margin: 14px 0 2px;
  color: var(--rosa-600);
  font-size: 15px;
  font-weight: 700;
}

/* ── Campos ────────────────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
}

.campo,
.grupo {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.campo--full,
.grupo--full {
  grid-column: 1 / -1;
}

.campo > span,
.grupo > legend {
  color: var(--suave);
  font-size: 13px;
  font-weight: 600;
}

.grupo {
  margin: 0;
  padding: 0;
  border: 0;
}

.grupo > legend {
  margin-bottom: 5px;
  padding: 0;
}

input:not([type="radio"]),
select,
textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--texto);
  font-size: 16px; /* 16px evita que el celular haga zoom al escribir */
  background: var(--rosa-50);
  border: 1.5px solid var(--linea);
  border-radius: 12px;
  -webkit-appearance: none;
  appearance: none;
  transition:
    border-color 0.15s,
    background-color 0.15s,
    box-shadow 0.15s;
}

input::placeholder,
textarea::placeholder {
  color: #c39aab;
}

input::-webkit-date-and-time-value {
  text-align: left;
}

textarea {
  min-height: 70px;
  resize: vertical;
}

select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2384586a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 18px;
  cursor: pointer;
}

input:not([type="radio"]):focus,
select:focus,
textarea:focus {
  outline: none;
  background-color: #fff;
  border-color: var(--rosa-400);
  box-shadow: 0 0 0 3px rgb(232 116 159 / 0.2);
}

/* Botones de opción (Sí / No, sexo, tolerancia) */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  position: relative;
  display: inline-flex;
}

.chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.chip > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 56px;
  min-height: 44px;
  padding: 6px 14px;
  color: var(--suave);
  font-size: 15px;
  font-weight: 700;
  background: #fff;
  border: 1.5px solid var(--linea);
  border-radius: 999px;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s;
}

.chip:hover > span {
  border-color: var(--rosa-200);
}

.chip input:checked + span {
  color: #fff;
  background: var(--rosa-500);
  border-color: var(--rosa-500);
}

.chip--no input:checked + span {
  color: var(--vino);
  background: var(--rosa-100);
  border-color: var(--rosa-400);
}

.chip input:focus-visible + span {
  outline: 3px solid var(--rosa-400);
  outline-offset: 2px;
}

/* Filas de antecedentes */
.sino {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--linea);
}

.sino:last-child {
  border-bottom: 0;
}

.sino__label {
  font-size: 15px;
  line-height: 1.3;
}

.sino .chips {
  flex: none;
  flex-wrap: nowrap;
}

.sino .chip > span {
  min-width: 54px;
  padding-inline: 12px;
}

/* ── Medidas ───────────────────────────────────────────────────────────── */
.medidas {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
  table-layout: fixed;
}

.medidas__zona {
  width: 36%;
}

.medidas th {
  color: var(--rosa-600);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.medidas tbody th {
  padding-right: 6px;
  color: var(--texto);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
}

.medidas td {
  padding: 0 3px;
}

.medidas td:last-child {
  padding-right: 0;
}

.medidas input:not([type="radio"]) {
  min-height: 44px;
  padding: 8px 4px;
  text-align: center;
}

/* ── Dosis ─────────────────────────────────────────────────────────────── */
.dosis {
  margin-bottom: 10px;
  background: var(--rosa-50);
  border: 1.5px solid var(--linea);
  border-radius: 16px;
}

.dosis:last-child {
  margin-bottom: 0;
}

.dosis[open] {
  background: #fff;
  border-color: var(--rosa-200);
}

.dosis summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 14px;
  list-style: none;
  cursor: pointer;
  border-radius: 15px;
}

.dosis summary::-webkit-details-marker {
  display: none;
}

.dosis__n {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  color: var(--rosa-600);
  font-weight: 700;
  background: #fff;
  border: 1.5px solid var(--rosa-200);
  border-radius: 50%;
}

.dosis--hecha .dosis__n {
  color: #fff;
  background: var(--rosa-500);
  border-color: var(--rosa-500);
}

.dosis__res {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.dosis__res strong {
  font-size: 15px;
}

.dosis__res small {
  overflow: hidden;
  color: var(--suave);
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dosis__chev {
  color: var(--suave);
  transition: transform 0.2s;
}

.dosis[open] .dosis__chev {
  transform: rotate(180deg);
}

.dosis__campos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
  padding: 4px 14px 16px;
}

.caras .chip > span {
  flex-direction: column;
  gap: 2px;
  min-width: 78px;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 14px;
}

.caras .chip .icon {
  width: 28px;
  height: 28px;
}

/* ── Consejos ──────────────────────────────────────────────────────────── */
.tips {
  display: grid;
  gap: 12px;
  margin: 4px 0 14px;
}

.tip {
  padding: 16px;
  background: var(--rosa-50);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
}

.tip h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--rosa-500);
  font-family: var(--script);
  font-size: 25px;
  font-weight: 600;
  line-height: 1.2;
}

.tip h2 .icon {
  width: 24px;
  height: 24px;
}

.tip p,
.tip ul {
  margin: 0;
  color: var(--suave);
  font-size: 14px;
}

.tip ul {
  padding-left: 18px;
}

.frase {
  color: var(--vino);
  font-family: var(--script);
  font-size: 27px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

.borrar {
  margin: 22px 0 8px;
  text-align: center;
}

.btn-texto {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 14px;
  color: var(--suave);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
  cursor: pointer;
}

.btn-texto:hover {
  color: var(--vino);
}

/* ── Botones ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 12px 20px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background-color 0.15s,
    transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn--wa {
  color: #fff;
  background: var(--wa);
  box-shadow: 0 10px 22px -10px rgb(28 158 80 / 0.7);
}

.btn--wa:hover {
  background: var(--wa-oscuro);
}

.btn--sec {
  color: var(--vino);
  background: #fff;
  border: 1.5px solid var(--rosa-200);
}

.btn--sec:hover {
  background: var(--rosa-50);
}

.btn--block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.7;
  cursor: progress;
}

.btn[hidden] {
  display: none;
}

/* ── Barra inferior fija ───────────────────────────────────────────────── */
.barra {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgb(255 245 247 / 0.94);
  border-top: 1px solid var(--linea);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.barra__dentro {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 760px);
  margin-inline: auto;
}

.barra__estado {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--suave);
  font-size: 13px;
  line-height: 1.25;
}

.barra__estado .icon {
  width: 16px;
  height: 16px;
  color: var(--wa);
}

.barra .btn {
  flex: none;
}

/* ── Ventana de envío ──────────────────────────────────────────────────── */
.envio {
  width: min(100% - 24px, 460px);
  max-width: none;
  max-height: calc(100dvh - 24px);
  padding: 0;
  color: var(--texto);
  background: #fff;
  border: 0;
  border-radius: 22px;
  box-shadow: 0 30px 60px -20px rgb(74 39 53 / 0.5);
}

.envio::backdrop {
  background: rgb(74 39 53 / 0.55);
}

.envio__dentro {
  display: grid;
  gap: 12px;
  max-height: calc(100dvh - 24px);
  padding: 20px 18px 18px;
  overflow: auto;
}

.envio h2 {
  padding-right: 40px;
  color: var(--vino);
  font-size: 20px;
}

.envio__img {
  width: 100%;
  max-height: 36dvh;
  object-fit: contain;
  object-position: top;
  background: var(--fondo);
  border: 1px solid var(--linea);
  border-radius: 12px;
}

.envio__pasos {
  margin: 0;
  padding-left: 22px;
  color: var(--suave);
  font-size: 14px;
}

.envio__pasos b {
  color: var(--vino);
}

.envio__cerrar {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--vino);
  background: var(--rosa-50);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

/* ── Aviso flotante ────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(92px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 60;
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  background: var(--vino);
  border-radius: 999px;
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ── Pantallas más grandes ─────────────────────────────────────────────── */
@media (min-width: 640px) {
  .cabecera__logo {
    width: 150px;
  }

  .panel {
    padding: 22px 24px 24px;
  }

  .grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .tips {
    grid-template-columns: 1fr 1fr;
  }

  .medidas__zona {
    width: 40%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
