/* Pruebas Colfae — hoja de estilo unica. Light-first con dark via @media. */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #475569;
  --text-faint: #94a3b8;
  --primary: #d97706;        /* ambar Colfae */
  --primary-dark: #b45309;
  --primary-soft: #fef3c7;
  --accent: #0284c7;         /* azul para links/CTA secundaria */
  --success: #16a34a;
  --success-soft: #dcfce7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warning: #d97706;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 1px rgba(15,23,42,.04);
  --shadow-md: 0 4px 6px -1px rgba(15,23,42,.08), 0 2px 4px -2px rgba(15,23,42,.05);
  --shadow-lg: 0 10px 25px -5px rgba(15,23,42,.1), 0 8px 10px -6px rgba(15,23,42,.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-2: #0f172a;
    --border: #334155;
    --border-strong: #475569;
    --text: #f1f5f9;
    --text-muted: #cbd5e1;
    --text-faint: #64748b;
    --primary-soft: #78350f;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p  { margin: 0 0 .75em; }
hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.container { max-width: 820px; margin: 0 auto; padding: 1.25rem; }
.container.wide { max-width: 1200px; }

/* Header */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: .75rem;
}
.logo-mark {
  width: 36px; height: 36px; color: var(--primary); flex: none;
}
.app-header .brand {
  font-weight: 700; font-size: 1.05rem; color: var(--text);
}
.app-header .brand small { color: var(--text-muted); font-weight: 500; font-size: .8rem; display: block; }
.app-header .spacer { flex: 1; }

/* Hero */
.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}
.hero h1 { color: var(--text); }
.hero .lead { color: var(--text-muted); font-size: 1rem; margin-bottom: 0; }
.badge-row {
  display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 0;
}
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--primary-soft); color: var(--primary-dark);
  padding: .2rem .55rem; border-radius: 999px;
  font-size: .78rem; font-weight: 600;
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
}
.card h2 small { color: var(--text-muted); font-weight: 500; font-size: .85rem; display: block; margin-top: .25rem; }
.card .points { color: var(--text-faint); font-size: .8rem; font-weight: 600; }

/* Section header con progreso */
.section-hdr {
  display: flex; align-items: center; justify-content: space-between;
  margin: 2rem 0 .75rem; padding: .5rem 0;
  border-bottom: 2px solid var(--primary);
}
.section-hdr h2 { margin: 0; color: var(--primary-dark); font-size: 1.1rem; }
.section-hdr .count { color: var(--text-muted); font-size: .85rem; }

/* Form elements */
label.field { display: block; margin-bottom: 1rem; }
label.field > .lbl { display: block; font-weight: 600; margin-bottom: .35rem; color: var(--text); font-size: .9rem; }
label.field > .hint { display: block; color: var(--text-muted); font-size: .8rem; margin-bottom: .5rem; }
input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: .65rem .85rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea { resize: vertical; min-height: 90px; font-size: .95rem; }
input[type="file"] {
  width: 100%; padding: .5rem;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
  font-size: .9rem;
}
input[type="file"]:hover { border-color: var(--primary); }

/* Radio group (MC + V/F) */
.choices { display: flex; flex-direction: column; gap: .5rem; }
.choice {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .7rem .85rem;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .12s;
}
.choice:hover { border-color: var(--primary); background: var(--primary-soft); }
.choice input[type="radio"] { margin-top: .25rem; accent-color: var(--primary); flex: none; }
.choice.selected { border-color: var(--primary); background: var(--primary-soft); }
.choice span { color: var(--text); font-size: .95rem; line-height: 1.4; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600; font-size: .95rem;
  border: none; cursor: pointer;
  transition: all .15s;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }
.btn-primary:disabled { background: var(--text-faint); cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1.5px solid var(--border-strong); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary-dark); text-decoration: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; text-decoration: none; }

/* Autosave indicator */
.autosave {
  position: fixed; bottom: 1rem; right: 1rem;
  background: var(--surface); border: 1px solid var(--border);
  padding: .4rem .75rem; border-radius: 999px;
  font-size: .75rem; color: var(--text-muted);
  box-shadow: var(--shadow-md);
  opacity: 0; transition: opacity .3s;
  pointer-events: none;
}
.autosave.show { opacity: 1; }
.autosave.saved { color: var(--success); }

