:root {
  --bg: #f6f8fb;
  --bg-soft: #eef3f8;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --surface-dark: #0f172a;
  --text: #0f172a;
  --text-soft: #475569;
  --text-faint: #64748b;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.14);
  --primary: #0f172a;
  --primary-hover: #1e293b;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --success: #15803d;
  --success-hover: #166534;
  --danger: #be123c;
  --danger-soft: #fff1f2;
  --shadow-lg: 0 20px 60px rgba(15, 23, 42, 0.10);
  --shadow-md: 0 12px 30px rgba(15, 23, 42, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 32%),
    radial-gradient(circle at top right, rgba(15, 23, 42, 0.07), transparent 24%),
    linear-gradient(180deg, #f8fafc 0%, #f4f7fb 100%);
  line-height: 1.65;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.25), transparent 85%);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

.site-shell {
  position: relative;
  z-index: 1;
}

.container {
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
}

/* ===== HERO / HOME ===== */

.hero {
  padding: 36px 0 20px;
}

.hero-grid,
.hero-vaga-inner {
  display: grid;
  gap: 24px;
  align-items: stretch;
}

.hero-copy,
.hero-vaga-copy,
.hero-panel,
.hero-vaga-panel,
.job-card,
.content-card,
.apply-card,
.empty-state {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hero-copy,
.hero-vaga-copy {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.92));
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.hero-copy::after,
.hero-vaga-copy::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -80px;
  top: -80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.eyebrow,
.section-kicker,
.admin-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.eyebrow {
  background: rgba(255, 255, 255, 0.12);
  color: #dbeafe;
  margin-bottom: 18px;
}

.section-kicker {
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 18px;
}

.admin-kicker {
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.78rem;
  padding: 6px 12px;
}

.hero-copy h1,
.hero-vaga-copy h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero-copy p,
.hero-vaga-subtitle {
  margin: 18px 0 0;
  max-width: 60ch;
  color: rgba(255,255,255,0.82);
  font-size: 1.05rem;
}

.hero-actions,
.admin-hero-actions,
.table-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions {
  margin-top: 28px;
}

