/* ============================================================
   PORTAL EMPLEO — Design System
   Paleta: Azul corporativo + Verde acción + Fondo claro
   ============================================================ */

:root {
  /* Primary — Azul corporativo */
  --pe-primary:        #1A56DB;
  --pe-primary-dark:   #1346C5;
  --pe-primary-light:  #EBF0FD;
  --pe-primary-rgb:    26, 86, 219;

  /* Success — Verde acción */
  --pe-success:        #0E9F6E;
  --pe-success-dark:   #057A55;
  --pe-success-light:  #E3FCEF;

  /* Neutrals */
  --pe-gray-50:   #F9FAFB;
  --pe-gray-100:  #F3F4F6;
  --pe-gray-200:  #E5E7EB;
  --pe-gray-300:  #D1D5DB;
  --pe-gray-400:  #9CA3AF;
  --pe-gray-500:  #6B7280;
  --pe-gray-600:  #4B5563;
  --pe-gray-700:  #374151;
  --pe-gray-800:  #1F2937;
  --pe-gray-900:  #111827;

  /* Accent */
  --pe-orange: #FF7C29;
  --pe-purple: #7C3AED;

  /* Shadows */
  --pe-shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --pe-shadow:     0 4px 12px rgba(0,0,0,.10);
  --pe-shadow-lg:  0 10px 30px rgba(0,0,0,.12);
  --pe-shadow-xl:  0 20px 60px rgba(0,0,0,.14);

  /* Radius */
  --pe-radius-sm: 6px;
  --pe-radius:    10px;
  --pe-radius-lg: 16px;
  --pe-radius-xl: 24px;

  /* Transition */
  --pe-transition: .2s ease;
}

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--pe-gray-50);
  color: var(--pe-gray-800);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--pe-primary); text-decoration: none; transition: color var(--pe-transition); }
a:hover { color: var(--pe-primary-dark); }

img { max-width: 100%; height: auto; }

/* ── Bootstrap overrides ─────────────────────────────────── */
.btn-primary {
  background: var(--pe-primary);
  border-color: var(--pe-primary);
  font-weight: 500;
  border-radius: var(--pe-radius-sm);
  padding: .5rem 1.25rem;
  transition: background var(--pe-transition), box-shadow var(--pe-transition), transform var(--pe-transition);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--pe-primary-dark);
  border-color: var(--pe-primary-dark);
  box-shadow: 0 4px 14px rgba(var(--pe-primary-rgb), .35);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-success {
  background: var(--pe-success);
  border-color: var(--pe-success);
  font-weight: 500;
}
.btn-success:hover { background: var(--pe-success-dark); border-color: var(--pe-success-dark); }

.btn-outline-primary {
  color: var(--pe-primary);
  border-color: var(--pe-primary);
  font-weight: 500;
  border-radius: var(--pe-radius-sm);
}
.btn-outline-primary:hover {
  background: var(--pe-primary);
  border-color: var(--pe-primary);
}

.btn-lg { padding: .75rem 2rem; font-size: 1rem; border-radius: var(--pe-radius); }

.form-control, .form-select {
  border: 1.5px solid var(--pe-gray-200);
  border-radius: var(--pe-radius-sm);
  padding: .6rem .9rem;
  font-size: .925rem;
  transition: border-color var(--pe-transition), box-shadow var(--pe-transition);
  background: #fff;
}
.form-control:focus, .form-select:focus {
  border-color: var(--pe-primary);
  box-shadow: 0 0 0 3px rgba(var(--pe-primary-rgb), .15);
  outline: none;
}
.form-control.is-invalid, .form-select.is-invalid {
  border-color: #dc3545;
}
.form-label { font-weight: 500; font-size: .9rem; color: var(--pe-gray-700); margin-bottom: .3rem; }

.card {
  border: 1px solid var(--pe-gray-200);
  border-radius: var(--pe-radius-lg);
  box-shadow: var(--pe-shadow-sm);
  background: #fff;
  transition: box-shadow var(--pe-transition), transform var(--pe-transition);
}
.card:hover { box-shadow: var(--pe-shadow); }
.card-body { padding: 1.5rem; }

