/* Vorpraktiz v3 - server-rendered, system fonts only (no external requests). */
:root {
  --surface: #F8FAFC;
  --surface-raised: #FFFFFF;
  --surface-sunken: #F1F5F9;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text: #0F172A;
  --text-muted: #475569;
  --accent: #4F46E5;
  --accent-strong: #4338CA;
  --accent-wash: #EEF2FF;
  --accent-2: #7C3AED;
  --high: #047857; --high-bg: #ECFDF5;
  --mid: #B45309;  --mid-bg: #FFFBEB;
  --low: #B91C1C;  --low-bg: #FEF2F2;
  --info: #1D4ED8; --info-bg: #EFF6FF;
  --radius: 10px;
  --shadow: 0 4px 20px -4px rgba(79, 70, 229, 0.12);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface: #0B1120; --surface-raised: #111827; --surface-sunken: #1E293B;
    --border: #1F2937; --border-strong: #334155;
    --text: #E2E8F0; --text-muted: #94A3B8;
    --accent: #818CF8; --accent-strong: #A5B4FC; --accent-wash: #1E1B4B; --accent-2: #A78BFA;
    --high: #34D399; --high-bg: #052E21; --mid: #FBBF24; --mid-bg: #2D2006;
    --low: #F87171; --low-bg: #2A0E0E; --info: #93C5FD; --info-bg: #0C1A33;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 1rem; line-height: 1.55;
  color: var(--text); background: var(--surface);
}
a { color: var(--accent-strong); }
a:hover { color: var(--accent-2); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.4rem); margin: 0 0 0.4rem; }
h2 { font-size: 1.25rem; margin: 1.6rem 0 0.6rem; }
h3 { font-size: 1.05rem; margin: 1rem 0 0.4rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 8px; background: var(--surface-raised); padding: 8px 12px; z-index: 10; }

/* Header / footer */
.site-header { background: var(--surface-raised); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-top: 10px; padding-bottom: 10px; }
.logo { font-weight: 800; font-size: 1.35rem; text-decoration: none; color: var(--text); }
.logo span { color: var(--accent); }
.main-nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.main-nav a { padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--text-muted); font-weight: 600; font-size: 0.95rem; }
.main-nav a:hover { background: var(--surface-sunken); color: var(--text); }
.main-nav a[aria-current="page"] { background: var(--accent-wash); color: var(--accent-strong); }
.lang-switch { font-size: 0.9rem; font-weight: 600; }
@media (max-width: 640px) {
  .site-header { position: static; }
  .lang-switch { margin-left: auto; }
  .main-nav { order: 3; flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 12px; }
  .main-nav a { white-space: nowrap; }
}
.site-footer { margin-top: 48px; border-top: 1px solid var(--border); background: var(--surface-raised); color: var(--text-muted); font-size: 0.85rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 16px; padding-bottom: 16px; }

/* Layout */
main { padding-top: 20px; }
.hero { margin: 8px 0 20px; }
.lead { color: var(--text-muted); font-size: 1.05rem; margin: 0 0 0.5rem; max-width: 70ch; }
.layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 24px; align-items: start; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 860px) {
  .layout, .two-col { grid-template-columns: minmax(0, 1fr); }
}

/* Panels and cards */
.panel, .card, .searchbar {
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px;
}
.panel h2:first-child { margin-top: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; gap: 8px; }
.card-title { margin: 0; font-size: 1.05rem; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--accent-strong); text-decoration: underline; }
.card-meta { margin: 0; color: var(--text-muted); font-size: 0.88rem; }
.card-footer { margin-top: auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }
.card-link { font-weight: 600; font-size: 0.9rem; }
.cards-compact .card { padding: 12px 14px; }

.count { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-left: 6px; }
.section-intro, .hint { color: var(--text-muted); font-size: 0.9rem; }
.notice { font-size: 0.88rem; color: var(--text-muted); border-left: 3px solid var(--border-strong); padding-left: 10px; }
.empty { color: var(--text-muted); font-style: italic; }

