/* ==========================================================================
   LOBO MED — Quiz / Historia clínica
   ========================================================================== */

/* ============ QUIZ SHELL ============ */
.quiz-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============ PROGRESS ============ */
.quiz-progress {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--grafito);
  border-bottom: 1px solid var(--acero-soft);
  padding: 14px var(--pad);
}
.quiz-progress-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
}
.quiz-progress-bar {
  flex: 1;
  height: 3px;
  background: var(--acero-soft);
  border-radius: 9999px;
  overflow: hidden;
}
.quiz-progress-fill {
  height: 100%;
  background: var(--bronce);
  border-radius: 9999px;
  transition: width 400ms cubic-bezier(.4,.0,.2,1);
}
.quiz-progress-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--hueso-mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ============ STEP CONTAINER ============ */
.quiz-body {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 64px var(--pad) 96px;
}
.quiz-step {
  width: 100%;
  max-width: 720px;
  display: none;
}
.quiz-step.active { display: block; }

.step-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--bronce);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.step-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 0.9;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: var(--hueso);
  margin-bottom: 12px;
}
.step-title .accent { color: var(--bronce); }
.step-subtitle {
  font-size: 16px;
  color: var(--hueso-dim);
  line-height: 1.55;
  margin-bottom: 48px;
  max-width: 580px;
}

/* ============ FORM FIELDS ============ */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-bottom: 48px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.field label {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--hueso-mute);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.field label .req {
  color: var(--bronce);
  margin-left: 4px;
}
.field .field-hint {
  font-size: 12px;
  color: var(--hueso-mute);
  margin-top: -4px;
  font-style: italic;
}

/* Text inputs */
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field textarea,
.field select {
  width: 100%;
  background: var(--grafito);
  border: 1px solid var(--acero);
  color: var(--hueso);
  padding: 16px 18px;
  font-family: var(--sans);
  font-size: 16px;
  border-radius: var(--r1);
  transition: border-color 150ms ease;
  appearance: none;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--hueso-mute); }
.field input:hover,
.field textarea:hover,
.field select:hover { border-color: var(--hueso-mute); }
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--bronce);
  box-shadow: 0 0 0 2px rgba(201,168,117,0.18);
}
.field textarea { resize: vertical; min-height: 100px; }

/* Two col layout */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ============ RADIO / CHECKBOX OPTIONS ============ */
.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.options.inline { flex-direction: row; flex-wrap: wrap; gap: 10px; }

.option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--grafito);
  border: 1px solid var(--acero);
  color: var(--hueso);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 15px;
  transition: border-color 150ms ease, background 150ms ease;
  text-align: left;
  border-radius: var(--r1);
}
.option-btn:hover { border-color: var(--bronce-dim); }
.option-btn input[type="radio"],
.option-btn input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--acero);
  background: var(--carbon);
  flex-shrink: 0;
  transition: border-color 150ms ease, background 150ms ease;
  position: relative;
}
.option-btn input[type="radio"] { border-radius: 50%; }
.option-btn input[type="checkbox"] { border-radius: var(--r1); }

.option-btn input[type="radio"]:checked,
.option-btn input[type="checkbox"]:checked {
  border-color: var(--bronce);
  background: var(--bronce);
}
.option-btn input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  width: 6px; height: 6px;
  background: var(--carbon);
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.option-btn input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  font-size: 11px;
  font-weight: 700;
  color: var(--carbon);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  line-height: 1;
}
.option-btn:has(input:checked) {
  border-color: var(--bronce);
  background: rgba(201, 168, 117, 0.08);
}

/* Inline options (smaller pills) */
.options.inline .option-btn {
  padding: 12px 16px;
  font-size: 14px;
}

/* ============ FOLLOW-UP FIELD ============ */
.followup-field {
  display: none;
  margin-top: 12px;
  padding-left: 20px;
  border-left: 2px solid var(--bronce);
}
.followup-field.visible { display: block; }

/* ============ PHOTO UPLOAD ============ */
.photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 48px;
}
.photo-slot {
  position: relative;
  aspect-ratio: 3/4;
}
.photo-slot input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.photo-slot-ui {
  position: absolute;
  inset: 0;
  background: var(--grafito);
  border: 2px dashed var(--acero);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 20px;
  transition: border-color 200ms ease, background 200ms ease;
  pointer-events: none;
}
.photo-slot:hover .photo-slot-ui,
.photo-slot input:focus + .photo-slot-ui {
  border-color: var(--bronce);
  background: rgba(201,168,117,0.06);
}
.photo-slot-ui .photo-icon {
  width: 48px; height: 48px;
  border: 1px solid var(--acero);
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bronce);
}
.photo-slot-ui .photo-label {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--hueso);
}
.photo-slot-ui .photo-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--hueso-mute);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.photo-slot-ui .photo-angle {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--bronce);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
/* Preview cuando hay foto */
.photo-slot .photo-preview {
  position: absolute;
  inset: 0;
  object-fit: cover;
  z-index: 1;
  display: none;
}
.photo-slot.has-photo .photo-preview { display: block; }
.photo-slot.has-photo .photo-slot-ui {
  opacity: 0.15;
}