.badge {
  font-weight: 500;
  font-size: .75rem;
  padding: .3em .65em;
  border-radius: 50px;
}

/* ── Navbar ──────────────────────────────────────────────── */
.pe-navbar {
  background: #fff;
  border-bottom: 1px solid var(--pe-gray-200);
  padding: .75rem 0;
  position: sticky;
  top: 0;
  z-index: 1020;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}

.pe-navbar .navbar-brand {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--pe-primary);
  letter-spacing: -.5px;
}
.pe-navbar .navbar-brand span { color: var(--pe-success); }

.pe-navbar .nav-link {
  color: var(--pe-gray-600) !important;
  font-weight: 500;
  font-size: .9rem;
  padding: .4rem .75rem !important;
  border-radius: var(--pe-radius-sm);
  transition: color var(--pe-transition), background var(--pe-transition);
}
.pe-navbar .nav-link:hover,
.pe-navbar .nav-link.active {
  color: var(--pe-primary) !important;
  background: var(--pe-primary-light);
}

.pe-navbar .btn-sm { font-size: .85rem; padding: .4rem 1rem; }

/* ── Hero Section ────────────────────────────────────────── */
.pe-hero {
  background: linear-gradient(135deg, #0F2B6B 0%, #1A56DB 60%, #2563EB 100%);
  color: #fff;
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.pe-hero::before {
  content: '';
  position: absolute;
  top: -50%; right: -10%;
  width: 600px; height: 600px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
}
.pe-hero::after {
  content: '';
  position: absolute;
  bottom: -30%; left: -5%;
  width: 400px; height: 400px;
  background: rgba(255,255,255,.03);
  border-radius: 50%;
}

.pe-hero h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.5px;
}
.pe-hero .lead { font-size: 1.1rem; opacity: .9; }

/* Search bar in hero */
.pe-search-bar {
  background: #fff;
  border-radius: var(--pe-radius-xl);
  padding: .5rem .5rem .5rem 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  box-shadow: var(--pe-shadow-xl);
}
.pe-search-bar .form-control {
  border: none;
  background: transparent;
  font-size: 1rem;
  padding: .5rem .25rem;
}
.pe-search-bar .form-control:focus { box-shadow: none; }
.pe-search-bar .divider {
  width: 1px;
  height: 28px;
  background: var(--pe-gray-200);
  flex-shrink: 0;
}
.pe-search-bar .btn {
  border-radius: var(--pe-radius-lg) !important;
  padding: .65rem 1.75rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Search tags */
.pe-search-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.pe-search-tags span {
  font-size: .8rem;
  opacity: .75;
}
.pe-search-tags a {
  color: rgba(255,255,255,.85);
  font-size: .8rem;
  background: rgba(255,255,255,.12);
  padding: .2rem .6rem;
  border-radius: 50px;
  transition: background var(--pe-transition);
}
.pe-search-tags a:hover { background: rgba(255,255,255,.25); }

/* ── Stats bar ───────────────────────────────────────────── */
.pe-stats-bar {
  background: #fff;
  border-bottom: 1px solid var(--pe-gray-200);
  padding: .75rem 0;
}
.pe-stats-bar .stat-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .875rem;
  color: var(--pe-gray-600);
}
.pe-stats-bar .stat-item strong { color: var(--pe-primary); font-weight: 700; }

/* ── Section titles ──────────────────────────────────────── */
.pe-section { padding: 4rem 0; }
.pe-section-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--pe-gray-900);
  letter-spacing: -.3px;
}
.pe-section-subtitle { color: var(--pe-gray-500); font-size: 1rem; margin-top: .25rem; }

