/* =========================================================================
   KIT DE ENTREVISTAS — ESTILOS
   Moisés Visuals

   Se monta encima de brand.css (tokens, tipografía Diatype, reset).
   Mismo lenguaje visual que /start/restaurant, con dos añadidos:
   RTL real para árabe y tipos de campo nuevos (escala, fecha, piezas).

   Todo el layout usa propiedades lógicas (inline-start / inline-end), así
   que el árabe no necesita una hoja aparte: se voltea solo con dir="rtl".
   ========================================================================= */

:root{
  --r-max: 800px;
  --r-gut: 28px;
  --r-bar: 64px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --ar: 'IBM Plex Sans Arabic', 'Noto Sans Arabic', var(--body), system-ui, sans-serif;
}

/* -----------------------------------------------------------------------
   Correcciones sobre brand.css.
   El sitio principal pone el body en mayúsculas y esconde el cursor porque
   usa uno propio. Aquí no: esto es un formulario largo que se lee y se
   escribe, así que recuperamos texto normal, cursor visible y caret oscuro.
   Además, las mayúsculas forzadas no tienen sentido en árabe.
   ----------------------------------------------------------------------- */
html, body { background: var(--bg); color: var(--text); }
body{
  font-family: var(--body);
  text-transform: none;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
}
input, textarea, select, button, a{
  cursor: auto !important;
  caret-color: var(--accent-pure, #a000ff) !important;
}
@media (hover: hover){
  *{ cursor: auto !important; }
  input[type], textarea, select{
    cursor: auto !important;
    caret-color: var(--accent-pure, #a000ff) !important;
  }
  a, button, [role="button"],
  .r-opt, .r-btn, .r-revedit, .r-lang button, .r-scale button,
  .r-drop button, .r-files li button, .r-item-head{ cursor: pointer !important; }
}
textarea, input{ text-transform: none; }
*, *::before, *::after { box-sizing: border-box; }

/* --------------------------------------------------------------- ÁRABE */
html[lang="ar"] body,
html[lang="ar"] input,
html[lang="ar"] textarea,
html[lang="ar"] button{ font-family: var(--ar); }

/* Los números y los códigos siguen leyéndose de izquierda a derecha
   aunque la página esté en árabe. */
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="date"]{ direction: ltr; text-align: end; }

/* ---------------------------------------------------------------- BARRA */
.r-bar{
  position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 60;
  height: var(--r-bar);
  display: flex; align-items: center; gap: 18px;
  padding-inline: var(--r-gut);
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.r-mark{
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--text); text-decoration: none; font-weight: 600; white-space: nowrap;
  direction: ltr;
}
.r-mark b{ color: var(--accent); font-weight: 600; }
.r-bar-mid{ flex: 1; display: flex; align-items: center; gap: 14px; min-width: 0; }

.r-stepcount{
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  color: var(--faint); white-space: nowrap; text-transform: uppercase;
}
html[lang="ar"] .r-stepcount,
html[lang="ar"] .r-saved,
html[lang="ar"] .r-stepnum,
html[lang="ar"] .r-ey,
html[lang="ar"] .r-revname,
html[lang="ar"] .r-btn,
html[lang="ar"] .r-count,
html[lang="ar"] .r-meta span{ text-transform: none; letter-spacing: 0; font-family: var(--ar); }

.r-track{
  flex: 1; height: 2px; background: rgba(0,0,0,.1);
  position: relative; overflow: hidden; min-width: 40px; border-radius: 2px;
}
.r-track i{
  position: absolute; inset-block: 0; inset-inline-start: 0; width: 0%;
  background: var(--accent-pure, var(--accent));
  transition: width .5s var(--ease);
}
.r-saved{
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  color: var(--faint); text-transform: uppercase;
  opacity: 0; transition: opacity .35s ease; white-space: nowrap;
}
.r-saved.on{ opacity: 1; }

/* -------------------------------------------------------- SELECTOR IDIOMA */
.r-lang{
  display: inline-flex; align-items: stretch;
  border: 1px solid var(--line); border-radius: 999px; overflow: hidden;
  background: #fff; flex-shrink: 0;
}
.r-lang button{
  appearance: none; border: 0; background: transparent;
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  padding-inline: 14px; min-height: 34px; min-width: 42px; color: var(--faint);
  transition: color .2s ease, background .2s ease;
}
.r-lang button:hover{ color: var(--text); }
.r-lang button[aria-pressed="true"]{ color: #fff; background: var(--accent); }
.r-lang button:focus-visible{ outline: 2px solid var(--accent-pure); outline-offset: -2px; }
.r-lang button[data-loc="ar"]{ font-family: var(--ar); font-size: 13px; letter-spacing: 0; }

/* ------------------------------------------------------------------ SHELL */
.r-main{
  max-width: var(--r-max);
  margin-inline: auto;
  padding-block: calc(var(--r-bar) + 56px) 160px;
  padding-inline: var(--r-gut);
}
.r-screen{ animation: rIn .45s var(--ease) both; }
@keyframes rIn{ from{ opacity:0; transform: translateY(14px); } to{ opacity:1; transform:none; } }
@media (prefers-reduced-motion: reduce){
  .r-screen{ animation: none; }
  .r-track i{ transition: none; }
}

.r-ey{
  font-family: var(--mono); font-size: 10px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 18px;
}
.r-h1{
  font-size: clamp(30px, 6vw, 52px); line-height: 1.06;
  letter-spacing: -.02em; font-weight: 500; margin: 0 0 20px;
}
html[lang="ar"] .r-h1, html[lang="ar"] .r-h2{ letter-spacing: 0; line-height: 1.25; }
.r-lead{
  font-size: 16px; line-height: 1.6; color: var(--dim);
  max-width: 58ch; margin: 0 0 34px;
}

/* ------------------------------------------------------------------ INTRO */
.r-meta{
  display: flex; flex-wrap: wrap; gap: 10px 26px;
  padding-block: 20px; margin: 0 0 34px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.r-meta span{
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--faint);
}
.r-meta span b{ color: var(--text); font-weight: 600; }

.r-privacy{
  font-size: 12px; line-height: 1.7; color: var(--faint);
  max-width: 58ch; margin-top: 34px;
  padding-top: 18px; border-top: 1px solid var(--line);
}

/* ------------------------------------------------------------------- PASO */
.r-stephead{ margin-bottom: 40px; }
.r-stepnum{
  font-family: var(--mono); font-size: 10px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}
.r-h2{
  font-size: clamp(24px, 4.4vw, 36px); line-height: 1.12;
  letter-spacing: -.015em; font-weight: 500; margin: 0 0 12px;
}
.r-intro{ font-size: 15px; line-height: 1.65; color: var(--dim); max-width: 58ch; margin: 0; }

/* ------------------------------------------------------------------ CAMPO */
.r-field{ padding-block: 30px; border-top: 1px solid var(--line); }
.r-field:first-of-type{ border-top: 0; padding-block-start: 0; }
.r-field[hidden]{ display: none; }

.r-label{
  display: block; font-size: 16px; line-height: 1.45;
  font-weight: 500; margin-bottom: 6px; letter-spacing: -.005em;
}
html[lang="ar"] .r-label{ letter-spacing: 0; }
.r-field.req .r-label::after{
  content: '*'; color: var(--accent); margin-inline-start: 5px; font-size: 14px;
}
.r-opt-flag{
  font-family: var(--mono); font-size: 9px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--faint);
  margin-inline-start: 8px; vertical-align: 1px;
}
html[lang="ar"] .r-opt-flag{ font-family: var(--ar); text-transform: none; letter-spacing: 0; font-size: 11px; }
.r-hint{ font-size: 13px; line-height: 1.6; color: var(--faint); margin: 0 0 16px; }
.r-label + .r-ctl, .r-label + .r-opts, .r-label + .r-drop,
.r-label + .r-scale, .r-label + .r-items, .r-label + .r-groups{ margin-top: 16px; }

/* inputs */
.r-ctl{ position: relative; }
.r-ctl input, .r-ctl textarea{
  width: 100%; display: block;
  font-family: inherit; font-size: 16px; line-height: 1.5; color: var(--text);
  background: transparent; border: 0; border-bottom: 1px solid var(--line);
  padding-block: 10px; padding-inline: 0; border-radius: 0;
  transition: border-color .25s ease;
}
.r-ctl textarea{ resize: vertical; min-height: 84px; }
.r-ctl textarea.tall{ min-height: 160px; }
.r-ctl input::placeholder, .r-ctl textarea::placeholder{ color: rgba(0,0,0,.22); }
.r-ctl input:focus, .r-ctl textarea:focus{ outline: 0; border-bottom-color: var(--accent-pure); }
.r-ctl::after{
  content: ''; position: absolute; inset-inline-start: 0; inset-block-end: 0;
  height: 2px; width: 0; background: var(--accent-pure);
  transition: width .35s var(--ease);
}
.r-ctl:focus-within::after{ width: 100%; }
.r-ctl.narrow{ max-width: 280px; }

/* opciones */
.r-opts{ display: flex; flex-wrap: wrap; gap: 8px; }
.r-opts.cols{ display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.r-opt{
  appearance: none; text-align: start;
  font-family: inherit; font-size: 14px; line-height: 1.4; color: var(--dim);
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding-block: 10px; padding-inline: 17px;
  transition: border-color .2s ease, color .2s ease, background .2s ease, box-shadow .2s ease;
}
.r-opt:hover{ border-color: rgba(0,0,0,.32); color: var(--text); }
.r-opt[aria-pressed="true"]{
  border-color: var(--accent-pure); color: var(--accent);
  background: var(--panel);
  box-shadow: 0 0 0 1px var(--accent-pure) inset;
}
.r-opt:focus-visible{ outline: 2px solid var(--accent-pure); outline-offset: 2px; }
.r-opts.long .r-opt, .r-opts.cols .r-opt{ border-radius: 10px; }

/* grupos de opciones (alcance) */
.r-groups{ display: grid; gap: 26px; }
.r-group-lbl{
  font-family: var(--mono); font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 12px;
}
html[lang="ar"] .r-group-lbl{ font-family: var(--ar); text-transform: none; letter-spacing: 0; font-size: 12px; }

.r-other{ margin-top: 14px; max-width: 460px; }
.r-count{
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  color: var(--faint); text-transform: uppercase; margin-top: 12px;
}
.r-count.limit{ color: var(--hot); }

/* escala 1–5 */
.r-scale{ display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.r-scale button{
  appearance: none; width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; color: var(--dim);
  font-family: var(--mono); font-size: 13px;
  transition: border-color .2s ease, color .2s ease, background .2s ease, box-shadow .2s ease;
}
.r-scale button:hover{ border-color: rgba(0,0,0,.32); color: var(--text); }
.r-scale button[aria-pressed="true"]{
  border-color: var(--accent-pure); color: var(--accent);
  background: var(--panel); box-shadow: 0 0 0 1px var(--accent-pure) inset;
}
.r-scale button:focus-visible{ outline: 2px solid var(--accent-pure); outline-offset: 2px; }
.r-scale-ends{
  display: flex; justify-content: space-between; gap: 20px; margin-top: 10px;
  font-size: 12px; color: var(--faint); max-width: 330px;
}

/* piezas con cantidad */
.r-items{ display: grid; gap: 8px; }
.r-items.cols{ grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: start; }
.r-item{ border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.r-item.on{ border-color: var(--accent-pure); box-shadow: 0 0 0 1px var(--accent-pure) inset; }
.r-item-head{
  appearance: none; width: 100%; text-align: start; background: transparent; border: 0;
  font-family: inherit; font-size: 14px; line-height: 1.4; color: var(--dim);
  padding-block: 12px; padding-inline: 16px;
  display: flex; align-items: center; gap: 10px;
}
.r-item.on .r-item-head{ color: var(--accent); }
.r-item-head:focus-visible{ outline: 2px solid var(--accent-pure); outline-offset: -2px; }
.r-item-tick{
  width: 16px; height: 16px; border-radius: 4px; flex: 0 0 16px;
  border: 1px solid var(--line); display: grid; place-items: center;
  font-size: 10px; color: #fff; line-height: 1;
}
.r-item.on .r-item-tick{ background: var(--accent); border-color: var(--accent); }
.r-item-spec{ padding-inline: 16px; padding-block: 0 14px; }
.r-item-spec input{
  width: 100%; font-family: inherit; font-size: 13px; color: var(--text);
  background: transparent; border: 0; border-bottom: 1px solid var(--line);
  padding-block: 7px;
}
.r-item-spec input:focus{ outline: 0; border-bottom-color: var(--accent-pure); }

/* fecha */
.r-ctl input[type="date"]{ max-width: 260px; }

/* consentimiento */
.r-consent{
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  padding: 24px; margin-top: 30px;
}
.r-consent h3{ font-size: 15px; font-weight: 600; margin: 0 0 10px; }
.r-consent p{ font-size: 13px; line-height: 1.7; color: var(--dim); margin: 0 0 18px; }
.r-check{
  display: flex; align-items: flex-start; gap: 12px;
  font-size: 14px; line-height: 1.5; color: var(--text);
}
.r-check input{ margin: 0; inline-size: 18px; block-size: 18px; flex: 0 0 18px; margin-block-start: 2px; accent-color: var(--accent-pure); }
.r-check:focus-within{ outline: none; }
.r-consent.bad{ border-color: var(--hot); }

/* archivos */
.r-drop{
  border: 1px dashed rgba(0,0,0,.24); border-radius: 12px;
  padding-block: 30px; padding-inline: 22px; text-align: center; background: var(--panel);
  transition: border-color .2s ease, background .2s ease;
}
.r-drop.over{ border-color: var(--accent-pure); background: #f6ecff; }
.r-drop p{ margin: 0; font-size: 14px; color: var(--dim); }
.r-drop button{
  appearance: none; background: none; border: 0; padding: 0;
  font: inherit; color: var(--accent); text-decoration: underline;
  text-underline-offset: 3px;
}
.r-drop small{
  display: block; margin-top: 10px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--faint);
}
html[lang="ar"] .r-drop small{ font-family: var(--ar); text-transform: none; letter-spacing: 0; font-size: 11px; }
.r-files{ list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.r-files li{
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 8px;
  padding-block: 10px; padding-inline: 14px;
  font-size: 13px; color: var(--dim); background: #fff;
}
.r-files li span{ flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-files li em{ font-style: normal; font-family: var(--mono); font-size: 10px; color: var(--faint); direction: ltr; }
.r-files li button{
  appearance: none; background: none; border: 0; padding: 4px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--faint);
}
.r-files li button:hover{ color: var(--hot); }

/* error de campo */
.r-err{
  display: none; margin-top: 10px;
  font-size: 12.5px; line-height: 1.5; color: var(--hot);
}
.r-err.on{ display: block; }
.r-field.bad .r-ctl input,
.r-field.bad .r-ctl textarea{ border-bottom-color: var(--hot); }

/* --------------------------------------------------------------- ACCIONES */
.r-acts{
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 46px; padding-top: 26px; border-top: 1px solid var(--line);
}
.r-btn{
  appearance: none; font-family: var(--mono);
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  padding-block: 15px; padding-inline: 28px;
  border-radius: 999px; border: 1px solid transparent;
  transition: background .2s ease, color .2s ease, border-color .2s ease, opacity .2s ease;
}
html[lang="ar"] .r-btn{ font-size: 13px; }
.r-btn:focus-visible{ outline: 2px solid var(--accent-pure); outline-offset: 3px; }
.r-btn.primary{ background: var(--text); color: #fff; }
.r-btn.primary:hover{ background: var(--accent); }
.r-btn.primary[disabled]{ opacity: .45; cursor: default !important; background: var(--text); }
.r-btn.ghost{ background: transparent; color: var(--dim); border-color: var(--line); }
.r-btn.ghost:hover{ color: var(--text); border-color: rgba(0,0,0,.34); }
.r-btn.plain{
  background: none; border: 0; color: var(--faint);
  padding-block: 15px; padding-inline: 4px;
  text-decoration: underline; text-underline-offset: 4px;
}
.r-btn.plain:hover{ color: var(--text); }

.r-formerr{
  display: none; width: 100%;
  font-size: 13px; color: var(--hot); margin-top: 4px;
}
.r-formerr.on{ display: block; }

/* --------------------------------------------------------------- REVISIÓN */
.r-rev{ margin-top: 8px; }
.r-revsec{ border-top: 1px solid var(--line); padding-block: 26px; }
.r-revtop{
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 16px;
}
.r-revname{
  font-family: var(--mono); font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent);
}
.r-revedit{
  appearance: none; background: none; border: 0;
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--faint);
  text-decoration: underline; text-underline-offset: 4px;
}
html[lang="ar"] .r-revedit, html[lang="ar"] .r-revname{ font-family: var(--ar); text-transform: none; letter-spacing: 0; font-size: 12px; }
.r-revedit:hover{ color: var(--accent); }
.r-revrow{ display: grid; grid-template-columns: 1fr; gap: 4px; padding-block: 12px; }
.r-revrow + .r-revrow{ border-top: 1px dashed rgba(0,0,0,.08); }
.r-revq{ font-size: 12px; color: var(--faint); line-height: 1.45; }
.r-reva{ font-size: 15px; line-height: 1.6; color: var(--text); white-space: pre-wrap; }
.r-reva.empty{ color: rgba(0,0,0,.26); font-style: italic; }

/* ----------------------------------------------------------------- DIÁLOGO */
.r-modal{
  position: fixed; inset: 0; z-index: 90;
  display: none; align-items: center; justify-content: center;
  padding: 24px; background: rgba(0,0,0,.42);
  backdrop-filter: blur(3px);
}
.r-modal.on{ display: flex; }
.r-modal-box{
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 34px; max-width: 440px; width: 100%;
  box-shadow: 0 30px 80px rgba(0,0,0,.18);
  animation: rIn .3s var(--ease) both;
}
.r-modal-box h3{ font-size: 21px; font-weight: 500; margin: 0 0 10px; letter-spacing: -.01em; }
.r-modal-box p{ font-size: 14px; line-height: 1.65; color: var(--dim); margin: 0 0 24px; }
.r-modal-acts{ display: flex; gap: 10px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ ÉXITO */
.r-done{
  min-height: calc(100vh - var(--r-bar)); min-height: calc(100dvh - var(--r-bar));
  display: flex; flex-direction: column; justify-content: center;
  padding-bottom: 60px;
}
.r-done .r-h1{ margin-bottom: 24px; }
.r-done p{ font-size: 17px; line-height: 1.65; color: var(--dim); max-width: 52ch; margin: 0 0 12px; }
.r-done .r-acts{ border-top: 0; padding-top: 0; margin-top: 40px; }
.r-tick{
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--accent-pure); color: var(--accent);
  display: grid; place-items: center; margin-bottom: 26px; font-size: 16px;
}
.r-ref{
  margin-top: 30px; padding-block: 18px; padding-inline: 22px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  max-width: 420px;
}
.r-ref span{
  display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 8px;
}
html[lang="ar"] .r-ref span{ font-family: var(--ar); text-transform: none; letter-spacing: 0; font-size: 12px; }
.r-ref b{ font-family: var(--mono); font-size: 19px; letter-spacing: .06em; color: var(--text); direction: ltr; display: block; }
.r-ref small{ display: block; margin-top: 10px; font-size: 12px; color: var(--faint); line-height: 1.5; }

/* ------------------------------------------------------------------ SKIP */
.r-skip{
  position: absolute; inset-inline-start: -9999px; top: 0;
  background: #fff; color: var(--text); padding: 12px 18px; z-index: 100;
  border: 1px solid var(--accent-pure); border-radius: 0 0 8px 0;
}
.r-skip:focus{ inset-inline-start: 0; }

/* ----------------------------------------------------------------- MÓVIL */
@media (max-width: 640px){
  :root{ --r-gut: 20px; --r-bar: 56px; }
  .r-main{ padding-block-start: calc(var(--r-bar) + 36px); padding-block-end: 120px; }
  .r-bar{ gap: 12px; }
  .r-mark{ font-size: 9px; letter-spacing: .14em; }
  .r-mark .r-mark-long{ display: none; }
  .r-saved{ display: none; }
  .r-stepcount{ font-size: 9px; }
  .r-lang button{ padding-inline: 15px; min-height: 44px; min-width: 46px; font-size: 11px; }
  .r-acts{ gap: 10px; }
  .r-btn{ padding-block: 14px; padding-inline: 22px; flex: 1 1 auto; text-align: center; }
  .r-btn.plain{ flex-basis: 100%; }
  .r-opts.cols, .r-items.cols{ grid-template-columns: 1fr; }
  .r-scale button{ width: 44px; height: 44px; }
  .r-item-head{ padding-block: 14px; }
}
@media (max-width: 380px){
  .r-mark{ display: none; }
}
