/* =========================================================================
   Jobs Board — design system
   Palette: white base, emerald primary, blue secondary, crimson accent
   ========================================================================= */

:root {
  --white: #ffffff;
  --ink: #10241e;
  --ink-soft: #45564f;
  --muted: #6b7c76;
  --line: #e3ece7;

  --emerald: #0b6e4f;
  --emerald-dark: #084f39;
  --emerald-soft: #e4f3ec;

  --blue: #1e5aa8;
  --blue-soft: #e7eefb;

  --crimson: #9e1b32;
  --crimson-soft: #fbe9ec;

  --mint: #f3f7f5;
  --mint-deep: #eaf4ef;

  --shadow-sm: 0 1px 2px rgba(16, 36, 30, 0.06), 0 1px 1px rgba(16, 36, 30, 0.04);
  --shadow-md: 0 8px 24px rgba(16, 36, 30, 0.08);
  --shadow-lg: 0 20px 48px rgba(16, 36, 30, 0.14);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --gradient-hero: linear-gradient(135deg, #eaf6f0 0%, #eef4fb 45%, #fdeef1 100%);
  --gradient-brand: linear-gradient(120deg, var(--emerald) 0%, var(--blue) 100%);
  --gradient-crimson: linear-gradient(120deg, var(--crimson) 0%, #c94a5f 100%);

  --font-heading: "Sora", "Segoe UI", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  padding: 0;
  margin: 0;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 1.4rem; font-weight: 700; margin-top: 1.6em; }
h3 { font-size: 1.05rem; font-weight: 600; }

p { margin: 0 0 1em; color: var(--ink-soft); }

a { color: var(--emerald); text-decoration: none; }
a:hover { color: var(--emerald-dark); }

.muted { color: var(--muted); font-size: 0.92rem; }
.center { text-align: center; }

img { max-width: 100%; display: block; }

.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------------------------------------------------------------- buttons */
.btn {
  --btn-bg: var(--mint);
  --btn-fg: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.72em 1.4em;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  background: var(--btn-bg);
  color: var(--btn-fg);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease, filter 0.2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.03); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); filter: brightness(0.98); box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.btn-primary {
  background: var(--gradient-brand);
  color: var(--white);
  box-shadow: 0 6px 18px rgba(11, 110, 79, 0.28);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(11, 110, 79, 0.36); color: var(--white); }

.btn-ghost {
  background: transparent;
  color: var(--emerald-dark);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--mint); color: var(--emerald-dark); }

.btn-google {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.btn-sm { padding: 0.42em 1em; font-size: 0.82rem; }
.btn-lg { padding: 0.95em 1.9em; font-size: 1.02rem; }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
  margin-right: auto;
}
.brand:hover { color: var(--ink); }

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--gradient-brand);
  position: relative;
  box-shadow: 0 4px 12px rgba(11, 110, 79, 0.35);
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 5px;
  background: var(--white);
  opacity: 0.9;
}
.brand-mark.small { width: 24px; height: 24px; border-radius: 7px; }
.brand-mark.small::after { inset: 5px; border-radius: 4px; }
.brand-name { font-family: var(--font-heading); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.main-nav a {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.94rem;
  position: relative;
  padding: 6px 0;
}
.main-nav a:hover { color: var(--emerald); }
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--gradient-brand);
  transition: right 0.2s ease;
  border-radius: 2px;
}
.main-nav a:hover::after { right: 0; }

.header-actions { display: flex; align-items: center; gap: 10px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--white);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------------------------------------------------------------- install banner */
.install-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--gradient-brand);
  color: var(--white);
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
}
.install-banner[hidden] { display: none; }
.install-banner .btn-ghost { background: rgba(255,255,255,0.15); color: var(--white); border-color: rgba(255,255,255,0.4); }
.install-banner .btn-primary { background: var(--white); color: var(--emerald-dark); box-shadow: none; }

