/* ============================================================
   Wallbit — Custom CSS para el Job Board de Ashby
   Alineado al Brandbook 2026 (ver skill /wallbit-brand)
   ============================================================

   NOTA SOBRE TIPOGRAFÍA:
   El brandbook pide Hardcover Var (serif, títulos) y Elza (sans,
   texto/UI), que son fuentes comerciales con licencia. Acá se usa
   Manrope (Google Fonts) para todo el job board — títulos y texto —
   diferenciando jerarquía solo con peso/tamaño, no con una familia
   distinta. Pesos usados como equivalentes: 800 ≈ Hardcover Var
   (títulos), 600 ≈ Elza Medium (subtítulos/botones), 400-500 ≈ Elza
   Regular (texto/UI).

   CÓMO FUNCIONA EL CAMBIO DE TEMA (listado vs. puesto individual):
   El listado de empleos usa el tema oscuro de marca: base casi negra
   (Dark Blue) con grises neutros para paneles/bordes, y el gradiente
   de marca muy contenido (vertical, luz entrando desde el borde
   superior e inferior) — el azul queda reservado para acentos
   puntuales (links, tab activo), no para teñir el fondo. Al entrar
   a un puesto puntual, Ashby renderiza
   .ashby-job-posting-heading dentro del mismo <body> (no hay iframe
   de por medio), así que usamos `body:has(...)` para detectar esa
   vista y activar un tema claro, replicando el tono de las landings
   de producto (tarjeta metálica / cambio de divisas): blanco sólido
   de la mitad de la página para arriba, y recién ahí aparece el
   gradiente de marca (#649AFF → tono grisáceo), muy sutil, pegado al
   borde inferior — así el header/hero no se siente "cortado" contra
   un blanco liso. Todos los colores de texto/superficie/borde/botón
   están armados como tokens semánticos (--wallbit-text-primary,
   --wallbit-surface-bg, etc.) que se re-definen una sola vez en ese
   selector: el resto de las reglas no necesita duplicarse por tema.
   :has() tiene soporte universal en navegadores evergreen desde
   2023, así que no hace falta fallback.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
  /* Paleta oficial Wallbit (Brandbook 2026) */
  --wallbit-dark-blue: #0A0B10;
  --wallbit-navy-blue: #090D1A;
  --wallbit-ice-blue: #AFD6F0;
  --wallbit-white: #FFFFFF;

  /* Tonos derivados para UI sobre fondo oscuro (hairlines, hover,
     paneles). Neutros (blanco a baja opacidad), no azulados — el
     listado tiene que leer negro/gris, no navy; el azul queda
     reservado para acentos puntuales (links, tab activo) */
  --wallbit-gray-50: rgba(255, 255, 255, 0.04);   /* fondo sutil de panel */
  --wallbit-gray-100: rgba(255, 255, 255, 0.07);  /* hover / hairline */
  --wallbit-gray-200: rgba(255, 255, 255, 0.12);  /* bordes */
  --wallbit-text-muted: rgba(255, 255, 255, 0.64);
  --wallbit-text-subtle: rgba(255, 255, 255, 0.44);

  /* Tonos derivados para UI sobre fondo blanco (detalle de puesto) */
  --wallbit-ink-50: rgba(10, 11, 16, 0.035);      /* panel sutil sobre blanco */
  --wallbit-ink-100: rgba(10, 11, 16, 0.08);      /* hover / hairline */
  --wallbit-ink-200: rgba(10, 11, 16, 0.14);      /* bordes */
  --wallbit-ink-muted: rgba(10, 11, 16, 0.64);
  --wallbit-ink-subtle: rgba(10, 11, 16, 0.46);
  /* Azul de marca (#649AFF) oscurecido para cumplir contraste AA como
     texto/link sobre blanco — el ice blue original (#AFD6F0) es
     demasiado claro para texto sobre fondo claro */
  --wallbit-ice-blue-deep: #3858B8;
  /* Navy aclarado, solo para el hover del botón oscuro sobre fondo claro */
  --wallbit-navy-700: #20232C;

  /* Gradiente de marca: #649AFF al 0% de opacidad → #A6B7B6 al 100%,
     pero con el azul muy contenido — el listado tiene que leer
     negro/gris casi neutro, con solo un dejo de luz, no un fondo
     azulado */
  --wallbit-gradient-dark-top: linear-gradient(
    180deg,
    rgba(100, 154, 255, 0.09) 0%,
    rgba(100, 154, 255, 0) 45%
  );
  --wallbit-gradient-dark-bottom: linear-gradient(
    0deg,
    rgba(166, 183, 182, 0.16) 0%,
    rgba(166, 183, 182, 0) 45%
  );
  /* Fondos claros: blanco sólido arriba, el gradiente de marca
     (#649AFF → tono grisáceo) recién aparece pegado al borde
     inferior — igual que en wallbit.com (cambio de divisas /
     tarjeta metálica), donde el header y la mitad de arriba quedan
     en blanco puro y el color entra suave desde abajo */
  --wallbit-gradient-light: linear-gradient(
    0deg,
    rgba(100, 154, 255, 0.16) 0%,
    rgba(100, 154, 255, 0.06) 22%,
    rgba(100, 154, 255, 0) 48%
  );

  /* Tipografía — Manrope en todo, la jerarquía la da el peso */
  --wallbit-font-heading: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --wallbit-font-body: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Radios: múltiplos de 6 por brandbook, salvo el CTA principal, que
     en las piezas de marca (ver screenshots de referencia) es pill */
  --wallbit-radius-sm: 6px;
  --wallbit-radius-md: 12px;
  --wallbit-radius-lg: 18px;
  --wallbit-radius-pill: 999px;

  /* ----------------------------------------------------------
     Tema por defecto: listado de empleos (oscuro, Gradiente 01)
     ---------------------------------------------------------- */
  --wallbit-surface-bg: var(--wallbit-dark-blue);
  --wallbit-surface-panel: var(--wallbit-gray-50);
  --wallbit-text-primary: var(--wallbit-white);
  --wallbit-text-secondary: var(--wallbit-text-muted);
  --wallbit-text-tertiary: var(--wallbit-text-subtle);
  --wallbit-border: var(--wallbit-gray-200);
  --wallbit-border-soft: var(--wallbit-gray-100);
  --wallbit-accent: var(--wallbit-ice-blue);
  --wallbit-accent-hover: var(--wallbit-white);
  --wallbit-input-bg: var(--wallbit-dark-blue);
  --wallbit-button-bg: var(--wallbit-ice-blue);
  --wallbit-button-text: var(--wallbit-dark-blue);
  --wallbit-button-bg-hover: var(--wallbit-white);

  --wallbit-bg-image: var(--wallbit-gradient-dark-top), var(--wallbit-gradient-dark-bottom);
  --wallbit-bg-position: top center, bottom center;
  --wallbit-bg-size: 100% 60vh, 100% 60vh;
}

