/* ==========================================================================
   Custom HR & ATS — Frontend Encapsulated Styles (.hr-ats-*)
   Aislado frente a reglas globales de temas (button, input, table, a)
   ========================================================================== */

.hr-ats-portal,
.hr-ats-single-wrap,
.hr-ats-modal {
  --hr-ats-bg: #0b132b;
  --hr-ats-surface: #111b33;
  --hr-ats-surface-alt: #162246;
  --hr-ats-border: rgba(148, 163, 184, 0.2);
  --hr-ats-border-soft: rgba(148, 163, 184, 0.22);
  --hr-ats-cyan: #00d8f6;
  --hr-ats-orange: #ff7b00;
  --hr-ats-green: #10b981;
  --hr-ats-red: #f87171;
  --hr-ats-text: #f8fafc;
  --hr-ats-muted: #94a3b8;
  --hr-ats-radius: var(--az-radius-lg, 12px);
  --hr-ats-font: var(--az-font-body, 'Inter', system-ui, -apple-system, sans-serif);

  font-family: var(--hr-ats-font);
  color: var(--hr-ats-text);
  line-height: 1.55;
  box-sizing: border-box;
}

.hr-ats-portal *,
.hr-ats-portal *::before,
.hr-ats-portal *::after,
.hr-ats-single-wrap *,
.hr-ats-single-wrap *::before,
.hr-ats-single-wrap *::after,
.hr-ats-modal *,
.hr-ats-modal *::before,
.hr-ats-modal *::after {
  box-sizing: border-box;
}

.hr-ats-portal {
  width: 100%;
  background: var(--hr-ats-bg);
  border: 1px solid var(--hr-ats-border);
  border-radius: var(--hr-ats-radius);
  padding: clamp(20px, 3vw, 34px);
}

.hr-ats-single-wrap {
  width: 100%;
  background: #060913;
  padding: clamp(112px, 12vw, 138px) 16px 96px;
  min-height: 75vh;
}

.hr-ats-container {
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}

/* Header del portal */
.hr-ats-portal-header {
  margin-bottom: 24px;
}

.hr-ats-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hr-ats-cyan);
  margin-bottom: 6px;
}

.hr-ats-portal-title {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 2.6vw, 2.2rem);
  font-weight: 800;
  color: var(--hr-ats-text);
  line-height: 1.2;
}

.hr-ats-portal-subtitle {
  margin: 0;
  color: var(--hr-ats-muted);
  font-size: 15px;
}

/* Filtros */
.hr-ats-filters {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
  background: var(--hr-ats-surface);
  border: 1px solid var(--hr-ats-border-soft);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
}

.hr-ats-filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.hr-ats-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  margin: 0;
}

.hr-ats-req {
  color: var(--hr-ats-orange);
}

.hr-ats-portal .hr-ats-input,
.hr-ats-portal .hr-ats-select,
.hr-ats-single-wrap .hr-ats-input,
.hr-ats-single-wrap .hr-ats-select,
.hr-ats-modal .hr-ats-input,
.hr-ats-modal .hr-ats-select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--az-radius-md, 8px);
  border: 1px solid var(--hr-ats-border-soft);
  background: #080f24;
  color: var(--hr-ats-text);
  font-family: var(--hr-ats-font);
  font-size: 15px;
  line-height: 1.35;
  appearance: auto;
}

.hr-ats-portal .hr-ats-input:focus-visible,
.hr-ats-portal .hr-ats-select:focus-visible,
.hr-ats-single-wrap .hr-ats-input:focus-visible,
.hr-ats-single-wrap .hr-ats-select:focus-visible,
.hr-ats-modal .hr-ats-input:focus-visible,
.hr-ats-modal .hr-ats-select:focus-visible {
  border-color: var(--hr-ats-cyan);
  outline: 2px solid var(--hr-ats-cyan);
  outline-offset: 2px;
}

.hr-ats-file {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px dashed var(--hr-ats-border);
  background: #080f24;
  color: var(--hr-ats-text);
  font-size: 14px;
  cursor: pointer;
}

.hr-ats-file-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--hr-ats-muted);
}

/* Toolbar & Conteo */
.hr-ats-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.hr-ats-count {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--hr-ats-cyan);
}

/* Grid de tarjetas */
.hr-ats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

.hr-ats-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--hr-ats-surface);
  border: 1px solid var(--hr-ats-border-soft);
  border-radius: var(--hr-ats-radius);
  padding: 20px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.hr-ats-card:hover {
  border-color: var(--hr-ats-cyan);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
}

.hr-ats-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.hr-ats-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.14);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.hr-ats-badge--accent {
  background: rgba(0, 216, 246, 0.14);
  color: var(--hr-ats-cyan);
  border-color: rgba(0, 216, 246, 0.35);
}

.hr-ats-badge--open {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

.hr-ats-badge--closed {
  background: rgba(248, 113, 113, 0.15);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.35);
}

.hr-ats-card-title {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--hr-ats-text);
  line-height: 1.3;
}

.hr-ats-card-meta {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13.5px;
  color: #cbd5e1;
}

