/*
Theme Name: CITSolar Examen
Description: Plataforma de exámenes de certificación CITSolar (EC0586.01 y EC1181) construida 100% en código, sin plugins. Línea de diseño CLARA de CITSolar.
Author: BL4CKAPS
Version: 1.2.0
Text Domain: citsolar-examen
*/

:root {
  --red: #E40311;
  --red-dark: #B80009;
  --yellow: #FFC410;
  --amber: #F59E0B;
  --blue: #2D4BD8;
  --ink: #0F1629;
  --muted: #5A6478;
  --line: #E6E9F2;
  --green: #0E9F5D;
  --card: #FFFFFF;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: linear-gradient(150deg, #FFFFFF, #F5F7FC, #EEF2FB);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Barra superior de marca: rojo → ámbar → amarillo */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--red), var(--amber), var(--yellow));
  z-index: 50;
}

/* Glows suaves de la línea clara */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(560px 420px at 88% -5%, rgba(245, 158, 11, .16), transparent 65%),
    radial-gradient(640px 480px at -8% 105%, rgba(228, 3, 17, .10), transparent 65%);
  z-index: 0;
}

img { max-width: 100%; height: auto; }

.cit-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 54px 20px 44px;
  position: relative;
  z-index: 1;
}

.cit-contenedor {
  width: 100%;
  max-width: 880px;
  text-align: center;
}

.cit-logo { width: 168px; margin: 0 auto 20px; display: block; filter: drop-shadow(0 6px 18px rgba(15, 22, 41, .10)); }
.cit-logo-sm { width: 106px; margin: 0 auto 16px; display: block; }

/* Kicker de la línea clara: rojo, mayúsculas, con guion */
.cit-kicker {
  font-family: 'JetBrains Mono', 'Poppins', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 12px;
}
.cit-kicker::after { content: ' —'; }

h1.cit-titulo {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.022em;
  line-height: 1.22;
  margin-bottom: 10px;
}
h1.cit-titulo .hl { color: var(--red); }

.cit-sub {
  font-size: 15px;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 30px;
  line-height: 1.6;
}

/* Botones */
.cit-btn {
  display: inline-block;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 30px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
  box-shadow: 0 8px 20px rgba(228, 3, 17, .22);
}
.cit-btn:hover { background: var(--red-dark); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(228, 3, 17, .28); }
.cit-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.cit-btn-sec {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(15, 22, 41, .05);
}
.cit-btn-sec:hover { background: #F5F7FC; box-shadow: 0 4px 12px rgba(15, 22, 41, .08); }
.cit-btn-block { display: block; width: 100%; }

/* Inicio: tarjetas de examen */
.cit-grid-examenes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  text-align: left;
}
.cit-card-examen {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(15, 22, 41, .06);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease;
}
.cit-card-examen:hover { transform: translateY(-3px); box-shadow: 0 16px 38px rgba(15, 22, 41, .10); }
.cit-card-examen::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--red), var(--amber), var(--yellow));
}
.cit-card-codigo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 800;
  color: var(--red);
  letter-spacing: -.01em;
}
.cit-card-nombre { font-size: 15px; font-weight: 600; line-height: 1.45; }
.cit-card-meta { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.cit-card-examen .cit-btn { margin-top: auto; text-align: center; }

/* Formularios */
.cit-form { max-width: 560px; margin: 0 auto; text-align: left; }
.cit-form label { display: block; font-size: 14px; margin-bottom: 7px; font-weight: 600; }
.cit-form input[type=text],
.cit-form input[type=file] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  background: #fff;
  margin-bottom: 18px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.cit-form input[type=text]:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(228, 3, 17, .12);
}
.cit-form input[type=file] { padding: 11px 12px; color: var(--muted); }
.cit-form input[type=file]::file-selector-button {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
  background: rgba(228, 3, 17, .08);
  border: none;
  border-radius: 7px;
  padding: 8px 14px;
  margin-right: 12px;
  cursor: pointer;
}
.cit-nota { font-size: 13px; color: var(--muted); margin: -8px 0 20px; }
.cit-error {
  background: #FDECEC;
  border: 1px solid #F6C6C9;
  color: #A3131E;
  border-radius: 10px;
  padding: 11px 15px;
  font-size: 14px;
  margin-bottom: 18px;
}

/* Tarjeta principal */
.cit-tarjeta {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 36px 42px;
  text-align: left;
  box-shadow: 0 14px 40px rgba(15, 22, 41, .07);
  position: relative;
  overflow: hidden;
}
.cit-tarjeta::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--red), var(--amber), var(--yellow));
}

