/* ==========================================================================
   ELEVEN TATTOO CREW · Consentimiento informado
   Estilos. Móvil primero (375–430 px), luego tablet y escritorio.
   Lenguaje visual tomado del estudio: negro tinta + amarillo eléctrico del
   logo, verde oliva de las paredes, papel crema, tipografía ancha y pesada.
   ========================================================================== */

:root {
  --ink: #0B0B0D;
  --volt: #F1F04A;
  --wall: #34422F;
  --wall-deep: #232C20;
  --paper: #F2EBD9;
  --paper-hi: #FBF7EA;
  --paper-lo: #E3DAC2;
  --wood: #C89B64;
  --rust: #B8321A;
  --muted: #5A594D;

  --radius: 12px;
  --shadow: 4px 4px 0 var(--ink);
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--wall-deep) radial-gradient(120% 80% at 20% 0%, var(--wall) 0%, var(--wall-deep) 72%) fixed;
  -webkit-font-smoothing: antialiased;
}

/* Grano de pared / papel */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .22 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 12px calc(24px + env(safe-area-inset-bottom));
}

/* ---------- Marca ---------- */
.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1;
  text-decoration: none;
  color: var(--volt);
}
.brand__name {
  font-weight: 900;
  font-stretch: 125%;
  font-size: 26px;
  letter-spacing: .005em;
  text-transform: uppercase;
}
.brand__sub {
  padding-left: 2px;
  font-weight: 800;
  font-size: 9.5px;
  letter-spacing: .46em;
  text-transform: uppercase;
  color: var(--paper);
}
.brand img { display: block; height: 38px; width: auto; }

/* ---------- Barra superior + progreso ---------- */
.topbar {
  padding: max(16px, env(safe-area-inset-top)) 4px 16px;
  color: var(--paper);
}
.progress { margin-top: 16px; }
.progress__label {
  margin: 0 0 8px;
  min-height: 1.3em;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.progress__bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.progress__bar i {
  display: block;
  height: 5px;
  border-radius: 2px;
  background: rgba(242, 235, 217, .22);
  transition: background .25s;
}
.progress__bar i.is-done { background: var(--volt); }
.progress__bar i.is-current { background: var(--paper); }
body[data-step="0"] .progress,
body[data-step="6"] .progress { display: none; }

/* ---------- Columna lateral (solo escritorio) ---------- */
.rail { display: none; }

/* ---------- Hoja de papel ---------- */
.sheet {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 20px;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, .55);
}
#consentForm { display: flex; flex-direction: column; flex: 1; }