/* ---------------------------------------------------------------- flash */
.flash-stack { padding-top: 16px; display: grid; gap: 10px; }
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
  border: 1px solid transparent;
}
.flash-success { background: var(--emerald-soft); color: var(--emerald-dark); border-color: #c7e7d8; }
.flash-error { background: var(--crimson-soft); color: var(--crimson); border-color: #f2c3cc; }
.flash-info { background: var(--blue-soft); color: var(--blue); border-color: #c9dbf5; }

/* ---------------------------------------------------------------- hero */
.hero {
  background: var(--gradient-hero);
  padding: 64px 0 44px;
  position: relative;
  overflow: hidden;
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  z-index: 0;
}
.hero::before {
  width: 320px; height: 320px;
  background: var(--emerald);
  top: -140px; right: -80px;
  opacity: 0.14;
}
.hero::after {
  width: 260px; height: 260px;
  background: var(--crimson);
  bottom: -140px; left: -60px;
  opacity: 0.10;
}
.hero-inner { position: relative; z-index: 1; text-align: center; max-width: 760px; }
.hero-sub { font-size: 1.05rem; max-width: 560px; margin: 0 auto 28px; }

.search-bar {
  display: flex;
  gap: 10px;
  background: var(--white);
  padding: 8px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  max-width: 620px;
  margin: 0 auto 18px;
}
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 12px 16px;
  font-size: 0.98rem;
  font-family: var(--font-body);
  color: var(--ink);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.filter-row select {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.filter-row select:hover { border-color: var(--emerald); color: var(--ink); }

/* ---------------------------------------------------------------- job grid */
.job-grid-section { padding: 40px 0 60px; }
.grid-meta { margin-bottom: 18px; color: var(--muted); font-size: 0.9rem; }

.job-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.job-card {
  --accent: var(--emerald);
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.job-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.badge-featured {
  background: var(--gradient-crimson);
  color: var(--white);
}

.job-card-top { display: flex; gap: 12px; align-items: flex-start; }

.job-logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--mint);
  flex-shrink: 0;
}
.job-logo.lg { width: 68px; height: 68px; border-radius: 16px; }
.job-logo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--emerald-dark);
  background: var(--emerald-soft);
  font-size: 1.1rem;
}

.job-title { margin: 0 0 2px; font-size: 1.02rem; }
.job-title a { color: var(--ink); }
.job-title a:hover { color: var(--emerald); }
.job-company { margin: 0; color: var(--muted); font-size: 0.87rem; }

.job-summary { font-size: 0.9rem; color: var(--ink-soft); margin: 0; flex: 1; }
.job-summary.lead { font-size: 1.02rem; margin-bottom: 1.4em; }

.job-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  --tag-color: var(--emerald);
  background: color-mix(in srgb, var(--tag-color) 14%, white);
  color: var(--tag-color);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.tag-outline {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.job-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.job-card-footer time { color: var(--muted); font-size: 0.8rem; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
}
.page-indicator { color: var(--muted); font-size: 0.88rem; }

/* ---------------------------------------------------------------- job detail */
.job-detail { padding: 40px 0 80px; max-width: 860px; }
.back-link {
  display: inline-block;
  margin-bottom: 22px;
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.back-link:hover { color: var(--emerald); }

.job-detail-header {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}

.job-full-content h2 { margin-top: 1.6em; }
.job-full-content :is(ul, ol) { padding-left: 1.3em; color: var(--ink-soft); }

.apply-box {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 32px 0 8px;
  padding: 22px;
  background: var(--mint);
  border-radius: var(--radius-md);
}

.related-jobs { margin-top: 56px; }

/* ---------------------------------------------------------------- locked/paywall */
.locked-section {
  position: relative;
  margin-top: 20px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
}
.locked-preview {
  padding: 28px 28px 120px;
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
  color: var(--ink-soft);
}
.locked-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  background: linear-gradient(180deg, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0.92) 32%, var(--white) 100%);
}
.locked-overlay::before {
  content: "🔒";
  font-size: 1.6rem;
  margin-bottom: 10px;
}
.locked-overlay h2 { margin-top: 0; }
.locked-overlay p { max-width: 440px; }

/* ---------------------------------------------------------------- auth / forms */
.auth-page {
  display: flex;
  justify-content: center;
  padding: 56px 20px 80px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 34px 30px;
  box-shadow: var(--shadow-md);
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: 0.3em; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.stacked-form { display: grid; gap: 14px; }
.stacked-form label {
  display: grid;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.stacked-form input[type="text"],
.stacked-form input[type="email"],
.stacked-form input[type="password"],
.stacked-form input[type="number"],
.stacked-form input[type="url"],
.stacked-form input[type="color"],
.stacked-form select,
.stacked-form textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--mint);
  transition: border-color 0.15s ease, background 0.15s ease;
  width: 100%;
}
.stacked-form textarea { resize: vertical; min-height: 90px; }
.stacked-form input:focus, .stacked-form select:focus, .stacked-form textarea:focus {
  outline: none;
  border-color: var(--emerald);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--emerald-soft);
}