/* Tags and badges */
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.tag { font-size: 0.78rem; padding: 2px 9px; border-radius: 999px; background: var(--surface-sunken); color: var(--text-muted); border: 1px solid var(--border); }
.tag-match { background: var(--accent-wash); color: var(--accent-strong); border-color: var(--accent); }
.badge { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.badge-verified { background: var(--high-bg); color: var(--high); }
.badge-program { background: var(--info-bg); color: var(--info); }
.badge-candidate { background: var(--mid-bg); color: var(--mid); }

/* Score */
progress { width: 100%; height: 8px; border: 0; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; appearance: none; }
progress::-webkit-progress-bar { background: var(--surface-sunken); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.score { display: flex; flex-direction: column; gap: 4px; }
.score-label { font-size: 0.85rem; color: var(--text-muted); }
.score-high progress::-webkit-progress-value { background: var(--high); }
.score-high progress::-moz-progress-bar { background: var(--high); }
.score-high b { color: var(--high); }
.score-mid progress::-webkit-progress-value { background: var(--mid); }
.score-mid progress::-moz-progress-bar { background: var(--mid); }
.score-mid b { color: var(--mid); }
.score-low progress::-webkit-progress-value { background: var(--low); }
.score-low progress::-moz-progress-bar { background: var(--low); }
.score-low b { color: var(--low); }
.score-none .score-label { font-style: italic; }
.factors { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.factors li { display: flex; flex-direction: column; gap: 4px; font-size: 0.92rem; }

/* Alerts */
.alert { padding: 10px 14px; border-radius: 8px; border: 1px solid transparent; margin: 0 0 12px; }
.alert-success { background: var(--high-bg); color: var(--high); border-color: currentColor; }
.alert-warning { background: var(--mid-bg); color: var(--mid); border-color: currentColor; }
.alert-error { background: var(--low-bg); color: var(--low); border-color: currentColor; }
.alert-info { background: var(--info-bg); color: var(--info); border-color: currentColor; }

/* Forms */
label { font-weight: 600; font-size: 0.9rem; }
input[type="text"], input[type="search"], input:not([type]), select, textarea, input[type="file"] {
  width: 100%; font: inherit; color: var(--text); background: var(--surface-raised);
  border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 10px;
}
textarea { resize: vertical; }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin: 0; }
legend { font-weight: 600; font-size: 0.9rem; padding: 0 4px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; padding: 2px 0; }
.check input { margin-top: 0.3em; accent-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; font-size: 0.92rem; text-decoration: none; cursor: pointer;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface-raised); color: var(--text);
}
.btn:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); color: #fff; }
.btn-danger { color: var(--low); border-color: var(--low); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Detail pages */
.detail-header { margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.detail .panel { margin: 16px 0; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; margin: 0; }
.facts dt { font-weight: 600; color: var(--text-muted); }
.facts dd { margin: 0; }
@media (max-width: 520px) { .facts { grid-template-columns: minmax(0, 1fr); } .facts dd { margin-bottom: 6px; } }
.plain { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.rule-summary, .data-note { background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; }
.rule-summary summary, .data-note summary { cursor: pointer; font-weight: 600; }
.uni-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.prose { max-width: 75ch; }
.pagination { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 20px 0; flex-wrap: wrap; }

/* Search bar: the university picker comes first */
.searchbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.searchbar-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-rule label { color: var(--accent-strong); }
.field-rule select { border-color: var(--accent); }
@media (max-width: 860px) { .searchbar-main { grid-template-columns: minmax(0, 1fr); } }
.more-filters summary { cursor: pointer; font-weight: 600; font-size: 0.92rem; color: var(--text-muted); }
.more-filters .hint { margin: 6px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { cursor: pointer; font-weight: 500; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-block; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface-raised); font-size: 0.85rem; }
.chip input:checked + span { background: var(--accent-wash); border-color: var(--accent); color: var(--accent-strong); }
.chip input:checked + span::before { content: "✓ "; }
.chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.rule-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between;
  background: var(--accent-wash); border: 1px solid var(--accent); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; }
.btn-small { padding: 4px 10px; font-size: 0.85rem; }

/* Candidates: a compact list instead of 24 cards */
.company-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0 24px; background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 16px; }
.company-list li { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--border); }
.company-list a { font-weight: 600; text-decoration: none; }
.company-list a:hover { text-decoration: underline; }
.company-list .hint { font-size: 0.82rem; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--border); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; }
.faq details p { margin: 8px 0 0; }

/* Legal page */
.legal h3 { margin-top: 1.2rem; }
.legal p { margin: 0.4rem 0 0.8rem; }

/* Credit line under the footer links */
.footer-credit { flex-basis: 100%; }