.step {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 28px 20px 0;
  animation: rise .35s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Tipografía ---------- */
.display {
  margin: 0;
  font-weight: 900;
  font-stretch: 125%;
  font-size: clamp(28px, 8.4vw, 40px);
  line-height: .98;
  letter-spacing: -.005em;
  text-transform: uppercase;
  overflow-wrap: break-word;
  outline: none;
}
.display--xl { font-size: clamp(24px, 7.3vw, 46px); }
.kicker {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.kicker b { color: var(--ink); }
.lead { margin: 16px 0 0; font-size: 18px; line-height: 1.5; max-width: 34em; }
.lead--sm { font-size: 17px; margin-top: 12px; }
.step__head { margin-bottom: 28px; }
.fine { margin: 18px 0 0; font-size: 14px; color: var(--muted); }

/* ---------- Bienvenida ---------- */
.step--welcome { padding-top: 24px; }
.welcome__art {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 52%;
  max-width: 250px;
  height: 118px;
  background: var(--volt);
  border-top-right-radius: 18px;
  clip-path: polygon(34% 0, 100% 0, 100% 100%, 58% 100%, 70% 60%, 42% 66%);
}
.tag {
  margin: 0 0 54px;
  transform: rotate(-2.5deg);
  transform-origin: left center;
}
.tag span {
  display: inline-block;
  padding: 9px 18px 15px;
  background: var(--volt);
  border: 0;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  clip-path: polygon(0 0, 100% 0, 100% 80%, 96% 100%, 90% 84%, 83% 100%, 76% 85%, 69% 100%, 62% 86%, 55% 100%, 48% 85%, 41% 100%, 34% 86%, 27% 100%, 20% 84%, 13% 100%, 6% 85%, 0 100%);
}
.promise { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 0; border-top: 2px solid var(--ink); }
.promise li {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 2px solid var(--ink);
  font-weight: 700;
}
.promise b {
  font-weight: 900;
  font-stretch: 125%;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  min-width: 26px;
}

/* ---------- Campos ---------- */
.field { margin: 0 0 22px; }
.label {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.label i {
  font-style: normal;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: none;
  color: var(--muted);
}
.hint { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.hint--center { text-align: center; }

.input, .select, .textarea {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  font: inherit;
  font-size: 17px; /* 16 px o más evita el zoom automático en iPhone */
  color: var(--ink);
  background: var(--paper-hi);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  -webkit-appearance: none;
  appearance: none;
  box-shadow: inset 0 -2px 0 rgba(11, 11, 13, .06);
}
.textarea { min-height: 116px; resize: vertical; line-height: 1.45; }
.select {
  padding-right: 48px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='12' viewBox='0 0 18 12'><path d='M2 2l7 7 7-7' fill='none' stroke='%230B0B0D' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
.input::placeholder, .textarea::placeholder { color: #857F6C; }
input[type="date"].input { text-align: left; }
input[type="date"].input::-webkit-date-and-time-value { text-align: left; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--volt), 0 0 0 5px var(--ink);
}

.field__error {
  display: none;
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--rust);
}
.field__error::before {
  content: "!";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--rust);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  vertical-align: 1px;
}
.has-error > .field__error { display: block; }
.has-error > .input, .has-error > .select, .has-error > .textarea { border-color: var(--rust); }

/* ---------- Preguntas Sí/No y chips ---------- */
.q { margin: 0 0 30px; padding: 0; border: 0; min-width: 0; }
.q > legend { float: left; width: 100%; margin: 0 0 8px; }
.q > legend + * { clear: both; }
.q__label {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
}
.q .hint { margin: 0 0 12px; }
.q > .seg, .q > .chips { margin-top: 12px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.choice { position: relative; display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.choice__face {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-hi);
  font-weight: 800;
  font-size: 17px;
  transition: transform .08s, box-shadow .08s, background .12s;
}
.choice--chip .choice__face { min-height: 52px; justify-content: flex-start; font-size: 16px; }
.choice input:checked + .choice__face {
  background: var(--volt);
  box-shadow: var(--shadow);
  transform: translate(-2px, -2px);
}
.choice input:checked + .choice__face::before {
  content: "";
  flex: none;
  width: 14px;
  height: 8px;
  border-left: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  transform: rotate(-45deg) translate(1px, -2px);
}
.choice input:focus-visible + .choice__face { outline: 3px solid var(--ink); outline-offset: 3px; }
.q.has-error .choice__face { border-color: var(--rust); }
.q.has-error > .field__error { display: block; }
.followup { margin: 16px 0 0; animation: rise .28s ease both; }
.photo > .kicker { margin-bottom: 8px; }
.followup .label { text-transform: none; letter-spacing: 0; font-size: 15px; }

/* ---------- Casilla de consentimiento ---------- */
.check {
  position: relative;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 14px;
  align-items: start;
  margin-top: 30px;
  padding: 16px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-hi);
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.check input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.check__box {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
}
.check input:checked ~ .check__box { background: var(--volt); }
.check input:checked ~ .check__box::after {
  content: "";
  width: 16px;
  height: 9px;
  border-left: 3.5px solid var(--ink);
  border-bottom: 3.5px solid var(--ink);
  transform: rotate(-45deg) translate(1px, -2px);
}
.check input:focus-visible ~ .check__box { outline: 3px solid var(--ink); outline-offset: 3px; }
.has-error .check { border-color: var(--rust); }

/* ---------- Texto del consentimiento ---------- */
.prose { display: grid; gap: 24px; }
.prose__block + .prose__block { padding-top: 24px; border-top: 2px dashed rgba(200, 155, 100, .8); }
.prose h3 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 900;
  font-stretch: 118%;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1.2;
}
.prose .num {
  flex: none;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--volt);
  font-size: 12px;
  letter-spacing: .1em;
  font-variant-numeric: tabular-nums;
}
.prose p { margin: 0 0 10px; line-height: 1.62; }
.prose ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.prose li { position: relative; padding-left: 26px; line-height: 1.55; }
.prose li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .55em;
  width: 13px;
  height: 5px;
  background: var(--ink);
  transform: skewX(-32deg);
}

.form-alert {
  margin: 20px 0 0;
  padding: 14px 16px;
  border: 2px solid var(--rust);
  border-radius: var(--radius);
  background: #F6E1D9;
  color: #7D2411;
  font-weight: 700;
}

/* ---------- Confirmación ---------- */
.step--done { padding-top: 40px; }
.done__mark {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin-bottom: 28px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--volt);
  box-shadow: var(--shadow);
}
.done__summary {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: 8px 16px;
  margin: 28px 0 0;
  padding: 16px 0;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  font-size: 16px;
}
.done__summary dt { color: var(--muted); font-weight: 600; }
.done__summary dd { margin: 0; font-weight: 800; overflow-wrap: anywhere; }

