/* ===========================================================================
   CONCURSOLEGAL — DESIGN SYSTEM
   V16 Regressão 45 · Frontend Premium
   =========================================================================== */

/* ===== TOKENS ===== */
:root {
  /* Palette */
  --bg-body: #f0f4f8;
  --bg-surface: #ffffff;
  --bg-hero: linear-gradient(135deg, #0d2137 0%, #143a5c 40%, #1a5276 70%, #1d6d8a 100%);
  --bg-panel: rgba(255, 255, 255, 0.97);

  --text-primary: #1a2332;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --text-on-dark: #f7fafc;
  --text-accent: #1a5276;

  --accent: #1a5276;
  --accent-light: #2980b9;
  --green: #27ae60;
  --green-light: #2ecc71;
  --amber: #f39c12;
  --red: #e74c3c;

  /* Borders */
  --border: #e2e8f0;
  --border-focus: #2980b9;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.12);

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 100px;

  /* Transition */
  --t-fast: 0.15s ease;
  --t-normal: 0.25s ease;
  --t-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  /* Font */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.4); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ===== HERO ===== */
.hero {
  background: var(--bg-hero);
  padding: 52px 24px 76px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(41, 128, 185, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -30%; left: -10%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(39, 174, 96, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hero-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* Badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(39, 174, 96, 0.15);
  border: 1px solid rgba(39, 174, 96, 0.3);
  color: var(--green-light);
  padding: 6px 16px;
  border-radius: var(--r-pill);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 20px;
  animation: fadeInDown 0.6s ease;
}
.pulse-dot {
  width: 8px; height: 8px;
  background: var(--green-light);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

/* Hero text */
.hero h1 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--text-on-dark);
  line-height: 1.2;
  margin-bottom: 12px;
  animation: fadeInDown 0.6s ease 0.1s both;
}
.hero p {
  font-size: clamp(0.92rem, 2vw, 1.08rem);
  color: rgba(247, 250, 252, 0.72);
  font-weight: 400;
  max-width: 600px;
  margin: 0 auto;
  animation: fadeInDown 0.6s ease 0.2s both;
}

/* Stats bar */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease 0.3s both;
}
.stat-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 10px 18px;
  border-radius: var(--r-pill);
  transition: var(--t-normal);
  cursor: default;
}
.stat-chip:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
}
.stat-icon { font-size: 1.1rem; }
.stat-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-on-dark);
}
.stat-label {
  font-size: 0.78rem;
  color: rgba(247, 250, 252, 0.55);
  font-weight: 400;
}

/* ===== SEARCH PANEL ===== */
.search-panel-wrapper {
  max-width: 960px;
  margin: -42px auto 0;
  padding: 0 20px;
  position: relative;
  z-index: 10;
}
.search-panel {
  background: var(--bg-panel);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  padding: 32px 32px 24px;
  border: 1px solid rgba(226, 232, 240, 0.6);
  animation: fadeInUp 0.5s ease 0.4s both;
}
.search-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.search-panel-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-panel-title svg { color: var(--accent); }
.search-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: #f7fafc;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
}

/* Grid */
.search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

/* Fields */
.field-group { position: relative; }
.field-group label {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
}
.field-group input,
.field-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: 0.92rem;
  color: var(--text-primary);
  background: var(--bg-surface);
  transition: var(--t-fast);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.field-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23718096' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.field-group input:focus,
.field-group select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.12);
}
.field-group input::placeholder { color: #a0aec0; }

/* Buttons */
.search-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 32px;
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--t-normal);
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(26, 82, 118, 0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 82, 118, 0.4);
}
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover {
  background: #f7fafc;
  border-color: #cbd5e0;
}

/* ===== RESULTS ===== */
.results-section {
  max-width: 960px;
  margin: 32px auto 60px;
  padding: 0 20px;
}
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.results-count {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.results-count strong {
  color: var(--text-primary);
  font-weight: 700;
}
.results-sort {
  display: flex;
  align-items: center;
  gap: 8px;
}
.results-sort label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}
.results-sort select {
  padding: 6px 30px 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font);
  font-size: 0.82rem;
  color: var(--text-primary);
  background: #fff;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%23718096' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

