/* ══════════════════════════════════════════════════════════════
   ATS Express — TEMA A · SOBRIO  (por defecto)

   ADR-009: paleta MANSERCA obligatoria (#0022AA azul + #D9FF00 lima), pero
   con ejecución sobria — fondo neutro, tarjetas blancas, y la lima RESERVADA
   para acentos: botones CTA, badges de match y estados activos.

   Este archivo también es la BASE del tema expresivo: portal-expressive.css
   lo importa y sólo redefine tokens y superficies. Por eso toda la maquetación
   se expresa con variables — cambiar el tema no debe exigir tocar layout.
   ══════════════════════════════════════════════════════════════ */

:root {
  /* Marca */
  --blue:        #0022AA;
  --blue-dark:   #001A80;
  --blue-ink:    #0A1A5C;
  --lime:        #D9FF00;
  --lime-dark:   #C2E600;

  /* Superficies y texto */
  --bg:            #F5F6F8;
  --bg-alt:        #EDEFF3;
  --surface:       #FFFFFF;
  --surface-alt:   #FAFBFC;
  --surface-hover: #FFFFFF;
  --ink:           #111111;
  --ink-soft:      #2B3240;
  --muted:         #5B6472;
  --line:          #E3E6EC;
  --line-strong:   #CFD5DF;

  /* Texto sobre superficies de marca */
  --on-brand:    #FFFFFF;
  --on-lime:     #0A1A5C;

  /* Hero */
  --hero-bg:     linear-gradient(180deg, #FFFFFF 0%, var(--bg) 100%);
  --hero-ink:    var(--blue-ink);
  --hero-sub:    var(--muted);

  /* Efectos */
  --radius:      14px;
  --radius-sm:   10px;
  --radius-pill: 999px;
  --shadow-sm:   0 1px 2px rgba(16, 24, 40, .06);
  --shadow:      0 8px 24px rgba(16, 24, 40, .08);
  --shadow-lg:   0 24px 60px rgba(10, 26, 92, .18);
  --focus-ring:  0 0 0 3px rgba(0, 34, 170, .25);
  --blur:        none;
  --transition:  .18s cubic-bezier(.4, 0, .2, 1);

  /* Tipografía (ADR-009) */
  --font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-head: 'Fjalla One', 'Inter', sans-serif;

  /* Tipografía (ADR-009) */
  --font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-head: 'Fjalla One', 'Inter', sans-serif;

  --wrap: 1380px;
}

/* ── Reset ───────────────────────────────────────────────── */

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

[hidden] { display: none !important; }

/* ADR-044: el cliente pidió +4px de legibilidad en todo el portal. Toda la
   tipografía de este archivo está en `rem`, así que la subida se hace UNA vez
   en la raíz en lugar de tocar ~40 declaraciones. 125% del tamaño base del
   navegador (16px por defecto) = 20px, es decir los +4px pedidos; en % y no en
   px para no anular la preferencia de tamaño de fuente del usuario. */
html { scroll-behavior: smooth; font-size: 125%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.is-locked { overflow: hidden; }

h1, h2, h3 { font-family: var(--font-head); font-weight: 400; line-height: 1.15; letter-spacing: .01em; }

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

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }

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

/* ── Header ──────────────────────────────────────────────── */

.site-header {
  background: var(--blue);
  color: var(--on-brand);
  border-bottom: 4px solid var(--lime);
  padding: 8px 0;
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; min-height: 64px; flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 14px; }

/* ADR-044: logo oficial en lugar del avatar "M". Ajustado para encajar
   perfectamente en la barra de navegación sin desbordar ni verse gigante. */
.brand-logo {
  height: 44px !important;
  max-height: 44px !important;
  width: auto !important;
  max-width: 140px !important;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-family: var(--font-head); font-size: 1.35rem; letter-spacing: .04em; }
.brand-text small { font-size: .88rem; opacity: .85; }

.tagline { font-size: 1.05rem; opacity: .95; font-weight: 500; }

/* ── Hero + dropzone ─────────────────────────────────────── */

.hero { background: var(--hero-bg); padding: 64px 0 52px; }

.hero-inner { text-align: center; }

.hero h1 {
  color: var(--hero-ink);
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  margin-bottom: 16px;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(transparent 62%, var(--lime) 62%);
  padding: 0 .12em;
}

.hero-sub {
  color: var(--hero-sub);
  max-width: 780px; margin: 0 auto 36px;
  font-size: 1.2rem;
  line-height: 1.6;
}

.dropzone {
  background: var(--surface);
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  backdrop-filter: var(--blur);
  padding: 44px 32px;
  max-width: 760px; margin: 0 auto;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition),
              transform var(--transition), box-shadow var(--transition);
}

