:root {
  --text: #1d2433;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --accent: #1f4e79;
  --accent-soft: #e6eef7;
  --muted: #5b6475;
  --border: #d9dee8;
  --shadow: 0 1px 3px rgba(20, 30, 50, 0.08);
  --danger: #b00020;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --text: #e8ecf3;
    --bg: #14161c;
    --surface: #1d2028;
    --accent: #8ab4f8;
    --accent-soft: #202a3a;
    --muted: #9aa3b2;
    --border: #2f3542;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --danger: #ff8a95;
  }
}

:root[data-theme="dark"] {
  --text: #e8ecf3;
  --bg: #14161c;
  --surface: #1d2028;
  --accent: #8ab4f8;
  --accent-soft: #202a3a;
  --muted: #9aa3b2;
  --border: #2f3542;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --danger: #ff8a95;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  font-size: 1.15rem;
  letter-spacing: 0.2px;
}

nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  transition: background 0.15s, color 0.15s;
}

nav a:hover {
  color: var(--text);
  background: var(--accent-soft);
}

nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

#theme-toggle {
  margin-left: 6px;
}

main {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px;
  box-sizing: border-box;
}

main > h1:first-child {
  margin-top: 0;
}

h1, h2 {
  color: var(--text);
  line-height: 1.25;
}

h1 {
  font-size: 1.9rem;
}

h2 {
  font-size: 1.3rem;
  margin-top: 28px;
}

h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1em;
  margin-right: 8px;
  vertical-align: -2px;
  background: var(--accent);
  border-radius: 2px;
}

section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

section h2 {
  margin-top: 0;
}

form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 560px;
  margin-bottom: 16px;
}

form:not(section form) {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.95rem;
  font-weight: 500;
}

input, select, textarea {
  font: inherit;
  font-weight: 400;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

button:focus, a:focus {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

button, .button {
  font: inherit;
  font-weight: 600;
  padding: 9px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  width: fit-content;
  transition: filter 0.15s, transform 0.05s;
}

button:hover, .button:hover {
  filter: brightness(1.08);
}

button:active, .button:active {
  transform: translateY(1px);
}

button[type="button"], button[type="reset"] {
  background: transparent;
  color: var(--accent);
}

button[type="button"]:hover, button[type="reset"]:hover {
  background: var(--accent-soft);
  filter: none;
}

main > .button {
  padding: 11px 20px;
  font-size: 1rem;
}

.field-error {
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 500;
}

#message, #status-message, #employer-message, #contact-message-status, #result-count {
  font-weight: 500;
  color: var(--accent);
}

.job-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.job-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}

.job-list li:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(20, 30, 50, 0.12);
}

.job-list a {
  color: var(--accent);
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
}

.job-list a:hover {
  text-decoration: underline;
}

.job-list div {
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 2px;
}

#job-detail h1 {
  margin-bottom: 6px;
}

#job-detail p:first-of-type {
  color: var(--muted);
  font-weight: 500;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 18px 0 24px;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.kpi-label {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
}

.chart-placeholder {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 24px;
  color: var(--text);
  box-shadow: var(--shadow);
}

.chart-placeholder ol {
  margin: 0;
  padding-left: 22px;
}

.chart-placeholder li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.chart-placeholder li:last-child {
  border-bottom: none;
}

.site-footer {
  text-align: center;
  padding: 18px 16px;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

@media (max-width: 600px) {
  .site-header {
    padding: 12px 16px;
  }

  main {
    padding: 20px 16px;
  }

  h1 {
    font-size: 1.6rem;
  }
}