.hero-panel,
.hero-vaga-panel {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card,
.info-tile {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: var(--radius-md);
  padding: 18px;
}

.stat-label,
.info-tile span {
  display: block;
  color: var(--text-faint);
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.stat-value,
.info-tile strong {
  display: block;
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1.1;
}

/* ===== SEÇÕES ===== */

.page-section {
  padding: 18px 0 56px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 24px;
}

.section-head h2 {
  margin: 8px 0 8px;
  font-size: clamp(1.6rem, 2.2vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0;
  color: var(--text-soft);
}

/* ===== LISTAGEM DE VAGAS ===== */

.jobs-grid,
.vaga-lista {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.job-card,
.content-card,
.apply-card,
.empty-state,
.card,
.admin-card,
.job-info,
.vaga-card {
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(255,255,255,0.65);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.job-card,
.vaga-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.job-card-top,
.job-card-footer,
.job-meta-list,
.form-row,
.content-card-head,
.topbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.job-card-top {
  justify-content: space-between;
  margin-bottom: 18px;
}

.job-chip,
.job-date,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.84rem;
}

.job-chip,
.badge {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.job-date {
  background: #f8fafc;
  color: var(--text-faint);
  border: 1px solid var(--line);
}

.job-title,
.vaga-card h2 {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.job-company {
  margin: 8px 0 0;
  color: var(--text);
  font-weight: 600;
}

.job-meta-list {
  margin: 18px 0 0;
}

.job-meta-list span {
  color: var(--text-soft);
  font-size: 0.95rem;
  padding-right: 12px;
  position: relative;
}

.job-meta-list span:not(:last-child)::after {
  content: "•";
  position: absolute;
  right: 0;
  color: #cbd5e1;
}

.job-summary,
.vaga-meta,
.vaga-card .vaga-info,
.info-extra,
.small {
  color: var(--text-soft);
}

.job-summary {
  margin: 18px 0 0;
}

.job-card-footer {
  justify-content: space-between;
  margin-top: 24px;
}

.job-link-hint {
  color: var(--text-faint);
  font-size: 0.92rem;
}

/* ===== BOTÕES ===== */

.btn,
.btn-detalhes,
.btn-candidatar,
.button-link,
button,
.btn-sec {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover,
.btn-detalhes:hover,
.btn-candidatar:hover,
.button-link:hover,
button:hover,
.btn-sec:hover {
  transform: translateY(-1px);
}

.btn-primary,
.btn-detalhes,
.btn-candidatar {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover,
.btn-detalhes:hover,
.btn-candidatar:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.18);
  color: #fff;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.18);
}

.btn-light,
.btn-sec {
  background: #fff;
  color: #111827;
  border-color: #dbe3ec;
}

.btn-light:hover,
.btn-sec:hover {
  background: #f8fafc;
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #fecdd3;
}

.btn-danger:hover {
  background: #ffe4e6;
}

.btn-submit,
button[type="submit"] {
  background: var(--success);
  color: #fff;
}

.btn-submit:hover,
button[type="submit"]:hover {
  background: var(--success-hover);
}

.btn-sm {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 0.92rem;
}

.btn-block,
.btn-full {
  width: 100%;
}

/* ===== EMPTY STATE ===== */

.empty-state {
  padding: 48px 28px;
  text-align: center;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.8rem;
  font-weight: 700;
}

.empty-state h1,
.empty-state h3 {
  margin: 0 0 10px;
  line-height: 1.15;
}

.empty-state p {
  margin: 0 0 22px;
  color: var(--text-soft);
}

/* ===== PÁGINA DA VAGA ===== */

.back-link,
.header-link,
.voltar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.back-link {
  color: rgba(255,255,255,0.9);
  margin-bottom: 16px;
}

.header-link,
.voltar {
  color: var(--primary);
}

.vaga-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.95fr);
  gap: 24px;
  padding: 14px 0 56px;
  align-items: start;
}

.vaga-content,
.vaga-sidebar,
.vaga-detalhe-stack {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.vaga-detalhe-stack {
  grid-template-columns: 1fr;
}

.content-card,
.apply-card,
.card,
.admin-card,
.job-info {
  padding: 26px;
}

.content-card h2,
.apply-card h2,
.card h2,
.job-info h2,
h2 {
  margin: 0 0 14px;
  font-size: 1.35rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}

.apply-card > p {
  margin: 0 0 18px;
  color: var(--text-soft);
}

.rich-text {
  color: var(--text-soft);
}

.rich-text p {
  margin: 0 0 14px;
}

.rich-text ul,
ul {
  margin: 0;
  padding-left: 1.15rem;
}

.rich-text li + li,
li + li {
  margin-top: 10px;
}

.vaga-resumo-grid,
.grid-2,
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.grid {
  display: grid;
  gap: 20px;
}

.form-candidatura-wrap {
  margin-top: 18px;
}

.form-collapse {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.form-collapse.active {
  max-height: 1000px;
}

/* ===== FORMULÁRIOS ===== */

.form-grid,
.admin-form,
.apply-form {
  display: grid;
  gap: 16px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label,
.field label {
  display: block;
  margin-bottom: 7px;
  font-weight: 600;
  color: var(--text);
}

input,
textarea,
select,
.field input,
.field textarea,
.field select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,0.96);
  color: var(--text);
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

input[type="file"] {
  width: 100%;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  border-radius: 14px;
  padding: 14px;
  font: inherit;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

input[type="file"]:hover {
  border-color: #2563eb;
  background: #f1f5ff;
}

input[type="file"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

input[type="file"]::file-selector-button {
  background: #111827;
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  margin-right: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
}

input[type="file"]::file-selector-button:hover {
  background: #1f2937;
}

textarea,
.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field {
  min-width: 0;
}

input:focus,
textarea:focus,
select:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.small {
  font-size: 0.92rem;
}

.admin-helper {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.5;
}

.admin-helper code {
  background: #f1f5f9;
  border-radius: 8px;
  padding: 2px 6px;
}

/* ===== PRE / TABELAS / AVISOS ===== */

.json-preview,
pre.json-preview {
  margin: 0;
  padding: 16px;
  border-radius: 16px;
  overflow: auto;
  background: var(--surface-dark);
  color: #dbeafe;
  font-size: 0.85rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.table,
.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td,
.admin-table th,
.admin-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.notice {
  padding: 14px 16px;
  border-radius: 14px;
  margin: 16px 0;
}

.notice.ok {
  background: #ecfdf5;
  color: #166534;
}

.notice.erro {
  background: #fef2f2;
  color: #991b1b;
}

/* ===== ADMIN ===== */

.admin-shell {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 20px 56px;
}

.admin-login-shell {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-login-card {
  width: 100%;
  max-width: 520px;
  background: #ffffff;
  border: 1px solid #e8edf3;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
  padding: 32px;
}

.admin-login-brand h1 {
  margin: 8px 0 10px;
  font-size: 2rem;
  line-height: 1.1;
  color: #0f172a;
}

.admin-login-brand p {
  margin: 0 0 24px;
  color: #64748b;
}

.admin-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.admin-hero-copy h1 {
  margin: 10px 0 8px;
  font-size: 2.4rem;
  line-height: 1.05;
  color: #0f172a;
}

.admin-hero-copy p {
  margin: 0;
  color: #64748b;
  font-size: 1.02rem;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.admin-stats .stat-card {
  background: #fff;
  border: 1px solid #e8edf3;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.admin-stats .stat-label {
  color: #64748b;
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.admin-stats .stat-value {
  color: #0f172a;
  font-size: 2rem;
  line-height: 1;
}

.admin-panel {
  background: #fff;
  border: 1px solid #e8edf3;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.admin-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 24px 24px 18px;
  border-bottom: 1px solid #eef2f7;
}

.admin-panel-head h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  color: #0f172a;
}

.admin-panel-head p {
  margin: 0;
  color: #64748b;
}

.admin-empty {
  padding: 48px 24px;
  text-align: center;
}

.admin-empty h3 {
  margin: 0 0 10px;
  color: #0f172a;
}

.admin-empty p {
  margin: 0 0 20px;
  color: #64748b;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  min-width: 860px;
}

.admin-table th,
.admin-table td {
  padding: 18px 24px;
  vertical-align: middle;
  border-bottom: 1px solid #eef2f7;
}

.admin-table th {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  background: #fbfcfe;
}

.admin-table tbody tr:hover {
  background: #fafcff;
}

.vaga-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vaga-cell strong {
  color: #0f172a;
}

.vaga-slug {
  color: #64748b;
  font-size: 0.9rem;
  word-break: break-word;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge.is-ativa {
  background: #ecfdf3;
  color: #027a48;
}

.status-badge.is-inativa {
  background: #f2f4f7;
  color: #475467;
}

.status-badge.is-expirada {
  background: #fef3f2;
  color: #b42318;
}

/* ===== RESPONSIVO ===== */

@media (max-width: 1024px) {
  .jobs-grid,
  .vaga-lista,
  .vaga-layout,
  .hero-grid,
  .hero-vaga-inner {
    grid-template-columns: 1fr;
  }

  .vaga-layout {
    gap: 20px;
  }
}

@media (max-width: 900px) {
  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .container {
    width: min(100% - 20px, var(--container));
  }

  .hero {
    padding-top: 18px;
  }

  .hero-copy,
  .hero-vaga-copy,
  .hero-panel,
  .hero-vaga-panel,
  .job-card,
  .content-card,
  .apply-card,
  .empty-state,
  .card,
  .admin-card,
  .job-info,
  .vaga-card {
    border-radius: 22px;
    padding: 22px;
  }

  .hero-copy h1,
  .hero-vaga-copy h1 {
    font-size: 2rem;
  }

  .hero-panel,
  .hero-vaga-panel,
  .vaga-resumo-grid,
  .grid-2,
  .form-grid-2,
  .form-row-2 {
    grid-template-columns: 1fr;
  }

  .section-head {
    margin-bottom: 18px;
  }

  .job-card-footer,
  .hero-actions,
  .job-card-top {
    align-items: stretch;
  }

  .job-card-footer > *,
  .hero-actions > *,
  .job-card-top > * {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .admin-shell {
    padding: 24px 16px 40px;
  }

  .admin-login-card {
    padding: 24px;
    border-radius: 20px;
  }

  .admin-hero-copy h1 {
    font-size: 1.9rem;
  }

  .admin-stats {
    grid-template-columns: 1fr;
  }

  .admin-panel-head,
  .admin-table th,
  .admin-table td {
    padding-left: 16px;
    padding-right: 16px;
  }

  .admin-hero-actions,
  .table-actions,
  .actions {
    width: 100%;
  }

  .admin-hero-actions .btn,
  .table-actions .btn,
  .actions .btn {
    flex: 1 1 auto;
  }
}