:root {
  --primary: #5C6484;
  --primary-dark: #454b68;
  --medium: #929AB4;
  --accent: #9ABFBE;
  --accent-dark: #5F8B89;
  --light1: #DCD8D3;
  --light2: #EAE8E5;
  --white: #FFFFFF;
  --text: #3A3A3A;
  --text-soft: #6b6f80;
  --danger: #b5473f;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(60, 60, 80, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--light2);
  color: var(--text);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  line-height: 1.5;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

header.top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

header.top img.logo {
  height: 48px;
  width: auto;
}

header.top img.logo-solo {
  height: 64px;
}

header.top .brandname {
  font-size: 22px;
  font-weight: bold;
  color: var(--primary);
}

h1 {
  font-size: 26px;
  color: var(--primary);
  margin: 0 0 8px;
}

p.lead {
  color: var(--text-soft);
  margin: 0 0 28px;
  font-size: 15px;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 24px;
}

.field { margin-bottom: 20px; }

.field label {
  display: block;
  font-weight: bold;
  font-size: 14px;
  color: var(--primary);
  margin-bottom: 6px;
}

.field .hint {
  font-size: 12.5px;
  color: var(--text-soft);
  margin-top: 5px;
}

input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--light1);
  border-radius: 9px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--medium);
}

textarea { resize: vertical; min-height: 130px; }

.tipo-toggle {
  display: flex;
  gap: 10px;
}

.tipo-toggle label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px;
  border: 1.5px solid var(--light1);
  border-radius: 9px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  color: var(--text-soft);
  transition: border-color .15s, color .15s, background .15s;
}

.tipo-toggle input { display: none; }

.tipo-toggle label.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--light2);
}

.input-modes {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.mode-btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--light1);
  background: var(--white);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}

.mode-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.mode-pane { display: none; }
.mode-pane.active { display: block; }

.file-drop {
  border: 2px dashed var(--light1);
  border-radius: 10px;
  padding: 26px;
  text-align: center;
  color: var(--text-soft);
  font-size: 14px;
  cursor: pointer;
  background: var(--light2);
}

.file-drop.has-file {
  border-color: var(--accent-dark);
  color: var(--accent-dark);
  background: #eef4f4;
  font-weight: bold;
}

.file-drop input { display: none; }

/* Lista de capturas de pantalla adjuntas (hasta 3) */
.file-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
}

.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--light2);
  border: 1px solid var(--light1);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 6px;
  font-size: 13.5px;
  color: var(--primary);
}

.file-list .nombre {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list .quitar {
  flex: none;
  border: none;
  background: none;
  color: var(--medium);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.file-list .quitar:hover { color: #b4453f; }

button.btn-primary {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: var(--white);
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
}

button.btn-primary:disabled {
  background: var(--medium);
  cursor: not-allowed;
}

button.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }

.error-box {
  background: #fbeceb;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 13px 15px;
  border-radius: 9px;
  font-size: 14px;
  margin-bottom: 18px;
  display: none;
}

.error-box.show { display: block; }

.loading {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 20px;
  color: var(--primary);
  font-weight: bold;
}

.loading.show { display: flex; }

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--light1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- resultado ---------- */

#resultado { display: none; }
#resultado.show { display: block; }

.result-header {
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 20px;
}

.result-header h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.result-header p { margin: 0; color: var(--light2); font-size: 14.5px; }

.focos {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}

.focos li {
  padding-left: 18px;
  position: relative;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--light2);
}

.focos li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.seccion-card {
  border-left: 4px solid var(--accent);
}

.seccion-card .seccion-titulo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.seccion-letra {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  flex-shrink: 0;
}

.seccion-titulo h3 {
  margin: 0;
  font-size: 17px;
  color: var(--primary);
}

.seccion-card .comentario { font-size: 14.5px; margin-bottom: 12px; }

.seccion-card .tip {
  background: var(--light2);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--text-soft);
  margin-bottom: 12px;
}

.seccion-card .tip strong { color: var(--primary); }

.seccion-card .formato-box,
.seccion-card .ejemplo-box {
  background: #f3f6f6;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13.5px;
  white-space: pre-wrap;
  margin-bottom: 10px;
}

.seccion-card .formato-box strong,
.seccion-card .ejemplo-box strong {
  display: block;
  color: var(--accent-dark);
  margin-bottom: 5px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.palabras-clave {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.palabras-clave span {
  background: var(--light2);
  color: var(--primary);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: bold;
}

.pasos-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pasos-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--light2);
  font-size: 14.5px;
}

.pasos-list li:last-child { border-bottom: none; }

.pasos-list li::before {
  content: "☐";
  color: var(--accent-dark);
  font-size: 17px;
  flex-shrink: 0;
}

.btn-secondary {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 9px;
  background: var(--white);
  border: 1.5px solid var(--primary);
  color: var(--primary);
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}

footer.site {
  text-align: center;
  color: var(--text-soft);
  font-size: 12.5px;
  margin-top: 40px;
}

footer.site a { color: var(--accent-dark); }

/* ---------- admin ---------- */

.admin-login {
  max-width: 380px;
  margin: 90px auto;
}

table.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.admin-table th {
  text-align: left;
  background: var(--primary);
  color: var(--white);
  padding: 10px 12px;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

table.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--light2);
  vertical-align: top;
}

table.admin-table tr:hover { background: var(--light2); }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: bold;
}

.badge.linkedin { background: #e4e7f0; color: var(--primary); }
.badge.hoja_de_vida { background: #e6efee; color: var(--accent-dark); }

.btn-ver {
  background: none;
  border: 1px solid var(--medium);
  color: var(--primary);
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30, 30, 40, 0.55);
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 50;
}

.modal-overlay.show { display: flex; }

.modal-box {
  background: var(--white);
  border-radius: var(--radius);
  max-width: 760px;
  width: 100%;
  padding: 30px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-soft);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 10px;
}

.stat-row {
  display: flex;
  gap: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.stat-tile {
  background: var(--white);
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: var(--shadow);
  min-width: 130px;
}

.stat-tile .num { font-size: 24px; font-weight: bold; color: var(--primary); }
.stat-tile .label { font-size: 12px; color: var(--text-soft); }

.table-wrap { overflow-x: auto; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }

@media (max-width: 600px) {
  .wrap { padding: 20px 14px 60px; }
  .card { padding: 20px; }
}

/* Estado de cada revisión en el panel de trazabilidad */
.badge-estado {
  display: inline-block;
  font-size: 11px;
  font-weight: bold;
  border-radius: 20px;
  padding: 2px 8px;
  margin-left: 4px;
  white-space: nowrap;
}

.badge-estado.procesando {
  background: #eef4f4;
  color: var(--accent-dark);
}

.badge-estado.error {
  background: #fbeceb;
  color: #b4453f;
}

/* Distintivo de versión junto al logo */
header.top .version {
  font-size: 12px;
  font-weight: bold;
  color: var(--medium);
  border: 1.5px solid var(--light1);
  border-radius: 999px;
  padding: 2px 9px;
  letter-spacing: 0.4px;
  align-self: center;
}

/* Autorización de tratamiento de datos (habeas data) */
.consentimiento {
  border-top: 1px solid var(--light1);
  padding-top: 18px;
}

.check-linea {
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  margin-bottom: 8px;
}

.check-linea input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin: 1px 0 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.check-linea span {
  font-weight: bold;
  font-size: 14px;
  color: var(--primary);
}

.texto-legal {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-soft);
  background: var(--light2);
  border-radius: 8px;
  padding: 12px 14px;
}

.texto-legal a { color: var(--accent-dark); }
