:root {
  --ink: #1a1a1a;
  --navy: #222222;
  --brand: #8dc63f;
  --brand-light: #d4e6b5;
  --brand-dark: #5a8f1f;
  --paper: #ffffff;
  --mist: #f5f8f0;
  --line: #dde8d0;
  --muted: #5c6560;
  --shadow: 0 16px 38px rgba(26, 26, 26, 0.12);
  --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Inter, Arial, sans-serif; color: var(--ink); background: var(--mist); line-height: 1.6; }
body.modal-open { overflow: hidden; }
a { color: inherit; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.top-strip { background: var(--ink); color: #e8f4d4; font-size: 0.84rem; }
.top-strip-inner { min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 8px 0; }
.top-strip a { color: #fff; text-decoration: none; font-weight: 600; }
.navbar { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.nav-container { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 12px 22px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.brand-logo { height: 54px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; flex: 1 1 auto; justify-content: flex-end; max-width: 100%; min-width: 0; }
.nav-links > a { text-decoration: none; font-weight: 700; padding: 10px 12px; border-radius: 6px; white-space: nowrap; }
.nav-links > a:hover { color: var(--brand-dark); background: #e8f4d4; }

.nav-user-menu {
  position: relative;
  margin-left: 4px;
}
.nav-user-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.nav-user-menu__trigger:hover,
.nav-user-menu__trigger[aria-expanded="true"] {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(141, 198, 63, 0.18);
}
.nav-user-menu__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-light), #f0f7e4);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-user-menu__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.nav-user-menu__initials {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--brand-dark);
  letter-spacing: 0.02em;
}
.nav-user-menu__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}
.nav-user-menu__caret {
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1;
}
.nav-user-menu__dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 120;
  min-width: 180px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(26, 26, 26, 0.12);
}
.nav-user-menu__item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.nav-user-menu__item:hover {
  background: #e8f4d4;
  color: var(--brand-dark);
}
.nav-user-menu__item--danger:hover {
  background: #fdecea;
  color: #b42318;
}
.nav-user-menu__logout {
  margin: 0;
}
[x-cloak] { display: none !important; }
.nav-vacantes-highlight { background: var(--brand) !important; color: #fff !important; }
.nav-vacantes-highlight:hover { background: var(--brand-dark) !important; color: #fff !important; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 18px; border-radius: 6px; border: 1px solid transparent; font-weight: 800; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--brand); color: var(--ink); }
.btn-dark { background: var(--navy); color: #fff; }
.btn-secondary { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-sm { min-height: 36px; padding: 8px 14px; font-size: 0.9rem; }
.hero { background: linear-gradient(90deg, rgba(10,10,10,.94), rgba(26,26,26,.82)), url('https://images.unsplash.com/photo-1556761175-b413da4baf72?auto=format&fit=crop&w=1800&q=80') center/cover; color: #fff; padding: 80px 0 60px; }
.hero .hero-content { color: #fff; }
.hero .hero-content h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.05; margin-bottom: 16px; color: #fff; }
.hero .hero-content p { max-width: 640px; color: #e7f0f8; margin: 0 auto 24px; }
.hero .eyebrow { display: inline-block; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); margin-bottom: 12px; }
.hero .card { color: var(--ink); }
.hero .card h3 { color: var(--navy); }
.hero .card p { color: var(--muted); }
.hero .card label { color: var(--ink); }
.hero .card a:not(.btn) { color: var(--brand-dark); font-weight: 700; }
.hero .cards-grid { display: grid; gap: 18px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.05; margin-bottom: 16px; }
.hero p { max-width: 640px; color: #e7f0f8; margin-bottom: 24px; }
.section { padding: 60px 0; }
.section-title { font-size: 2rem; margin-bottom: 20px; color: var(--navy); }
.filters { display: grid; grid-template-columns: 2fr repeat(3, 1fr) auto; gap: 12px; margin-bottom: 24px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: 0 8px 20px rgba(13,31,51,.06); }
.card h3 { margin-bottom: 8px; }
.card .meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field { display: grid; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
label { font-size: 0.84rem; font-weight: 800; }
input, select, textarea { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #c9d6e3; border-radius: 6px; font: inherit; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(141,198,63,.2); }
.alert { padding: 12px 16px; border-radius: 6px; margin: 16px 0; }
.alert-success { background: #e8f4d4; border: 1px solid var(--brand-light); color: var(--brand-dark); }
.alert-error { background: #fde8e8; border: 1px solid #f5c2c2; color: #8b1e1e; }
.site-footer { background: var(--ink); color: #d8e5f1; padding: 36px 0; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; }
.site-footer a { color: #d8e5f1; display: block; margin-top: 6px; }
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; font-size: 0.92rem; }
.table th { background: var(--mist); font-weight: 800; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; background: var(--sky, #e8f4d4); color: var(--brand-dark); }
.wizard-section { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.wizard-section h2 { font-size: 1.2rem; margin-bottom: 16px; color: var(--navy); }

/* Terms / checkbox alignment */
.form-field--terms {
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}
.form-field--inline {
  margin-top: 0.35rem;
}
.terms-check {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-weight: 500;
  font-size: 0.92rem;
  line-height: 1.45;
  cursor: pointer;
  color: var(--ink);
}
.terms-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--brand);
  cursor: pointer;
}
.terms-check span {
  flex: 1;
}

/* Visor fijo 1:1 para imágenes de vacante (recorte centrado) */
.vacancy-media {
  display: block;
  width: 100%;
  max-width: 364px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 12px;
  background: #eef4e6;
}
.vacancy-media--centered {
  margin: 0 auto 1.5rem;
}
.vacancy-media--thumb {
  flex: 0 0 125px;
  width: 125px;
  max-width: 125px;
  height: 125px;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin: 0;
}
.vacancy-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.vacancy-home-card--with-image {
  display: flex;
  align-items: center;
  gap: 14px;
}
.vacancy-home-card-body {
  flex: 1;
  min-width: 0;
}

@media (max-width: 900px) {
  .vacancy-home-card--with-image {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .vacancy-media--thumb {
    flex: 0 0 auto;
    width: min(100%, 180px);
    max-width: 180px;
    height: auto;
    aspect-ratio: 1 / 1;
    align-self: center;
  }
  .vacancy-home-card-body {
    width: 100%;
  }
}

@media (max-width: 1120px) {
  /* Primero: logo encima; nav-links sigue en una sola fila */
  .nav-container { flex-direction: column; text-align: center; align-items: center; gap: 12px; flex-wrap: nowrap; }
  .brand { justify-content: center; width: 100%; }
  .brand-logo { height: 48px; }
  .nav-links { justify-content: center; width: 100%; flex: 0 1 auto; flex-wrap: nowrap; gap: 6px; }
  .nav-links > a { padding: 9px 10px; }
  .filters, .form-grid { grid-template-columns: 1fr; }
  .nav-user-menu__dropdown {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}

@media (max-width: 680px) {
  /* Solo en pantallas pequeñas: nav-links puede partirse en filas */
  .brand-logo { height: 44px; }
  .nav-links {
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
  }
  .nav-links > a {
    padding: 8px 8px;
    font-size: 0.9rem;
  }
  .nav-user-menu__name { max-width: 88px; }
}

/* ==== Ventana emergente de acceso (elegir perfil / ingresar / registrarse) ==== */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  overflow-y: auto;
  background: rgba(10, 10, 10, 0.68);
  backdrop-filter: blur(8px);
}
.auth-modal__dialog {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 64px);
  max-height: calc(100dvh - 64px);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: auto;
  padding: 28px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.auth-modal__dialog--wide { width: min(640px, 100%); }
/* Sticky para seguir visible cuando el contenido del modal se desplaza. */
.auth-modal__close {
  position: sticky;
  top: 0;
  z-index: 2;
  display: block;
  margin: 0 0 -34px auto;
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: #edf2f7;
  box-shadow: 0 0 0 6px #fff;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}
.auth-modal__close:hover { background: #e2e8f0; }
.auth-modal h3 {
  color: var(--navy);
  font-size: 1.5rem;
  line-height: 1.18;
  margin-bottom: 10px;
  padding-right: 34px;
}
.auth-modal__lead {
  color: var(--muted);
  margin-bottom: 18px;
}
.auth-modal--center { text-align: center; }
.auth-modal--center h3 { padding-left: 34px; }

.auth-modal__options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 8px;
}
.auth-modal__option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 18px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-align: center;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease, background 0.25s ease;
}
.auth-modal__option:hover {
  border-color: var(--brand);
  background: linear-gradient(180deg, #fbfff5 0%, #ffffff 100%);
  box-shadow: 0 14px 32px rgba(90, 143, 31, 0.16);
  transform: translateY(-3px);
}
.auth-modal__option-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  color: var(--brand-dark);
  background: linear-gradient(145deg, #eef8dc 0%, #d9efb0 100%);
  border: 1px solid rgba(141, 198, 63, 0.35);
  border-radius: 50%;
  box-shadow: 0 6px 16px rgba(90, 143, 31, 0.12);
}
.auth-modal__option-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.auth-modal__option strong {
  display: block;
  color: var(--navy);
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.auth-modal__option p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  margin-bottom: 16px;
}
.auth-modal__option-actions {
  width: 100%;
  display: grid;
  gap: 8px;
  margin-top: auto;
}
.auth-modal__option-actions .btn {
  width: 100%;
  min-height: 40px;
  font-size: 0.88rem;
}

.auth-modal__google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  background: #fff;
  color: #3c4043;
  font: inherit;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
}
.auth-modal__google:hover { background: #f8f9fa; border-color: #c6c8cc; }
.auth-modal__google svg { width: 18px; height: 18px; flex-shrink: 0; }

.auth-choice { width: 100%; }
.auth-choice__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  background: #fff;
  color: #3c4043;
  font: inherit;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
}
.auth-choice__toggle:hover { background: #f8f9fa; border-color: #c6c8cc; }
.auth-choice__toggle svg { width: 18px; height: 18px; flex-shrink: 0; color: #3c4043; }
.auth-choice__toggle svg[data-icon="mail"] path,
.auth-choice__option svg[data-icon="mail"] path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.auth-choice__row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}
.auth-choice__row:has(> :nth-child(1):last-child) { grid-template-columns: 1fr; }
.auth-choice__row:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@keyframes auth-choice-option-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.auth-choice__option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 64px;
  padding: 10px 6px;
  border: 1px solid #dadce0;
  border-radius: 6px;
  background: #fff;
  color: #3c4043;
  font: inherit;
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.2;
  cursor: pointer;
}
.auth-choice.is-expanded .auth-choice__option {
  animation: auth-choice-option-in 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.auth-choice.is-expanded .auth-choice__option:nth-child(1) { animation-delay: 0.04s; }
.auth-choice.is-expanded .auth-choice__option:nth-child(2) { animation-delay: 0.1s; }
.auth-choice.is-expanded .auth-choice__option:nth-child(3) { animation-delay: 0.16s; }
.auth-choice__option:hover { background: #f8f9fa; border-color: #c6c8cc; }
.auth-choice__option svg { width: 22px; height: 22px; flex-shrink: 0; color: #3c4043; }
@media (prefers-reduced-motion: reduce) {
  .auth-choice.is-expanded .auth-choice__option {
    animation: none;
  }
}
.auth-modal__success {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #b7e4c7;
  border-radius: 6px;
  background: #e9f7ef;
  color: #1b5e20;
  font-size: 0.88rem;
}

.auth-modal__divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.auth-modal__divider::before,
.auth-modal__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-modal__field { margin-bottom: 14px; }
.auth-modal__field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 0.9rem;
}
.auth-modal__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}
.auth-modal__check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  line-height: 1.45;
  cursor: pointer;
}
.auth-modal__check input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--brand);
}
.auth-modal__error {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #f5c2c2;
  border-radius: 6px;
  background: #fde8e8;
  color: #8b1e1e;
  font-size: 0.88rem;
}
.auth-modal__note {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--mist);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}
.auth-modal__link {
  border: 0;
  padding: 0;
  min-height: 0;
  background: transparent;
  color: var(--brand-dark);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
.auth-modal__submit {
  width: 100%;
  margin-top: 18px;
}
.auth-modal__back {
  display: block;
  width: fit-content;
  margin: 12px auto 0;
  padding: 0;
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
.auth-modal__back:hover { color: var(--brand-dark); }
.auth-modal__terms-box {
  max-height: 180px;
  overflow: auto;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
}
.auth-modal__actions {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.auth-modal__actions .btn { width: 100%; }

@media (max-width: 560px) {
  .auth-modal__dialog { padding: 22px 18px; }
  .auth-modal h3 { font-size: 1.25rem; }
  .auth-modal__options,
  .auth-modal__grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-modal__option { transition: none; }
  .auth-modal__option:hover { transform: none; }
}