.dropzone:hover,
.dropzone:focus-visible { border-color: var(--blue); transform: translateY(-2px); box-shadow: var(--shadow); }

.dropzone.is-over {
  border-color: var(--blue);
  border-style: solid;
  background: var(--surface-hover);
  box-shadow: var(--shadow), inset 0 0 0 4px var(--lime);
}

.dropzone.is-busy { cursor: progress; opacity: .75; }

.dz-icon { display: block; font-size: 2.6rem; margin-bottom: 12px; }
.dz-title { font-family: var(--font-head); font-size: 1.55rem; color: var(--hero-ink); }
.dz-hint { color: var(--muted); font-size: 1.02rem; margin-top: 8px; }
.dz-link { color: var(--blue); text-decoration: underline; font-weight: 600; }

.dz-status {
  max-width: 760px; margin: 18px auto 0;
  font-size: 1rem; color: var(--muted);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--line);
}

.dz-status.is-ok    { border-left: 4px solid var(--lime); color: var(--ink-soft); }
.dz-status.is-error { border-left: 4px solid #C0392B; color: #8E2A20; background: #FDF3F2; }
.dz-status.is-busy  { border-left: 4px solid var(--blue); }
/* ADR-021: CV ilegible NO es un error del candidato — se ve informativo. */
.dz-status.is-info  { border-left: 4px solid var(--blue); color: var(--ink-soft); }

/* ── Sección de vacantes ─────────────────────────────────── */

.vacancies { padding: 52px 0 84px; }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; margin-bottom: 28px;
}

.section-head h2 { color: var(--hero-ink); font-size: 2.2rem; }
.section-sub { color: var(--muted); font-size: 1.05rem; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }

.chip {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  border-radius: var(--radius-pill);
  padding: 9px 18px;
  font-size: .95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.chip:hover { border-color: var(--blue); color: var(--blue); }

.chip.is-active {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--on-lime);
  font-weight: 700;
}

/* ── Tarjetas ────────────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  backdrop-filter: var(--blur);
  padding: 26px;
  transition: transform var(--transition), box-shadow var(--transition),
              border-color var(--transition);
}

.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }

.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-emoji { font-size: 2.2rem; line-height: 1; }

.card-title {
  color: var(--hero-ink);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 16px 0 8px;
  line-height: 1.3;
}

.card-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

/* Resumen estructurado de la tarjeta colapsada (ADR-019) */
.card-meta { display: grid; gap: 12px; margin-bottom: 22px; }
.card-meta > div { display: grid; gap: 3px; }

.card-meta dt {
  font-size: .82rem; font-weight: 700;
  color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
}

.card-meta dd { font-size: .98rem; color: var(--ink-soft); line-height: 1.5; }

.card-actions { margin-top: auto; display: flex; gap: 10px; }
.card-actions .btn { flex: 1; padding: 12px 16px; font-size: .95rem; }

/* Tarjeta resaltada por el auto-match del CV */
.card.is-match {
  border-color: var(--lime);
  box-shadow: var(--shadow), 0 0 0 2px var(--lime);
}

/* ── Vista Master-Detail (ADR-019) ───────────────────────── */

/* Sin .is-detail el contenedor no impone nada: el grid manda solo. */
.vacancy-view.is-detail {
  display: grid;
  grid-template-columns: 1fr 2fr;   /* 1/3 lista · 2/3 detalle */
  gap: 20px;
  align-items: start;
}

/* Columna izquierda: las otras 17 tarjetas, apiladas y compactas.
   Se hace sticky con scroll propio para poder saltar de cargo en cargo
   sin perder de vista el detalle. */
.is-detail .grid {
  grid-template-columns: 1fr;
  gap: 10px;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.is-detail .card { padding: 14px 16px; }
.is-detail .card-emoji { font-size: 1.4rem; }
.is-detail .card-title { font-size: 1rem; margin: 8px 0 8px; }
.is-detail .card-meta,
.is-detail .badge-slots,
.is-detail .card-btn-apply { display: none; }
.is-detail .card-btn-more { padding: 8px 12px; font-size: .82rem; }

.detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  backdrop-filter: var(--blur);
  padding: 26px;
}

