/* =========================================================
   Queyma · Formulario de solicitud
   Mobile-first. Colores tomados del logo.
   ========================================================= */
:root {
  --navy: #435F8E;
  --navy-dark: #2E4570;
  --navy-soft: #EAF0F8;
  --green: #42C819;
  --green-dark: #2C8F0C;
  --green-soft: #ECF9E6;
  --red: #E3262B;
  --red-soft: #FDECEC;
  --bg: #F4F7F3;
  --surface: #FFFFFF;
  --ink: #1D2838;
  --muted: #5B6878;
  --line: #D5DCE5;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(29, 40, 56, .06), 0 8px 24px rgba(29, 40, 56, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(ellipse 120% 60% at 50% -10%, #E3F4DA 0%, rgba(227, 244, 218, 0) 60%);
  background-repeat: no-repeat;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }

/* ---------- Header / footer ---------- */
.site-header {
  display: flex;
  justify-content: center;
  padding: 20px 16px 4px;
}
.logo { width: 190px; height: auto; transition: width .25s ease; }
body.in-form .logo { width: 120px; }

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
}
.site-footer p { margin: 0; }

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 12px 0;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 18px;
}

/* ---------- Intro ---------- */
.eyebrow {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  font-size: clamp(24px, 6.4vw, 34px);
  line-height: 1.15;
  color: var(--navy-dark);
  letter-spacing: -.01em;
}
.en-title { margin: 6px 0 0; color: var(--muted); font-size: 15px; font-style: italic; }
.lead { font-size: 17px; margin: 16px 0; }
.lead strong { color: var(--navy-dark); }

.chips {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips li {
  font-size: 14px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--navy-soft);
  color: var(--navy-dark);
}

.note {
  border-left: 4px solid var(--green);
  background: var(--green-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 14px;
  margin-bottom: 20px;
  font-size: 15px;
}
.draft-notice { margin: 12px 0 0; font-size: 14px; color: var(--green-dark); text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: 0;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  min-height: 50px;
  padding: 12px 22px;
  cursor: pointer;
  transition: background .15s ease, transform .05s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(67, 95, 142, .35); outline-offset: 2px; }
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 4px 12px rgba(67, 95, 142, .28); }
.btn-primary:hover { background: var(--navy-dark); }
.btn-primary[disabled] { opacity: .6; cursor: wait; }
.btn-ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--navy); }
.btn-link { background: none; color: var(--navy); min-height: 44px; padding: 8px 0; font-size: 15px; }
.btn-block { width: 100%; }

/* ---------- Progress ---------- */
.progress { margin: -4px 0 18px; }
.progress-bar { height: 6px; background: #E6EBF1; border-radius: 99px; overflow: hidden; }
.progress-bar span {
  display: block; height: 100%; width: 25%;
  background: linear-gradient(90deg, var(--green), var(--green-dark));
  border-radius: 99px;
  transition: width .35s ease;
}
.progress-steps {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  font-size: 12px; color: var(--muted); text-align: center;
}
.progress-steps li.active { color: var(--navy-dark); font-weight: 700; }
.progress-steps li.is-done { color: var(--green-dark); }

/* ---------- Steps ---------- */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.step-title {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--navy-dark);
  margin-bottom: 6px;
  padding: 0;
}
.step-title span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--green-dark);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 2px;
}
.step-hint { margin: 0 0 18px; color: var(--muted); font-size: 15px; }
.step-hint strong { color: var(--ink); }