.hr-ats-card-excerpt {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--hr-ats-muted);
}

.hr-ats-card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--hr-ats-border-soft);
}

/* Botones encapsulados (neutralizan reglas globales de tema) */
.hr-ats-portal .hr-ats-btn,
.hr-ats-single-wrap .hr-ats-btn,
.hr-ats-modal .hr-ats-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 10px;
  font-family: var(--hr-ats-font);
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  line-height: 1.25;
  text-align: center;
}

.hr-ats-portal .hr-ats-btn--primary,
.hr-ats-single-wrap .hr-ats-btn--primary,
.hr-ats-modal .hr-ats-btn--primary {
  background: #00d8f6;
  color: #060913;
  box-shadow: 0 6px 18px -6px rgba(0, 216, 246, 0.3);
}

.hr-ats-portal .hr-ats-btn--primary:hover,
.hr-ats-single-wrap .hr-ats-btn--primary:hover,
.hr-ats-modal .hr-ats-btn--primary:hover {
  transform: translateY(-1px);
  background: #33e3fa;
  box-shadow: 0 10px 22px -8px rgba(0, 216, 246, 0.38);
  color: #060913;
}

.hr-ats-portal .hr-ats-btn--ghost,
.hr-ats-single-wrap .hr-ats-btn--ghost,
.hr-ats-modal .hr-ats-btn--ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--hr-ats-text);
  border-color: var(--hr-ats-border-soft);
}

.hr-ats-portal .hr-ats-btn--ghost:hover,
.hr-ats-single-wrap .hr-ats-btn--ghost:hover,
.hr-ats-modal .hr-ats-btn--ghost:hover {
  border-color: var(--hr-ats-cyan);
  color: var(--hr-ats-cyan);
}

.hr-ats-portal .hr-ats-btn--block,
.hr-ats-single-wrap .hr-ats-btn--block,
.hr-ats-modal .hr-ats-btn--block {
  width: 100%;
}

.hr-ats-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.hr-ats-link-inline {
  color: var(--hr-ats-cyan);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: underline;
}

/* Estados vacíos / carga */
.hr-ats-loading,
.hr-ats-empty {
  grid-column: 1 / -1;
  padding: 34px 20px;
  text-align: center;
  background: var(--hr-ats-surface);
  border: 1px dashed var(--hr-ats-border-soft);
  border-radius: 12px;
  color: var(--hr-ats-muted);
}

/* Single Vacante Layout */
.hr-ats-breadcrumb {
  margin-bottom: 18px;
}

.hr-ats-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--hr-ats-cyan);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}

.hr-ats-back-link:hover {
  text-decoration: underline;
}

.hr-ats-single-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr);
  gap: 24px;
  align-items: start;
}

/* Imagen opcional en tarjetas, modal y vista individual */
.hr-ats-card-media {
  margin-bottom: 14px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--hr-ats-border-soft);
  background: #080f24;
  aspect-ratio: 16 / 9;
}

.hr-ats-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hr-ats-cover {
  margin: 0 0 18px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--hr-ats-border-soft);
  background: #080f24;
  width: 100%;
  height: clamp(190px, 24vw, 280px);
}

.hr-ats-cover--modal {
  height: clamp(170px, 20vw, 220px);
  margin-top: 6px;
}

.hr-ats-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hr-ats-single-main,
.hr-ats-apply-card {
  background: var(--hr-ats-bg);
  border: 1px solid var(--hr-ats-border);
  border-radius: var(--hr-ats-radius);
  padding: clamp(20px, 3vw, 30px);
}

.hr-ats-single-title {
  margin: 0 0 18px;
  font-size: clamp(1.65rem, 2.8vw, 2.35rem);
  font-weight: 800;
  color: var(--hr-ats-text);
  line-height: 1.2;
}

.hr-ats-facts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.hr-ats-facts-grid--modal {
  margin: 14px 0 16px;
}

.hr-ats-fact {
  background: var(--hr-ats-surface);
  border: 1px solid var(--hr-ats-border-soft);
  border-radius: 10px;
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.hr-ats-fact-label {
  display: block;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--hr-ats-muted);
  margin-bottom: 4px;
}

.hr-ats-fact-value {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--hr-ats-text);
}

.hr-ats-fact-sub {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--hr-ats-cyan);
  font-weight: 600;
}

.hr-ats-subsection {
  margin-top: 20px;
}

.hr-ats-subsection:first-child {
  margin-top: 0;
}

.hr-ats-section-title {
  margin: 0 0 10px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--hr-ats-cyan);
}

.hr-ats-subsection-title {
  margin: 0 0 10px;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--hr-ats-text);
}

.hr-ats-bullet-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #cbd5e1;
  font-size: 15px;
  line-height: 1.55;
}

.hr-ats-bullet-list li {
  position: relative;
  padding-left: 18px;
}

.hr-ats-bullet-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hr-ats-cyan);
}

.hr-ats-offer-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 22px;
}

.hr-ats-offer-card {
  padding: 18px;
  border-radius: 12px;
}

.hr-ats-offer-card--comp {
  background: rgba(0, 216, 246, 0.08);
  border: 1px solid rgba(0, 216, 246, 0.28);
}