/* ----------------------------------------------------------
   Tema de detalle: puesto individual (claro, Gradiente 02)
   Se activa apenas aparece el heading de la posición en el DOM.
   ---------------------------------------------------------- */
body:has(.ashby-job-posting-heading, .ashby-application-form-container) {
  --wallbit-surface-bg: var(--wallbit-white);
  /* Blanco sólido y opaco — no un tinte translúcido — para que el
     panel del formulario nunca deje ver el gradiente de abajo */
  --wallbit-surface-panel: var(--wallbit-white);
  --wallbit-text-primary: var(--wallbit-dark-blue);
  --wallbit-text-secondary: var(--wallbit-ink-muted);
  --wallbit-text-tertiary: var(--wallbit-ink-subtle);
  --wallbit-border: var(--wallbit-ink-200);
  --wallbit-border-soft: var(--wallbit-ink-100);
  --wallbit-accent: var(--wallbit-ice-blue-deep);
  --wallbit-accent-hover: var(--wallbit-dark-blue);
  --wallbit-input-bg: var(--wallbit-white);
  --wallbit-button-bg: var(--wallbit-dark-blue);
  --wallbit-button-text: var(--wallbit-white);
  --wallbit-button-bg-hover: var(--wallbit-navy-700);

  --wallbit-bg-image: var(--wallbit-gradient-light);
  --wallbit-bg-position: bottom center;
  --wallbit-bg-size: 100% 55vh;
}

/* ============================================================
   Base — fondo dominante + gradiente de marca según el tema activo
   ============================================================ */