.checkbox-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  font-weight: 500 !important;
}
.checkbox-row input { width: auto; }

.status-pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}
.status-active { background: var(--emerald-soft); color: var(--emerald-dark); }
.status-inactive { background: var(--crimson-soft); color: var(--crimson); }

/* ---------------------------------------------------------------- account page */
.account-page { padding: 44px 0 80px; }
.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 22px;
}
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.card h2 { margin-top: 0; font-size: 1.05rem; }

.mini-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; margin-top: 10px; }
.mini-table th, .mini-table td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); color: var(--ink-soft); }

/* ---------------------------------------------------------------- admin */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  padding: 32px 0 80px;
  align-items: start;
}
.admin-sidebar {
  position: sticky;
  top: 92px;
  background: var(--mint);
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid var(--line);
}
.admin-sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.admin-sidebar a {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.admin-sidebar a:hover { background: var(--white); color: var(--emerald); }
.admin-sidebar a.active { background: var(--gradient-brand); color: var(--white); }

.admin-content { min-width: 0; }
.admin-content h1 { margin-bottom: 6px; }

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 12px;
}
.admin-section-header h2 { margin: 0; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 18px 0 8px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--emerald);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.stat-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--ink);
}
.stat-label { color: var(--muted); font-size: 0.82rem; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-size: 0.88rem;
}
.admin-table th {
  text-align: left;
  background: var(--mint);
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 12px 14px;
}
.admin-table td {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
}
.admin-table tr:hover td { background: var(--mint); }

.admin-form { max-width: 640px; }

.message-card { margin-bottom: 14px; }
.message-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.admin-reply {
  margin-top: 10px;
  padding: 12px 14px;
  background: var(--mint);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

/* ---------------------------------------------------------------- footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--mint);
  padding: 34px 0;
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.footer-inner > div:first-child { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--ink-soft); font-weight: 600; font-size: 0.88rem; }
.footer-links a:hover { color: var(--emerald); }
.fine-print { width: 100%; margin: 10px 0 0; font-size: 0.78rem; color: var(--muted); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; }
  .admin-sidebar nav { flex-direction: row; flex-wrap: wrap; }
}

@media (max-width: 760px) {
  .main-nav, .header-actions { display: none; }
  .nav-toggle { display: flex; }

  .header-inner.open .main-nav {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    padding: 14px 20px;
    gap: 14px;
    box-shadow: var(--shadow-md);
  }
  .header-inner.open .header-actions {
    display: flex;
    position: absolute;
    top: calc(72px + 190px);
    left: 0; right: 0;
    background: var(--white);
    padding: 0 20px 18px;
    border-bottom: 1px solid var(--line);
  }

  .hero { padding: 44px 0 32px; }
  .search-bar { flex-direction: column; border-radius: var(--radius-md); }
  .search-bar .btn { border-radius: var(--radius-sm); }
  .job-detail-header { flex-direction: column; }
}