html.js .step { display: none; }
html.js .step.active { display: block; animation: fadeIn .25s ease; }
html.js #appForm { display: none; }
html.js #appForm.show { display: block; }
html:not(.js) .progress, html:not(.js) #backBtn, html:not(.js) #nextBtn, html:not(.js) #startBtn { display: none; }
html:not(.js) .step { margin-bottom: 32px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Fields ---------- */
.field { margin-bottom: 18px; }
.field > label, .group > legend, .kpi-row label {
  display: block;
  font-weight: 650;
  font-size: 15px;
  margin-bottom: 6px;
  color: var(--ink);
  padding: 0;
}
.group > legend { margin-bottom: 8px; line-height: 1.35; }
.opt { font-weight: 400; color: var(--muted); font-size: 14px; }
.help { margin: -2px 0 8px; font-size: 14px; color: var(--muted); }

input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
input[type="number"], select, textarea {
  width: 100%;
  font: inherit;
  font-size: 16px; /* evita zoom automático en iOS */
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  min-height: 50px;
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none;
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235B6878' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
textarea { resize: vertical; min-height: 140px; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #A0AAB6; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(67, 95, 142, .18);
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.input-prefix input { padding-left: 28px; }

.grid-2 { display: grid; gap: 0 14px; }

/* ---------- Options (radio / checkbox cards) ---------- */
.options { display: grid; gap: 8px; }
.opt-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  line-height: 1.3;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .15s ease, background .15s ease;
}
.opt-card input {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  margin: 0;
  accent-color: var(--navy);
}
.opt-card:has(input:checked) { border-color: var(--navy); background: var(--navy-soft); }
.opt-card:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(67, 95, 142, .25); }
.options-inline { grid-template-columns: 1fr 1fr; }

/* ---------- KPI ---------- */
.kpi-row {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 10px;
  background: #FAFBFC;
}
.kpi-name { margin-bottom: 10px; }
.kpi-vals { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px 8px; align-items: end; }
.kpi-vals > div:last-child { grid-column: 1 / -1; }
.kpi-row label { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.arrow { font-size: 20px; color: var(--green-dark); font-weight: 700; padding-bottom: 12px; }

/* ---------- English question ---------- */
.field.en { background: var(--navy-soft); padding: 14px; border-radius: var(--radius-sm); }
.tag {
  display: inline-block;
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  background: var(--navy); color: #fff;
  padding: 2px 8px; border-radius: 6px; margin-right: 4px; vertical-align: 2px;
}

/* ---------- Counter ---------- */
.counter { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 4px; }
.counter.ok { color: var(--green-dark); }

/* ---------- File upload ---------- */
.file-drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px dashed #B9C4D2;
  border-radius: var(--radius-sm);
  padding: 16px;
  background: #FAFBFC;
  cursor: pointer;
  min-height: 72px;
  transition: border-color .15s ease, background .15s ease;
}
.file-drop::before {
  content: "";
  flex: 0 0 36px; height: 36px;
  border-radius: 10px;
  background: var(--navy-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23435F8E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4M7 9l5-5 5 5M5 20h14'/%3E%3C/svg%3E") center no-repeat;
}
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-text { display: flex; flex-direction: column; min-width: 0; }
.file-text strong { color: var(--navy); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-text small { color: var(--muted); font-size: 13px; }
.file-drop.has-file { border-style: solid; border-color: var(--green); background: var(--green-soft); }
.file-drop.has-file::before {
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%232C8F0C' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center no-repeat;
}

/* ---------- Consent ---------- */
.consent {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px; border-radius: var(--radius-sm);
  background: #FAFBFC; border: 1.5px solid var(--line);
  font-size: 15px; cursor: pointer; margin-bottom: 8px;
}
.consent input { width: 22px; height: 22px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--navy); }

/* ---------- Errors ---------- */
.field-error { display: block; color: var(--red); font-size: 14px; font-weight: 600; margin-top: 6px; }
.invalid input, .invalid select, .invalid textarea, input.invalid, textarea.invalid, select.invalid { border-color: var(--red) !important; }
.group.invalid .opt-card, .consent.invalid, .file-drop.invalid { border-color: var(--red); }
.form-error {
  background: var(--red-soft); color: #A1161A;
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: 15px; font-weight: 600;
}

/* ---------- Bottom nav (sticky on mobile) ---------- */
.nav {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  gap: 10px;
  margin: 8px -18px -22px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-top: 1px solid #E8EDF2;
  border-radius: 0 0 var(--radius) var(--radius);
}
.nav .btn { flex: 1; }
.nav #backBtn { flex: 0 0 auto; }
html.js .nav #submitBtn { display: none; }
html.js .nav.last #submitBtn { display: block; }
html.js .nav.last #nextBtn { display: none; }
html.js .nav.first #backBtn { display: none; }
.saved { margin: 4px 0 0; text-align: center; font-size: 12px; color: var(--muted); min-height: 18px; }

/* ---------- Upload progress ---------- */
.upload-progress { margin: 12px 0; }
.upload-progress p { margin: 6px 0 0; font-size: 14px; color: var(--muted); text-align: center; }

/* ---------- Done ---------- */
.done { text-align: center; padding: 36px 20px; }
.done:focus { outline: none; }
.done-icon {
  width: 72px; height: 72px; margin: 0 auto 16px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--green-soft); color: var(--green-dark);
}
.done h2 { margin: 0 0 10px; color: var(--navy-dark); font-size: 26px; }
.done p { margin: 0 auto 10px; max-width: 46ch; }
.muted { color: var(--muted); font-size: 14px; }

/* ---------- Honeypot ---------- */
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Larger screens ---------- */
@media (min-width: 600px) {
  .wrap { padding: 12px 20px 0; }
  .card { padding: 32px 36px; }
  .nav { margin: 16px -36px -32px; padding: 16px 36px; position: static; background: #fff; }
  .nav #backBtn { flex: 0 0 auto; min-width: 120px; }
  .nav #nextBtn, .nav #submitBtn { flex: 0 0 auto; min-width: 200px; margin-left: auto; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .options-grid { grid-template-columns: 1fr 1fr; }
  .kpi-vals { grid-template-columns: 1fr auto 1fr 1fr; }
  .kpi-vals > div:last-child { grid-column: auto; }
  .logo { width: 230px; }
  body.in-form .logo { width: 150px; }
  .btn-block { width: auto; min-width: 260px; }
  .intro .btn-block { display: block; margin: 0 auto; }
}

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