.detail-head {
  display: flex; gap: 16px; align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}

.detail-emoji { font-size: 2.6rem; line-height: 1; }
.detail-head h3 { color: var(--hero-ink); font-size: 1.65rem; margin-bottom: 9px; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 7px; }

.detail-block { margin-bottom: 22px; }

.detail-block h4 {
  font-family: var(--font-head); font-weight: 400;
  color: var(--blue); font-size: 1.02rem;
  letter-spacing: .03em;
  margin-bottom: 10px;
  padding-left: 12px;
  border-left: 4px solid var(--lime);
}

.detail-block p { color: var(--ink-soft); font-size: .94rem; white-space: pre-line; }
.detail-block ul { list-style: none; display: grid; gap: 7px; }

.detail-block li {
  position: relative;
  padding-left: 20px;
  color: var(--ink-soft);
  font-size: .92rem;
}

.detail-block li::before {
  content: '▪';
  position: absolute; left: 4px;
  color: var(--lime); font-weight: 700;
}

.detail-foot {
  display: flex; gap: 10px; flex-wrap: wrap;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* ── Botones ─────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  padding: 11px 22px;
  font-size: .93rem; font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--blue); color: var(--on-brand); }
.btn-primary:hover:not(:disabled) { background: var(--blue-dark); }

/* La lima vive aquí: acción principal del portal (ADR-009). */
.btn-cta { background: var(--lime); color: var(--on-lime); }
.btn-cta:hover:not(:disabled) { background: var(--lime-dark); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line-strong);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }

.icon-btn {
  background: transparent; border: 0;
  font-size: 1.9rem; line-height: 1;
  color: var(--muted); cursor: pointer;
  padding: 0 6px; border-radius: var(--radius-sm);
  transition: color var(--transition);
}
.icon-btn:hover { color: var(--ink); }

/* ── Badges ──────────────────────────────────────────────── */

.badge {
  display: inline-block;
  border-radius: var(--radius-pill);
  padding: 4px 11px;
  font-size: .74rem; font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}

.badge-match   { background: var(--lime); color: var(--on-lime); }
.badge-slots   { background: var(--lime); color: var(--on-lime); }
.badge-segment { background: var(--bg-alt); color: var(--muted); font-weight: 600; }

/* ── Modal ───────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(10, 26, 92, .55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  backdrop-filter: var(--blur);
  width: 100%; max-width: 620px;
  margin: auto;
  overflow: hidden;
}

.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 { color: var(--hero-ink); font-size: 1.5rem; }

.eyebrow {
  color: var(--blue);
  font-size: .82rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: 4px;
}

/* Aviso de autocompletado (ADR-018) */
.prefill-note {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin: 16px 24px 0;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-left: 4px solid var(--lime);
  font-size: .86rem; color: var(--ink-soft);
}

.linkish {
  background: none; border: 0; padding: 0;
  color: var(--blue); font-size: .82rem; font-weight: 600;
  text-decoration: underline; cursor: pointer;
}

.linkish:hover { color: var(--blue-dark); }

/* Stepper */
.stepper {
  display: flex; gap: 6px;
  list-style: none;
  padding: 16px 24px 0;
}

.stepper li {
  flex: 1;
  display: flex; align-items: center; gap: 8px;
  font-size: .82rem; color: var(--muted);
  padding-bottom: 12px;
  border-bottom: 3px solid var(--line);
  transition: all var(--transition);
}

.stepper li span {
  display: grid; place-items: center;
  width: 24px; height: 24px; flex: 0 0 24px;
  border-radius: 50%;
  background: var(--bg-alt); color: var(--muted);
  font-size: .78rem; font-weight: 700;
}

.stepper li.is-active { color: var(--blue); font-weight: 600; border-bottom-color: var(--lime); }
.stepper li.is-active span { background: var(--blue); color: var(--on-brand); }

.stepper li.is-done { color: var(--ink-soft); border-bottom-color: var(--lime); }
.stepper li.is-done span { background: var(--lime); color: var(--on-lime); }

/* ── Campos del formulario ───────────────────────────────── */

form { padding: 20px 24px 0; }

fieldset { border: 0; display: flex; flex-direction: column; gap: 16px; }