/* ── Job Card ────────────────────────────────────────────── */
.job-card {
  background: #fff;
  border: 1.5px solid var(--pe-gray-200);
  border-radius: var(--pe-radius-lg);
  padding: 1.25rem 1.5rem;
  transition: border-color var(--pe-transition), box-shadow var(--pe-transition), transform var(--pe-transition);
  cursor: pointer;
  position: relative;
}
.job-card:hover {
  border-color: var(--pe-primary);
  box-shadow: var(--pe-shadow);
  transform: translateY(-2px);
}
.job-card.featured {
  border-color: var(--pe-orange);
  background: linear-gradient(135deg, #fff 0%, #FFF8F0 100%);
}
.job-card.featured::before {
  content: '⭐ Destacada';
  position: absolute;
  top: -1px; right: 16px;
  background: var(--pe-orange);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: .15rem .6rem;
  border-radius: 0 0 6px 6px;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.job-card .company-logo {
  width: 52px; height: 52px;
  border-radius: var(--pe-radius);
  object-fit: cover;
  border: 1px solid var(--pe-gray-200);
  flex-shrink: 0;
}
.job-card .company-logo-placeholder {
  width: 52px; height: 52px;
  border-radius: var(--pe-radius);
  background: var(--pe-primary-light);
  color: var(--pe-primary);
  font-weight: 800;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.job-card .job-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--pe-gray-900);
  margin: 0 0 .2rem;
  line-height: 1.3;
}
.job-card .job-title a { color: inherit; }
.job-card .job-title a:hover { color: var(--pe-primary); }
.job-card .company-name { font-size: .875rem; color: var(--pe-gray-500); font-weight: 500; }
.job-card .job-meta {
  display: flex; flex-wrap: wrap; gap: .4rem;
  margin-top: .6rem;
}
.job-card .job-meta .badge {
  background: var(--pe-gray-100);
  color: var(--pe-gray-600);
  border: 1px solid var(--pe-gray-200);
}
.job-card .job-meta .badge.remote  { background: var(--pe-success-light); color: var(--pe-success-dark); border-color: transparent; }
.job-card .job-meta .badge.hybrid  { background: #EDE9FE; color: #5B21B6; border-color: transparent; }
.job-card .job-salary { font-size: .875rem; color: var(--pe-success-dark); font-weight: 600; }
.job-card .job-time   { font-size: .78rem; color: var(--pe-gray-400); }

/* Match score pill */
.match-score {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .8rem;
  font-weight: 700;
  padding: .25rem .6rem;
  border-radius: 50px;
}
.match-score.high   { background: var(--pe-success-light); color: var(--pe-success-dark); }
.match-score.medium { background: #FFF3CD; color: #856404; }
.match-score.low    { background: var(--pe-gray-100); color: var(--pe-gray-500); }

/* ── Category Pills ──────────────────────────────────────── */
.category-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: 1.25rem 1rem;
  background: #fff;
  border: 1.5px solid var(--pe-gray-200);
  border-radius: var(--pe-radius-lg);
  text-align: center;
  font-size: .85rem;
  font-weight: 600;
  color: var(--pe-gray-700);
  transition: all var(--pe-transition);
  cursor: pointer;
}
.category-pill:hover, .category-pill.active {
  background: var(--pe-primary-light);
  border-color: var(--pe-primary);
  color: var(--pe-primary);
}
.category-pill .icon {
  font-size: 1.5rem;
  color: var(--pe-primary);
}

/* ── Company Card ────────────────────────────────────────── */
.company-card {
  background: #fff;
  border: 1.5px solid var(--pe-gray-200);
  border-radius: var(--pe-radius-lg);
  padding: 1.5rem;
  text-align: center;
  transition: all var(--pe-transition);
}
.company-card:hover {
  border-color: var(--pe-primary);
  box-shadow: var(--pe-shadow);
  transform: translateY(-2px);
}
.company-card .logo {
  width: 70px; height: 70px;
  border-radius: var(--pe-radius);
  object-fit: cover;
  margin: 0 auto .75rem;
  border: 1px solid var(--pe-gray-200);
}
.company-card .name  { font-weight: 700; color: var(--pe-gray-900); }
.company-card .jobs  { font-size: .875rem; color: var(--pe-primary); font-weight: 600; }

/* ── Page header ─────────────────────────────────────────── */
.pe-page-header {
  background: #fff;
  border-bottom: 1px solid var(--pe-gray-200);
  padding: 2rem 0;
}
.pe-page-header h1 { font-size: 1.75rem; font-weight: 800; }

/* ── Sidebar filters ─────────────────────────────────────── */
.pe-filter-sidebar {
  background: #fff;
  border: 1px solid var(--pe-gray-200);
  border-radius: var(--pe-radius-lg);
  padding: 1.25rem;
  position: sticky;
  top: 80px;
}
.pe-filter-sidebar h3 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--pe-gray-800);
  margin-bottom: 1rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--pe-gray-200);
}
.pe-filter-group { margin-bottom: 1.25rem; }
.pe-filter-group label.filter-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--pe-gray-500);
  display: block;
  margin-bottom: .5rem;
}