body {
  background-color: var(--wallbit-surface-bg);
  background-image: var(--wallbit-bg-image);
  background-repeat: no-repeat;
  background-position: var(--wallbit-bg-position);
  background-size: var(--wallbit-bg-size);
  background-attachment: fixed;
  color: var(--wallbit-text-primary);
  font-family: var(--wallbit-font-body);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: var(--wallbit-accent);
  transition: color 0.15s ease;
}

a:hover {
  color: var(--wallbit-accent-hover);
}

::selection {
  background: var(--wallbit-border);
  color: var(--wallbit-text-primary);
}

/* ============================================================
   Listado de empleos
   ============================================================ */

.ashby-job-board-heading {
  font-family: var(--wallbit-font-heading);
  font-weight: 800;
  color: var(--wallbit-text-primary);
  letter-spacing: 0; /* brandbook: "siempre sentence case, tracking 0" */
}

.ashby-job-board-heading-count {
  font-family: var(--wallbit-font-body);
  color: var(--wallbit-text-secondary);
}

.ashby-job-board-filters-label {
  font-family: var(--wallbit-font-body);
  color: var(--wallbit-text-tertiary);
  /* brandbook: siempre sentence case, tracking 0 — se anula el
     uppercase/letter-spacing que trae el template por default */
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.ashby-job-board-filter {
  -webkit-appearance: none;
  appearance: none;
  background-color: var(--wallbit-input-bg) !important;
  border: 1px solid var(--wallbit-border) !important;
  border-radius: var(--wallbit-radius-sm) !important;
  color: var(--wallbit-text-primary) !important;
}

.ashby-job-board-filter option {
  background-color: var(--wallbit-surface-bg);
  color: var(--wallbit-text-primary);
}

.ashby-job-board-reset-filters-label {
  color: var(--wallbit-accent);
}

.ashby-job-board-reset-filters-label:hover {
  color: var(--wallbit-accent-hover);
}

.ashby-department-heading,
.ashby-job-posting-brief-department-heading {
  font-family: var(--wallbit-font-body);
  font-weight: 600;
  color: var(--wallbit-text-tertiary);
  /* brandbook: siempre sentence case, tracking 0 */
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.ashby-department-heading-level,
.ashby-job-posting-brief-department-heading-level {
  font-family: var(--wallbit-font-heading);
  font-weight: 700;
  color: var(--wallbit-text-primary);
}

.ashby-job-posting-brief-list {
  border-top: 1px solid var(--wallbit-border);
  background-color: transparent !important;
}

.ashby-job-posting-brief,
.ashby-job-posting-brief * {
  background-color: transparent !important;
}

.ashby-job-posting-brief {
  border-bottom: 1px solid var(--wallbit-border-soft) !important;
  transition: background-color 0.15s ease;
}

.ashby-job-posting-brief:hover {
  background-color: var(--wallbit-border-soft) !important;
}

.ashby-job-posting-brief-title {
  font-family: var(--wallbit-font-body);
  font-weight: 600;
  color: var(--wallbit-text-primary);
}

.ashby-job-posting-brief:hover .ashby-job-posting-brief-title {
  color: var(--wallbit-accent);
}

.ashby-job-posting-brief-details {
  color: var(--wallbit-text-secondary);
}

.ashby-job-board-back-to-all-jobs-button {
  border: 1px solid var(--wallbit-border);
  border-radius: var(--wallbit-radius-sm);
  color: var(--wallbit-text-primary);
  background-color: transparent;
}

.ashby-job-board-back-to-all-jobs-button:hover {
  border-color: var(--wallbit-accent);
  color: var(--wallbit-accent);
}

/* ============================================================
   Página de la posición individual
   ============================================================ */

.ashby-job-posting-heading {
  font-family: var(--wallbit-font-heading);
  font-weight: 800;
  color: var(--wallbit-text-primary);
}

.ashby-job-posting-left-pane {
  background-color: transparent !important;
  color: var(--wallbit-text-secondary);
  line-height: 1.65;
}

.ashby-job-posting-left-pane h1,
.ashby-job-posting-left-pane h2,
.ashby-job-posting-left-pane h3 {
  font-family: var(--wallbit-font-heading);
  color: var(--wallbit-text-primary);
  font-weight: 700;
}

.ashby-job-posting-right-pane {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.ashby-job-posting-right-pane > div {
  background-color: var(--wallbit-surface-panel) !important;
  border: 1px solid var(--wallbit-border) !important;
  border-radius: var(--wallbit-radius-lg) !important;
  box-shadow: none !important;
}

.ashby-job-posting-right-pane-overview-tab,
.ashby-job-posting-right-pane-application-tab {
  color: var(--wallbit-text-tertiary);
  font-weight: 500;
}

.ashby-job-posting-right-pane-overview-tab:hover,
.ashby-job-posting-right-pane-application-tab:hover,
.ashby-job-posting-right-pane-overview-tab[aria-selected="true"],
.ashby-job-posting-right-pane-application-tab[aria-selected="true"] {
  color: var(--wallbit-text-primary);
}

.ashby-job-posting-right-pane-tab-slider {
  background-color: var(--wallbit-accent);
  border-radius: 999px;
}

/* ============================================================
   Formulario de aplicación
   ============================================================ */

.ashby-application-form-container {
  background-color: transparent !important;
  box-shadow: none !important;
}

.ashby-application-form-section-container {
  border-top: 1px solid var(--wallbit-border-soft);
}

.ashby-application-form-section-header-title {
  font-family: var(--wallbit-font-heading);
  color: var(--wallbit-text-primary);
  font-weight: 700;
}

.ashby-application-form-section-header-description {
  color: var(--wallbit-text-tertiary);
}

.ashby-application-form-question-title {
  color: var(--wallbit-text-primary);
}

.ashby-application-form-question-description {
  color: var(--wallbit-text-tertiary);
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
  -webkit-appearance: none;
  appearance: none;
  background-color: var(--wallbit-input-bg) !important;
  border: 1px solid var(--wallbit-border) !important;
  border-radius: var(--wallbit-radius-sm);
  color: var(--wallbit-text-primary) !important;
  font-family: var(--wallbit-font-body);
}

input::placeholder,
textarea::placeholder {
  color: var(--wallbit-text-tertiary);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--wallbit-accent);
  box-shadow: 0 0 0 3px var(--wallbit-border-soft);
}

/* CTA principal — pill, como en las piezas de marca (tarjeta Visa /
   tarjeta metálica): bg e texto invierten según el tema activo */
.ashby-application-form-submit-button {
  background-color: var(--wallbit-button-bg);
  color: var(--wallbit-button-text);
  border: none;
  border-radius: var(--wallbit-radius-pill);
  font-family: var(--wallbit-font-body);
  font-weight: 600;
  transition: transform 0.1s ease, background-color 0.15s ease;
}

.ashby-application-form-submit-button:hover {
  background-color: var(--wallbit-button-bg-hover);
}

.ashby-application-form-submit-button:active {
  transform: scale(0.98);
}

.ashby-application-form-texting-consent-description {
  color: var(--wallbit-text-tertiary);
}

.ashby-application-form-success-container {
  background-color: var(--wallbit-surface-panel);
  border-left: 3px solid var(--wallbit-accent);
  color: var(--wallbit-text-primary);
}

.ashby-application-form-failure-container {
  background-color: rgba(255, 99, 99, 0.08);
  border-left: 3px solid #ff6363;
  color: var(--wallbit-text-primary);
}

/* ============================================================
   Autofill de currículum (dropzone)
   ============================================================ */

.ashby-application-form-autofill-input-root {
  background-color: var(--wallbit-surface-panel);
  border: 1px dashed var(--wallbit-border);
  border-radius: var(--wallbit-radius-md);
}

.ashby-application-form-autofill-input-drag-layer[data-state="active"] {
  border-color: var(--wallbit-accent);
  background-color: var(--wallbit-border-soft);
}

.ashby-application-form-autofill-input-icon {
  color: var(--wallbit-accent);
}

.ashby-application-form-autofill-input-title {
  color: var(--wallbit-text-primary);
  font-weight: 600;
}

.ashby-application-form-autofill-input-description {
  color: var(--wallbit-text-tertiary);
}

/* ============================================================
   Responsive — brandbook: mucho aire, nunca apretado
   ============================================================ */

@media (max-width: 640px) {
  .ashby-job-board-heading {
    font-size: 28px;
  }

  .ashby-job-posting-heading {
    font-size: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body,
  a,
  .ashby-job-posting-brief,
  .ashby-job-board-filter,
  .ashby-application-form-submit-button {
    transition: none;
  }
}