.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row .field { flex: 1 1 180px; }
.row .field-narrow { flex: 0 0 92px; }
/* Tres desplegables necesitan más aire que un campo normal */
.row .field-dob { flex: 1.7 1 265px; }

.dob-row { display: flex; gap: 8px; }
/* `min-width: 0` evita que el ancho intrínseco del <select> (el texto del
   option más largo, "Septiembre") desborde la fila en pantallas estrechas. */
.dob-row select { flex: 1 1 0; min-width: 0; padding-left: 10px; padding-right: 4px; }
.dob-row #dob_month { flex: 1.45 1 0; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field label,
.label-as-text {
  font-size: .87rem; font-weight: 600; color: var(--ink-soft);
}

.req   { color: #C0392B; }
.bonus {
  background: var(--lime); color: var(--on-lime);
  font-size: .68rem; font-weight: 700;
  padding: 2px 7px; border-radius: var(--radius-pill);
  margin-left: 4px;
}

input[type="text"], input[type="tel"], input[type="email"],
input[type="date"], input[type="file"], select {
  background: var(--surface-alt);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: var(--focus-ring);
}

input:disabled, select:disabled { opacity: .6; cursor: not-allowed; }

input::placeholder { color: var(--muted); opacity: .7; }

input[type="file"] { padding: 9px 12px; cursor: pointer; }

.radios { display: flex; gap: 10px; flex-wrap: wrap; }

.radio {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: 9px 18px;
  font-size: .9rem; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.radio:hover { border-color: var(--blue); }
.radio:has(input:checked) { border-color: var(--blue); background: var(--surface); box-shadow: var(--focus-ring); }
.radio input { accent-color: var(--blue); width: 16px; height: 16px; cursor: pointer; }

.help { font-size: .8rem; color: var(--muted); }
.help-ok { color: var(--blue); font-weight: 600; }

.form-error {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #FDF3F2;
  border: 1px solid #F3C9C4;
  border-left: 4px solid #C0392B;
  color: #8E2A20;
  font-size: .88rem;
}

.modal-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 0 24px;
  border-top: 1px solid var(--line);
  margin-top: 22px;
}

.modal-foot .spacer { flex: 1; }

/* ── Pantalla de éxito ───────────────────────────────────── */

.success { padding: 34px 24px 30px; text-align: center; }
.success-icon { font-size: 2.6rem; display: block; margin-bottom: 10px; }
.success h3 { color: var(--hero-ink); font-size: 1.7rem; margin-bottom: 8px; }
.success-lead { color: var(--muted); font-size: .95rem; max-width: 440px; margin: 0 auto 22px; }

/* El código de postulación es el protagonista de esta pantalla: es lo único
   que el candidato tiene que recordar (ADR-017 / ADR-020). */
.code-label {
  font-size: .76rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); margin-top: 4px;
}

.app-code {
  display: inline-block;
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 6vw, 2.1rem);
  letter-spacing: .04em;
  background: var(--lime);
  color: var(--on-lime);
  padding: 9px 24px;
  border-radius: var(--radius-sm);
  margin: 8px 0 18px;
}

.success-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }

.empty-state {
  padding: 40px 20px; text-align: center;
  color: var(--muted);
  background: var(--surface-alt);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

/* ── Footer ──────────────────────────────────────────────── */

.site-footer {
  background: var(--blue-ink);
  color: var(--on-brand);
  padding: 28px 0;
  font-size: .88rem;
}

.site-footer .muted { opacity: .65; margin-top: 4px; }

/* ── Responsive ──────────────────────────────────────────── */

/* El Master-Detail 1/3-2/3 no cabe en pantallas estrechas: el detalle pasa
   arriba, a ancho completo, y la lista queda debajo. */
@media (max-width: 860px) {
  .vacancy-view.is-detail { grid-template-columns: 1fr; }
  .is-detail .detail { order: -1; }
  .is-detail .grid { position: static; max-height: none; overflow: visible; }
}

@media (max-width: 640px) {
  .header-inner { min-height: 64px; padding-top: 12px; padding-bottom: 12px; }
  .tagline { width: 100%; }
  .hero { padding: 36px 0 30px; }
  .dropzone { padding: 28px 18px; }
  .section-head { align-items: flex-start; }
  .grid { grid-template-columns: 1fr; }
  .stepper li { font-size: 0; gap: 0; justify-content: center; }
  .stepper li span { font-size: .78rem; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
