/* Tu negocio, en acción — estilos
   Tokens tomados del archivo de Figma "sostenibilidad prototipo". */

:root {
  --green: #44746e;          /* títulos, radios, barra de avance */
  --lime: #baf575;           /* botón principal, píldora "Sí" */
  --ink: #15171c;            /* texto principal */
  --muted: #585e68;          /* texto secundario */
  --line: #d3d8df;           /* bordes, pasos pendientes */
  --bg: #ffffff;
  --selected: rgba(68, 116, 110, 0.07);
  --error: #b42318;

  --radius-card: 16px;
  --radius-field: 12px;
  --radius-pill: 999px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", system-ui,
          "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #eef0ee;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Contenedor de pantalla (390 × 844 en el diseño) ---------- */
.screen {
  min-height: 100%;
  max-width: 430px;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 48px;
  padding: calc(32px + env(safe-area-inset-top)) 24px calc(32px + env(safe-area-inset-bottom));
}

@media (min-width: 600px) {
  body { display: flex; align-items: center; justify-content: center; padding: 24px; }
  .screen {
    width: 390px;
    min-height: 844px;
    border-radius: 28px;
    box-shadow: 0 20px 60px rgba(21, 23, 28, 0.12);
  }
}

.content { flex: 1; display: flex; flex-direction: column; gap: 32px; }

/* ---------- Tipografía ---------- */
.overline {
  margin: 0;
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--green);
}

.question {
  margin: 0;
  font-size: 22px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--green);
  outline: none;
}

.title {
  margin: 0;
  font-size: 28px;
  line-height: 34px;
  font-weight: 700;
  letter-spacing: -0.6px;
  color: var(--green);
  outline: none;
}

.body { margin: 0; font-size: 15px; line-height: 22px; letter-spacing: -0.1px; color: var(--muted); }
.caption { margin: 0; font-size: 12px; line-height: 16px; color: var(--muted); }

/* ---------- Progreso ---------- */
.progress { display: flex; flex-direction: column; gap: 16px; }
.progress-info { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.progress-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.progress-bar span { height: 4px; border-radius: 8px; background: var(--line); transition: background .25s; }
.progress-bar span.done { background: var(--green); }

/* ---------- Enunciado ---------- */
.statement { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Opciones ---------- */
.options { display: flex; flex-direction: column; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.options legend { padding: 0; margin-bottom: 0; }

.option {
  border-radius: var(--radius-card);
  transition: background .2s;
}
.option.is-selected { background: var(--selected); }

.option-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 0 8px;
  cursor: pointer;
  font-size: 15px;
  line-height: 22px;
  letter-spacing: -0.1px;
}
.option.is-selected .option-row { font-weight: 600; }

.option-row input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1.5px solid var(--green);
  border-radius: 50%;
  display: grid;
  place-content: center;
  cursor: pointer;
}
.option-row input::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  transform: scale(0);
  transition: transform .15s ease-out;
}
.option-row input:checked::before { transform: scale(1); }
.option-row input:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }

/* Panel "Detalle": respuesta personalizada + zona de archivo */
.detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px 16px 40px;
}
.detail[hidden] { display: none; }

.field {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-field);
  background: var(--bg);
  font-size: 15px;
  line-height: 22px;
}
.field::placeholder { color: var(--muted); }
.field:focus { outline: none; border-color: var(--green); }

.drop {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1.5px dashed var(--green);
  border-radius: var(--radius-field);
  cursor: pointer;
  transition: background .15s;
}
.drop:hover, .drop.is-over { background: rgba(68, 116, 110, 0.08); }
.drop:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.drop svg { flex: none; }
.drop-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.drop-title { font-size: 15px; line-height: 22px; font-weight: 600; color: var(--green); }

.file-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  font-size: 13px;
}
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip button {
  border: 0;
  background: none;
  color: var(--green);
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}
.file-error { color: var(--error); }

/* ---------- Navegación y botones ---------- */
.nav { display: flex; flex-direction: column; gap: 8px; }
.actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.actions.end { justify-content: flex-end; }
.actions.split > * { flex: 1; }

.validation { color: var(--error); }
.validation[hidden] { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  border: 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.2px;
  cursor: pointer;
  transition: filter .15s, transform .05s;
}
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.btn-primary { background: var(--lime); color: var(--ink); min-width: 148px; }
.btn-primary:hover { filter: brightness(0.96); }
.btn-ghost { background: var(--bg); color: var(--ink); min-width: 112px; }
.btn-outline { background: var(--bg); color: var(--ink); border: 1.5px solid var(--ink); }
.btn-block { width: 100%; }

/* ---------- Pantalla de cuestionario completado ---------- */
.completed {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 32px;
  padding: 0 11px;
}
.completed .title { max-width: 285px; }
.completed img { width: 160px; height: auto; }
.completed .body { max-width: 320px; }

/* ---------- Resultado ---------- */
.result-head { display: flex; flex-direction: column; gap: 12px; }
.result-list { display: flex; flex-direction: column; }

.result-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.result-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.result-name { font-size: 15px; line-height: 22px; font-weight: 600; color: var(--green); }

.pill {
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 15px;
  line-height: 22px;
  font-weight: 600;
  white-space: nowrap;
}
.pill-si { background: var(--lime); color: var(--ink); }
.pill-mid { border: 1.5px solid var(--green); color: var(--green); }
.pill-no { background: var(--ink); color: #fff; }

.evidence {
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--selected);
  font-size: 12px;
  line-height: 16px;
  color: var(--ink);
  word-break: break-word;
}

.save-status { text-align: center; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.noscript { max-width: 390px; margin: 40px auto; padding: 0 24px; font-family: var(--font); }

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