/* ── Auth layout ─────────────────────────────────────────── */
.pe-auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--pe-primary-light) 0%, #fff 100%);
}
.pe-auth-card {
  background: #fff;
  border-radius: var(--pe-radius-xl);
  box-shadow: var(--pe-shadow-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 480px;
  margin: 2rem auto;
}
.pe-auth-card .logo-brand {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--pe-primary);
  text-align: center;
  display: block;
  margin-bottom: 1.75rem;
}
.pe-auth-card .logo-brand span { color: var(--pe-success); }
.pe-auth-card h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: .25rem; }
.pe-auth-card .subtitle { color: var(--pe-gray-500); font-size: .9rem; margin-bottom: 1.75rem; }

.pe-auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.25rem 0;
  color: var(--pe-gray-400);
  font-size: .85rem;
}
.pe-auth-divider::before,
.pe-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--pe-gray-200);
}

/* ── Dashboard layout ────────────────────────────────────── */
.pe-dashboard {
  display: flex;
  min-height: calc(100vh - 65px);
}
.pe-sidebar {
  width: 260px;
  background: #fff;
  border-right: 1px solid var(--pe-gray-200);
  padding: 1.5rem 0;
  flex-shrink: 0;
  position: sticky;
  top: 65px;
  height: calc(100vh - 65px);
  overflow-y: auto;
}
.pe-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem 1.25rem;
  color: var(--pe-gray-600);
  font-size: .9rem;
  font-weight: 500;
  border-radius: 0;
  transition: all var(--pe-transition);
}
.pe-sidebar .nav-link:hover, .pe-sidebar .nav-link.active {
  color: var(--pe-primary);
  background: var(--pe-primary-light);
}
.pe-sidebar .nav-link.active {
  border-left: 3px solid var(--pe-primary);
}
.pe-sidebar .nav-section {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--pe-gray-400);
  padding: 1rem 1.25rem .3rem;
}
.pe-content { flex: 1; padding: 2rem; background: var(--pe-gray-50); overflow-x: hidden; }

/* ── Stat cards ──────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border: 1px solid var(--pe-gray-200);
  border-radius: var(--pe-radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-card .icon-box {
  width: 52px; height: 52px;
  border-radius: var(--pe-radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-card .value { font-size: 1.75rem; font-weight: 800; line-height: 1; color: var(--pe-gray-900); }
.stat-card .label { font-size: .85rem; color: var(--pe-gray-500); margin-top: .2rem; }

/* ── Profile progress bar ────────────────────────────────── */
.profile-progress-bar {
  height: 8px;
  background: var(--pe-gray-200);
  border-radius: 50px;
  overflow: hidden;
}
.profile-progress-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pe-primary), var(--pe-success));
  border-radius: 50px;
  transition: width .6s ease;
}