/* ---------- Botones ---------- */
.btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 24px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform .08s, box-shadow .08s;
}
.btn { text-align: center; line-height: 1.15; }
.actions .btn { padding: 0 16px; letter-spacing: .06em; }
.btn--primary { background: var(--volt); color: var(--ink); box-shadow: var(--shadow); }
.btn--primary:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:active { background: var(--paper-lo); }
.btn--small { min-height: 48px; padding: 0 18px; font-size: 14px; }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.btn:disabled {
  background: var(--paper-lo);
  border-style: dashed;
  color: #6C6A5C;
  box-shadow: none;
  cursor: not-allowed;
}
.btn.is-busy { pointer-events: none; }

.actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  margin: auto -20px 0;
  padding: 14px 20px calc(18px + env(safe-area-inset-bottom));
  border-radius: 0 0 18px 18px;
  background: linear-gradient(to top, var(--paper) 78%, rgba(242, 235, 217, 0));
}
.actions--single { grid-template-columns: 1fr; }
.step > .field:last-of-type, .step > .q:last-of-type { margin-bottom: 26px; }
.step--welcome .actions, .step--done .actions { padding-top: 28px; }

/* ---------- Tablet ---------- */
@media (min-width: 600px) {
  .app { max-width: 660px; }
  .step { padding: 38px 36px 0; }
  .actions { margin: auto -36px 0; padding-left: 36px; padding-right: 36px; }
  .chips { grid-template-columns: repeat(3, 1fr); }
  .display { font-size: 42px; }
  .display--xl { font-size: 50px; }
  .welcome__art { height: 132px; }
}

/* ---------- Escritorio ---------- */
@media (min-width: 960px) {
  .app {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    align-items: start;
    gap: 72px;
    max-width: 1140px;
    padding: 56px 32px;
  }
  .topbar { display: none; }
  .rail {
    position: sticky;
    top: 56px;
    display: flex;
    flex-direction: column;
    gap: 40px;
    color: var(--paper);
  }
  .brand--lg .brand__name { font-size: 46px; }
  .brand--lg .brand__sub { font-size: 13px; }
  .brand--lg img { height: 64px; }
  .rail__steps { margin: 0; padding: 0; list-style: none; border-top: 1px solid rgba(200, 155, 100, .55); }
  .rail__steps li { border-bottom: 1px solid rgba(200, 155, 100, .55); }
  .rail__steps button {
    display: flex;
    align-items: baseline;
    gap: 18px;
    width: 100%;
    padding: 14px 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .08em;
    text-align: left;
    text-transform: uppercase;
    color: rgba(242, 235, 217, .42);
    cursor: default;
  }
  .rail__steps button b { font-weight: 900; font-stretch: 125%; font-variant-numeric: tabular-nums; }
  .rail__steps button:not(:disabled) { color: var(--paper); cursor: pointer; }
  .rail__steps button[aria-current="step"] { color: var(--volt); }
  .rail__steps button:focus-visible { outline: 3px solid var(--volt); outline-offset: 2px; }
  .rail__foot { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: rgba(242, 235, 217, .6); }
  body[data-step="0"] .rail__steps, body[data-step="6"] .rail__steps { visibility: hidden; }

  .sheet { max-width: 680px; }
  .step { padding: 46px 48px 0; }
  .actions { margin: auto -48px 0; padding: 18px 48px 30px; }
  .display { font-size: 44px; }
  .display--xl { font-size: 54px; }
  .welcome__art { height: 150px; }
}

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