/* Toast / alerta */
.alert { padding: .9rem 1.1rem; border-radius: var(--radius); margin: 1rem 0; font-size: .9rem; }
.alert-info    { background: #e0f2fe; color: #075985; border-left: 4px solid #0284c7; }
.alert-warn    { background: #fef3c7; color: #78350f; border-left: 4px solid #d97706; }
.alert-success { background: var(--success-soft); color: #14532d; border-left: 4px solid var(--success); }
.alert-danger  { background: var(--danger-soft); color: #7f1d1d; border-left: 4px solid var(--danger); }
@media (prefers-color-scheme: dark) {
  .alert-info    { background: #0c4a6e; color: #bae6fd; }
  .alert-warn    { background: #78350f; color: #fde68a; }
  .alert-success { background: #14532d; color: #bbf7d0; }
  .alert-danger  { background: #7f1d1d; color: #fecaca; }
}

/* Video upload */
.video-field {
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.video-field .vhint { color: var(--text-muted); font-size: .82rem; margin-bottom: .5rem; }
.video-preview { margin-top: .75rem; max-width: 100%; border-radius: var(--radius); }

/* Progress bar superior */
.progress-wrap {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg); padding: .5rem 1rem;
  border-bottom: 1px solid var(--border);
}
.progress-bar {
  height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden;
}
.progress-bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  transition: width .3s;
}
.progress-text { font-size: .78rem; color: var(--text-muted); margin-top: .25rem; text-align: center; }

/* Footer */
.app-footer {
  text-align: center; padding: 2rem 1rem;
  color: var(--text-faint); font-size: .82rem;
}

/* Admin table */
table.data {
  width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin: 1rem 0;
}
table.data th, table.data td {
  padding: .65rem .85rem; text-align: left; border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
table.data thead { background: var(--surface-2); }
table.data th { font-weight: 600; color: var(--text-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--surface-2); }
.score-pill {
  display: inline-block; padding: .15rem .55rem; border-radius: 999px;
  font-size: .78rem; font-weight: 700;
}
.score-pill.ok { background: var(--success-soft); color: #14532d; }
.score-pill.mid { background: var(--primary-soft); color: var(--primary-dark); }
.score-pill.low { background: var(--danger-soft); color: #7f1d1d; }
.score-pill.pending { background: var(--surface-2); color: var(--text-muted); }

/* Admin detalle */
.ans-row {
  padding: 1rem 0; border-bottom: 1px solid var(--border);
}
.ans-row:last-child { border-bottom: none; }
.ans-row .qnum { color: var(--text-faint); font-size: .8rem; }
.ans-row .qtxt { font-weight: 600; margin: .25rem 0 .5rem; }
.ans-row .ans {
  background: var(--surface-2); border-left: 3px solid var(--primary);
  padding: .6rem .85rem; border-radius: 4px; margin: .5rem 0;
  white-space: pre-wrap; font-size: .95rem;
}
.ans-row .expected {
  background: var(--success-soft); border-left: 3px solid var(--success);
  padding: .6rem .85rem; border-radius: 4px; margin: .5rem 0;
  font-size: .9rem; color: #14532d;
}
.ans-row.correct { background: linear-gradient(90deg, var(--success-soft) 0, transparent 10%); padding-left: .5rem; margin-left: -.5rem; border-radius: var(--radius); }
.ans-row.wrong   { background: linear-gradient(90deg, var(--danger-soft) 0, transparent 10%); padding-left: .5rem; margin-left: -.5rem; border-radius: var(--radius); }
video.response-video { width: 100%; max-width: 640px; border-radius: var(--radius); background: #000; margin: .5rem 0; }

/* KPI tiles admin */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem; box-shadow: var(--shadow-sm);
}
.kpi .k-label { color: var(--text-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.kpi .k-value { font-size: 1.75rem; font-weight: 800; color: var(--text); margin-top: .25rem; letter-spacing: -.02em; }
.kpi .k-sub   { color: var(--text-faint); font-size: .78rem; margin-top: .2rem; }

/* Responsive */
@media (max-width: 640px) {
  .container { padding: 1rem; }
  h1 { font-size: 1.4rem; }
  .hero { padding: 1.25rem; }
  .card { padding: 1.1rem; }
}