.photo-instructions {
  background: var(--grafito);
  border: 1px solid var(--acero-soft);
  padding: 20px 24px;
  margin-bottom: 32px;
}
.photo-instructions h4 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  text-transform: uppercase;
  color: var(--hueso);
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}
.photo-instructions ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.photo-instructions li {
  font-size: 13px;
  color: var(--hueso-dim);
  display: flex;
  gap: 10px;
}
.photo-instructions li::before {
  content: "—";
  color: var(--bronce);
  flex-shrink: 0;
}

/* ============ RESUMEN ============ */
.resumen-block {
  background: var(--grafito);
  border: 1px solid var(--acero-soft);
  padding: 28px;
  margin-bottom: 28px;
}
.resumen-block h4 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bronce);
  margin-bottom: 16px;
}
.resumen-row {
  display: flex;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--acero-soft);
  font-size: 14px;
}
.resumen-row:last-child { border-bottom: 0; }
.resumen-row .k {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--hueso-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  min-width: 160px;
  flex-shrink: 0;
}
.resumen-row .v { color: var(--hueso); }

/* Consent */
.consent-block {
  background: var(--grafito);
  border: 1px solid var(--acero-soft);
  border-left: 3px solid var(--bronce);
  padding: 24px;
  margin-bottom: 32px;
}
.consent-block p {
  font-size: 13px;
  color: var(--hueso-dim);
  line-height: 1.65;
}
.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: 20px;
}
.consent-check input[type="checkbox"] {
  width: 20px; height: 20px;
  appearance: none;
  border: 2px solid var(--acero);
  background: var(--carbon);
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
  position: relative;
  margin-top: 2px;
}
.consent-check input:checked {
  border-color: var(--bronce);
  background: var(--bronce);
}
.consent-check input:checked::after {
  content: "✓";
  position: absolute;
  font-size: 12px;
  font-weight: 700;
  color: var(--carbon);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.consent-check label {
  font-size: 14px;
  color: var(--hueso-dim);
  line-height: 1.55;
  cursor: pointer;
}

/* ============ NAV BUTTONS ============ */
.quiz-nav {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.btn-back {
  background: transparent;
  border: 1px solid var(--acero);
  color: var(--hueso-dim);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  padding: 18px 28px;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease;
}
.btn-back:hover { border-color: var(--hueso-dim); color: var(--hueso); }
.quiz-nav .btn-primary { padding: 18px 36px; font-size: 15px; }

/* Error state */
.field-error {
  font-size: 12px;
  color: #E07070;
  display: none;
  margin-top: 4px;
}
.field.has-error input,
.field.has-error textarea,
.field.has-error select {
  border-color: var(--granate);
}
.field.has-error .field-error { display: block; }

/* ============ SUCCESS SCREEN ============ */
.quiz-success {
  display: none;
  text-align: center;
  padding: 80px var(--pad);
  max-width: 640px;
  margin: 0 auto;
}
.quiz-success.visible { display: block; }
.success-mark {
  width: 72px; height: 72px;
  background: var(--bronce);
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 32px;
  font-size: 32px;
}
.quiz-success h2 {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 0.9;
  text-transform: uppercase;
  color: var(--hueso);
  margin-bottom: 20px;
}
.quiz-success p {
  font-size: 17px;
  color: var(--hueso-dim);
  line-height: 1.6;
  margin-bottom: 40px;
}
.quiz-success .btn { padding: 22px 40px; font-size: 16px; }

/* ============ MOBILE ============ */
@media (max-width: 700px) {
  .quiz-body { padding: 40px var(--pad) 80px; }
  .field-row { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: 1fr 1fr; }
  .options.inline { flex-direction: column; }
  .resumen-row { flex-direction: column; gap: 4px; }
  .resumen-row .k { min-width: auto; }
}

/* ============ PRINT ============ */
@media print {
  body { background: #fff !important; color: #111 !important; }
  .quiz-progress, .quiz-nav, .wa-float { display: none !important; }
  .quiz-step { display: block !important; page-break-after: always; }
  .quiz-step:last-of-type { page-break-after: auto; }
  .photo-slot { border: 2px solid #ccc; }
  .option-btn { border-color: #ccc; color: #111; background: #f9f9f9; }
  .field input, .field textarea, .field select { background: #f9f9f9; color: #111; border-color: #ccc; }
  .nav { display: none !important; }
}