.hr-ats-offer-card--perks {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.hr-ats-salary-highlight {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--hr-ats-text);
  line-height: 1.25;
}

.hr-ats-salary-label {
  margin-top: 3px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--hr-ats-cyan);
}

.hr-ats-offer-copy {
  margin: 8px 0 0;
  font-size: 14.5px;
  color: #cbd5e1;
  line-height: 1.55;
}

.hr-ats-benefits-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px 18px;
  color: #d1fae5;
  font-size: 14.5px;
  line-height: 1.45;
}

.hr-ats-benefits-list--cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hr-ats-benefits-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.hr-ats-check {
  color: #34d399;
  font-weight: 800;
  flex-shrink: 0;
}

.hr-ats-prose {
  color: #cbd5e1;
  font-size: 15px;
  line-height: 1.7;
}

.hr-ats-prose p {
  margin: 0 0 12px;
}

.hr-ats-prose ul,
.hr-ats-prose ol {
  margin: 0 0 14px 20px;
  padding: 0;
}

.hr-ats-prose li {
  margin-bottom: 6px;
}

.hr-ats-legal-notice {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid var(--hr-ats-border-soft);
  font-size: 12.5px;
  color: var(--hr-ats-muted);
}

.hr-ats-legal-notice a {
  color: var(--hr-ats-cyan);
  text-decoration: underline;
}

/* Formulario */
.hr-ats-single-sidebar {
  position: sticky;
  top: 100px;
}

.hr-ats-apply-title {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--hr-ats-text);
}

.hr-ats-apply-subtitle {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--hr-ats-muted);
}

.hr-ats-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hr-ats-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hr-ats-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.hr-ats-privacy-box {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--hr-ats-surface);
  border: 1px solid var(--hr-ats-border-soft);
  font-size: 12.5px;
  color: #cbd5e1;
}

.hr-ats-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.hr-ats-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px !important;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--hr-ats-cyan);
}

.hr-ats-checkbox-label a {
  color: var(--hr-ats-cyan);
  text-decoration: underline;
}

.hr-ats-alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}

.hr-ats-alert--success {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #a7f3d0;
}

.hr-ats-alert--error {
  background: rgba(248, 113, 113, 0.16);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

.hr-ats-closed-notice h2 {
  margin: 0 0 8px;
  color: #fca5a5;
  font-size: 1.25rem;
}

.hr-ats-closed-notice p {
  margin: 0 0 16px;
  font-size: 14.5px;
  color: var(--hr-ats-muted);
}

/* Modal (encima de cualquier header o barra móvil del tema) */
.hr-ats-modal[hidden] {
  display: none !important;
}

.hr-ats-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.hr-ats-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 6, 16, 0.82);
  backdrop-filter: blur(6px);
}

.hr-ats-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 1040px;
  max-height: 90vh;
  background: var(--hr-ats-bg);
  border: 1px solid var(--hr-ats-border);
  border-radius: var(--az-radius-lg, 12px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hr-ats-modal .hr-ats-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--hr-ats-border-soft);
  color: var(--hr-ats-text);
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.hr-ats-modal .hr-ats-modal-close:hover {
  border-color: var(--hr-ats-cyan);
  color: var(--hr-ats-cyan);
}

.hr-ats-modal-scroll {
  overflow-y: auto;
  padding: clamp(20px, 3vw, 30px) 52px clamp(20px, 3vw, 30px) clamp(20px, 3vw, 30px);
}

.hr-ats-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(290px, 1fr);
  gap: 24px;
  align-items: start;
}

.hr-ats-modal-title {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
  font-weight: 800;
  color: var(--hr-ats-text);
  padding-right: 36px;
}

.hr-ats-modal-share {
  margin-bottom: 14px;
}

/* Responsive Breakpoints */
@media (max-width: 960px) {
  .hr-ats-filters {
    grid-template-columns: 1fr 1fr;
  }
  .hr-ats-filter-group--search {
    grid-column: 1 / -1;
  }
  .hr-ats-single-layout,
  .hr-ats-modal-grid {
    grid-template-columns: 1fr;
  }
  .hr-ats-modal-scroll {
    padding: 20px;
  }
  .hr-ats-modal-details .hr-ats-badges {
    padding-right: 44px;
  }
  .hr-ats-single-sidebar {
    position: static;
  }
}

@media (max-width: 640px) {
  .hr-ats-filters,
  .hr-ats-facts-grid,
  .hr-ats-benefits-list--cols {
    grid-template-columns: 1fr;
  }
  .hr-ats-portal .hr-ats-input,
  .hr-ats-portal .hr-ats-select,
  .hr-ats-single-wrap .hr-ats-input,
  .hr-ats-single-wrap .hr-ats-select,
  .hr-ats-modal .hr-ats-input,
  .hr-ats-modal .hr-ats-select {
    font-size: 16px;
    min-height: 48px;
  }
  .hr-ats-modal {
    padding: 8px;
  }
  .hr-ats-modal-dialog {
    max-height: 94vh;
  }
}