/* ===== JOB CARDS ===== */
.results-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.job-card {
  background: var(--bg-surface);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  padding: 24px;
  transition: var(--t-normal);
  animation: fadeInUp 0.35s ease both;
}
.job-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e0;
  transform: translateY(-2px);
}

/* Card top row */
.job-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}
.job-card-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
.job-card-orgao {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-top: 2px;
}
.job-salary { text-align: right; flex-shrink: 0; }
.job-salary-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--green);
  white-space: nowrap;
}
.job-salary-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tags */
.job-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-size: 0.76rem;
  font-weight: 500;
  border: 1px solid transparent;
}
.tag-location  { background: #ebf8ff; color: #2b6cb0; border-color: #bee3f8; }
.tag-education { background: #faf5ff; color: #6b46c1; border-color: #e9d8fd; }
.tag-workload  { background: #fffbeb; color: #b7791f; border-color: #fefcbf; }
.tag-vagas     { background: #f0fff4; color: #276749; border-color: #c6f6d5; }
.tag-banca     { background: #fff5f5; color: #c53030; border-color: #fed7d7; }

/* Footer */
.job-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid #f0f4f8;
}
.job-deadline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.job-deadline strong { color: var(--text-secondary); }
.job-source-link {
  font-size: 0.82rem;
  color: var(--accent-light);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--t-fast);
}
.job-source-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ===== STATES ===== */
.empty-state, .initial-state {
  text-align: center;
  padding: 56px 20px;
}
.empty-state-icon, .initial-state-icon {
  font-size: 3.2rem;
  margin-bottom: 16px;
  opacity: 0.45;
}
.initial-state-icon { opacity: 0.55; }
.empty-state h3, .initial-state h3 {
  font-size: 1.15rem;
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: 8px;
}
.empty-state p, .initial-state p {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 420px;
  margin: 0 auto;
}

/* Loading */
.loading-spinner {
  display: none;
  justify-content: center;
  padding: 48px;
}
.loading-spinner.active { display: flex; }
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 32px;
}
.pagination button {
  min-width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--t-fast);
}
.pagination button:hover:not(:disabled):not(.active) {
  border-color: var(--accent-light);
  color: var(--accent);
  background: #ebf8ff;
}
.pagination button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== FOOTER ===== */
.site-footer {
  background: #1a2332;
  padding: 32px 24px;
  text-align: center;
}
.site-footer p {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.42);
  line-height: 1.7;
}
.site-footer strong { color: rgba(255, 255, 255, 0.6); }

/* ===== SCROLL TOP ===== */
.scroll-top {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: var(--t-normal);
  z-index: 100;
}
.scroll-top.visible {
  opacity: 1;
  pointer-events: all;
}
.scroll-top:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a2332;
  color: #fff;
  padding: 14px 24px;
  border-radius: var(--r-sm);
  font-size: 0.86rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== MODE BADGE ===== */
.mode-badge {
  position: fixed;
  top: 12px; right: 12px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.4px;
  z-index: 50;
  text-transform: uppercase;
}
.mode-badge.db {
  background: rgba(39, 174, 96, 0.15);
  color: var(--green);
  border: 1px solid rgba(39, 174, 96, 0.3);
}
.mode-badge.json {
  background: rgba(243, 156, 18, 0.15);
  color: var(--amber);
  border: 1px solid rgba(243, 156, 18, 0.3);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .hero { padding: 36px 16px 60px; }
  .search-panel { padding: 24px 20px 20px; }
  .search-grid { grid-template-columns: 1fr; }
  .stats-bar { gap: 8px; }
  .stat-chip { padding: 8px 14px; }
  .stat-value { font-size: 0.85rem; }
  .stat-label { font-size: 0.72rem; }
  .job-card-top { flex-direction: column; gap: 8px; }
  .job-salary { text-align: left; }
  .btn { width: 100%; }
  .search-actions { flex-direction: column; }
  .results-header { flex-direction: column; align-items: flex-start; }
}