/* ── Status badges ───────────────────────────────────────── */
.status-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .78rem; font-weight: 600;
  padding: .25rem .65rem;
  border-radius: 50px;
}
.status-badge::before { content: '•'; font-size: 1.1em; }
.status-badge.active     { background: var(--pe-success-light); color: var(--pe-success-dark); }
.status-badge.pending    { background: #FFF3CD; color: #856404; }
.status-badge.paused     { background: var(--pe-gray-100); color: var(--pe-gray-600); }
.status-badge.rejected   { background: #FEE2E2; color: #991B1B; }
.status-badge.reviewing  { background: var(--pe-primary-light); color: var(--pe-primary-dark); }
.status-badge.interview  { background: #EDE9FE; color: #5B21B6; }
.status-badge.offer      { background: var(--pe-success-light); color: var(--pe-success-dark); }
.status-badge.expired    { background: var(--pe-gray-100); color: var(--pe-gray-400); }

/* ── Footer ──────────────────────────────────────────────── */
.pe-footer {
  background: var(--pe-gray-900);
  color: var(--pe-gray-300);
  padding: 4rem 0 2rem;
}
.pe-footer h5 { color: #fff; font-weight: 700; margin-bottom: 1rem; font-size: .95rem; }
.pe-footer a { color: var(--pe-gray-400); font-size: .875rem; display: block; margin-bottom: .4rem; transition: color var(--pe-transition); }
.pe-footer a:hover { color: #fff; }
.pe-footer .footer-brand { font-size: 1.4rem; font-weight: 800; color: #fff; }
.pe-footer .footer-brand span { color: var(--pe-success); }
.pe-footer .footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 3rem; padding-top: 1.5rem; font-size: .83rem; color: var(--pe-gray-500); }

/* ── Flash messages ──────────────────────────────────────── */
.pe-flash {
  border-radius: var(--pe-radius);
  padding: .85rem 1.1rem;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  font-size: .9rem;
  margin-bottom: 1rem;
  border: none;
}
.pe-flash-success { background: var(--pe-success-light); color: var(--pe-success-dark); }
.pe-flash-error   { background: #FEE2E2; color: #991B1B; }
.pe-flash-warning { background: #FFF3CD; color: #856404; }
.pe-flash-info    { background: var(--pe-primary-light); color: var(--pe-primary-dark); }

/* ── Password strength ───────────────────────────────────── */
.password-strength-bar { height: 4px; border-radius: 50px; background: var(--pe-gray-200); margin-top: .4rem; overflow: hidden; }
.password-strength-bar .fill { height: 100%; border-radius: 50px; transition: width .3s, background .3s; }
.strength-weak   .fill { width: 25%; background: #dc3545; }
.strength-fair   .fill { width: 50%; background: var(--pe-orange); }
.strength-good   .fill { width: 75%; background: #ffc107; }
.strength-strong .fill { width: 100%; background: var(--pe-success); }

/* ── Pagination ──────────────────────────────────────────── */
.pagination .page-link {
  color: var(--pe-primary);
  border-color: var(--pe-gray-200);
  border-radius: var(--pe-radius-sm) !important;
  margin: 0 2px;
  font-weight: 500;
}
.pagination .page-item.active .page-link {
  background: var(--pe-primary);
  border-color: var(--pe-primary);
}

/* ── Tags / Skills ───────────────────────────────────────── */
.skill-tag {
  display: inline-block;
  background: var(--pe-primary-light);
  color: var(--pe-primary);
  font-size: .78rem;
  font-weight: 600;
  padding: .25rem .65rem;
  border-radius: 50px;
  margin: .15rem;
}

/* ── Tooltip ─────────────────────────────────────────────── */
.pe-tooltip {
  position: relative;
  cursor: help;
}
.pe-tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--pe-gray-900);
  color: #fff;
  font-size: .75rem;
  padding: .35rem .65rem;
  border-radius: var(--pe-radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 99;
}
.pe-tooltip:hover::after { opacity: 1; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .pe-sidebar { display: none; }
  .pe-hero { padding: 3rem 0 2.5rem; }
  .pe-search-bar { flex-direction: column; padding: .75rem; }
  .pe-search-bar .divider { display: none; }
  .pe-search-bar .btn { width: 100%; }
}

@media (max-width: 575.98px) {
  .pe-auth-card { padding: 1.5rem; border-radius: var(--pe-radius-lg); }
  .pe-content { padding: 1rem; }
  .job-card { padding: 1rem; }
}

/* ── Utilities ───────────────────────────────────────────── */
.text-primary { color: var(--pe-primary) !important; }
.bg-primary-light { background: var(--pe-primary-light) !important; }
.fw-800 { font-weight: 800 !important; }
.cursor-pointer { cursor: pointer; }
.transition { transition: all var(--pe-transition); }
.rounded-xl { border-radius: var(--pe-radius-xl) !important; }
.shadow-lg-custom { box-shadow: var(--pe-shadow-lg) !important; }
.border-primary-light { border-color: var(--pe-primary-light) !important; }