/* Encabezado y progreso del examen */
.cit-progreso { margin-bottom: 28px; }
.cit-progreso-texto {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}
#cit-prog-label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.01em;
}
#cit-prog-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.cit-progreso-barra { height: 8px; background: #EEF1F8; border-radius: 99px; overflow: hidden; }
.cit-progreso-relleno {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--red), var(--amber), var(--yellow));
  border-radius: 99px;
  transition: width .3s ease;
}

/* Pasos del quiz */
.cit-paso { display: none; }
.cit-paso.activo { display: block; animation: citFade .22s ease; }
@keyframes citFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.cit-paso-imgs { margin-bottom: 20px; }
.cit-paso-imgs img {
  max-width: 460px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: block;
  background: #fff;
  padding: 8px;
}

.cit-pregunta {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.014em;
  line-height: 1.45;
  margin-bottom: 20px;
}
.cit-pregunta .req { color: var(--red); }

.cit-opciones { display: flex; flex-direction: column; gap: 10px; }
.cit-opcion {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  background: #fff;
  transition: border-color .13s ease, background .13s ease, box-shadow .13s ease;
  font-size: 15px;
  line-height: 1.5;
}
.cit-opcion:hover { border-color: #C9CFDF; box-shadow: 0 3px 10px rgba(15, 22, 41, .06); }
.cit-opcion input { margin-top: 4px; accent-color: var(--red); flex: 0 0 auto; width: 16px; height: 16px; }
.cit-opcion.seleccionada {
  border-color: var(--red);
  background: #FFF6F6;
  box-shadow: 0 0 0 3px rgba(228, 3, 17, .10);
}
.cit-opcion img { max-width: 340px; border: 1px solid var(--line); border-radius: 8px; }

/* Opciones con imagen: chip de letra + imagen */
.cit-opcion-cuerpo { display: flex; align-items: flex-start; gap: 14px; }
.cit-opcion-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 800;
  color: var(--red);
  background: rgba(228, 3, 17, .08);
  border: 1px solid rgba(228, 3, 17, .18);
  border-radius: 8px;
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.cit-opcion.seleccionada .cit-opcion-chip { background: var(--red); color: #fff; }

/* Paso del nombre */
.cit-paso-nombre { max-width: 560px; margin: 6px auto 0; text-align: center; padding: 12px 0 6px; }
.cit-nombre-ayuda { font-size: 14px; color: var(--muted); margin: -8px 0 22px; line-height: 1.5; }
.cit-input-nombre {
  width: 100%;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: inherit;
  font-size: 17px;
  text-align: center;
  background: #fff;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.cit-input-nombre:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(228, 3, 17, .12);
}
.cit-nombre-datos {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 18px;
  letter-spacing: .02em;
}

.cit-nav { display: flex; gap: 12px; margin-top: 28px; justify-content: center; }

.cit-aviso-falta { color: var(--red); font-size: 14px; font-weight: 500; margin-top: 14px; display: none; }

/* Resultado */
.cit-resultado { text-align: center; padding: 18px 0 8px; }
.cit-resultado h2 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 4px; }
.cit-resultado h2 .hl { color: var(--red); }
.cit-score {
  font-family: 'JetBrains Mono', monospace;
  font-size: 58px;
  font-weight: 800;
  color: var(--red);
  letter-spacing: -.03em;
  margin: 20px 0 6px;
}
.cit-score-detalle {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  background: #FFF4CE;
  border: 1px solid #F5DE8E;
  border-radius: 99px;
  padding: 6px 16px;
  margin-bottom: 22px;
}
.cit-score-detalle.reprobado { background: #FDECEC; border-color: #F6C6C9; color: #A3131E; }
#cit-res-acciones { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cit-resultado p.cit-cierre {
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto;
}

.cit-ya-realizado {
  background: #FFF9E8;
  border: 1px solid #F5DE8E;
  border-radius: 12px;
  padding: 20px 24px;
  font-size: 15px;
  line-height: 1.6;
}

.cit-cargando { text-align: center; padding: 30px 0 10px; font-size: 15px; color: var(--muted); }
.cit-cargando::before {
  content: '';
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--red);
  border-radius: 50%;
  margin-right: 10px;
  vertical-align: -3px;
  animation: citGira .7s linear infinite;
}
@keyframes citGira { to { transform: rotate(360deg); } }

/* Pie de marca */
.cit-pie {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 0 20px 26px;
  position: relative;
  z-index: 1;
}
.cit-pie strong { color: var(--red); font-weight: 700; }

/* Responsive */
@media (max-width: 720px) {
  .cit-main { padding: 34px 14px 24px; }
  .cit-grid-examenes { grid-template-columns: 1fr; }
  .cit-tarjeta { padding: 26px 20px; }
  h1.cit-titulo { font-size: 25px; }
  .cit-pregunta { font-size: 16px; }
  .cit-nav { flex-direction: column-reverse; }
  .cit-nav .cit-btn { width: 100%; }
  .cit-score { font-size: 46px; }
}
