/* ── Reset & base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  background: #f5f4ff;
  color: #111827;
  min-height: 100vh;
}

a { color: #7F77DD; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav ──────────────────────────────────────────────────────────── */
nav {
  background: #3C3489;
  border-bottom: 1px solid #2a2468;
  padding: 0 1.5rem;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-brand {
  font-weight: 700;
  font-size: 1rem;
  color: #ffffff;
  letter-spacing: -0.01em;
}

a.nav-brand,
a.nav-brand:hover { color: #ffffff; text-decoration: none; }

.nav-links { display: flex; gap: 1.25rem; align-items: center; }
.nav-links a { font-size: 0.9rem; color: rgba(255,255,255,0.65); }
.nav-links a.active { color: #ffffff; font-weight: 600; }
.nav-links a:hover { color: #ffffff; text-decoration: none; }
.nav-logout { color: rgba(255,255,255,0.45) !important; }
.nav-lang { font-size: 0.8rem; color: rgba(255,255,255,0.4); }
.nav-lang a { font-size: 0.8rem; color: rgba(255,255,255,0.4) !important; }
.nav-lang a.active { color: #ffffff !important; font-weight: 600; }
.nav-lang-sep { color: rgba(255,255,255,0.2); font-size: 0.75rem; user-select: none; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  align-items: center;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  nav { position: relative; }
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 52px; left: 0; right: 0;
    background: #3C3489;
    flex-direction: column;
    padding: 0.5rem 1.5rem 0.75rem;
    gap: 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
    z-index: 20;
  }
  .nav-links.nav-open { display: flex; }
  .nav-links a { padding: 0.55rem 0; border-bottom: 1px solid rgba(255,255,255,0.07); }
  .nav-links a:last-child { border-bottom: none; }
  .nav-lang { border-left: none; padding-left: 0; margin-left: 0; padding-top: 0.55rem; }
}

/* ── Main ─────────────────────────────────────────────────────────── */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* ── Flash messages ───────────────────────────────────────────────── */
.flash {
  background: #EEEDFE;
  border: 1px solid #AFA9EC;
  color: #3C3489;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.error-msg {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* ── Feedback banner ───────────────────────────────────────────────── */
.feedback-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f9f9ff;
  border: 1px solid #ddd8f8;
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
  color: #4b4b80;
  margin-bottom: 0.75rem;
  gap: 0.75rem;
}

.feedback-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.feedback-link {
  color: #7F77DD;
  font-weight: 500;
  white-space: nowrap;
}

.feedback-link:hover { color: #3C3489; }

.feedback-dismiss {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0 0 0.25rem;
}

.feedback-dismiss:hover { color: #4b4b80; }

/* ── Auth pages ───────────────────────────────────────────────────── */
.auth-card {
  max-width: 380px;
  margin: 4rem auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 2rem;
}

.auth-card h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  text-align: center;
}

.auth-sub {
  text-align: center;
  color: #6b7280;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: #6b7280;
}

/* ── Forms ────────────────────────────────────────────────────────── */
label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.3rem;
  margin-top: 1rem;
}

label:first-of-type { margin-top: 0; }

input[type="email"],
input[type="password"],
input[type="text"],
input[type="file"],
select {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  color: #111827;
  background: #fff;
  transition: border-color 0.15s;
}

input:focus {
  outline: none;
  border-color: #7F77DD;
  box-shadow: 0 0 0 3px rgba(127,119,221,.18);
}

.file-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.file-row input[type="file"] { flex: 1; min-width: 0; }

.cv-upload-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cv-upload-row .btn-secondary { margin-top: 0; }

kbd {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  padding: 0.1em 0.35em;
  font-size: 0.8rem;
  font-family: inherit;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  background: #3C3489;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 1rem;
}

.btn-primary:hover:not(:disabled) { background: #2d277a; }
.btn-primary:disabled { background: #7F77DD; cursor: not-allowed; }

.btn-secondary {
  display: inline-block;
  background: #fff;
  color: #3C3489;
  border: 1px solid #3C3489;
  border-radius: 8px;
  padding: 0.5rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  margin-top: 1rem;
  text-decoration: none;
}

.btn-secondary:hover { background: #f5f4ff; border-color: #3C3489; text-decoration: none; }

/* ── Page header ─────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.page-header h2 { font-size: 1.25rem; font-weight: 700; }
.user-email { font-size: 0.8rem; color: #6b7280; }

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid #ddd9f5;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.hint {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

/* ── CV extracted ────────────────────────────────────────────────── */
.cv-ok {
  font-size: 0.85rem;
  color: #059669;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.cv-summary {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.cv-field {
  display: flex;
  gap: 2rem;
  font-size: 0.875rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid #f3f4f6;
  align-items: flex-start;
}

.cv-field:last-child { border-bottom: none; }

.cv-label {
  font-weight: 500;
  color: #374151;
  min-width: 140px;
  flex-shrink: 0;
}

.cv-hint { font-size: 0.8rem; color: #9ca3af; }

/* ── Tag input ───────────────────────────────────────────────────── */
.label-hint {
  font-size: 0.8rem;
  font-weight: 400;
  color: #9ca3af;
}

.tag-container {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  background: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  cursor: text;
  min-height: 42px;
  transition: border-color 0.15s;
}

.tag-container:focus-within {
  border-color: #7F77DD;
  box-shadow: 0 0 0 3px rgba(127,119,221,.18);
}

.tags-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.tag {
  background: #EEEDFE;
  color: #3C3489;
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.tag-remove {
  border: none;
  background: none;
  cursor: pointer;
  color: #AFA9EC;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
}

.tag-remove:hover { color: #534AB7; }

.tag-container input[type="text"] {
  border: none;
  outline: none;
  box-shadow: none;
  flex: 1;
  min-width: 150px;
  padding: 0.15rem 0.25rem;
  font-size: 0.875rem;
  background: transparent;
}

/* ── Run buttons row ─────────────────────────────────────────────── */
.run-buttons {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.run-buttons .btn-primary  { margin-top: 0; }
.run-buttons .btn-test     { margin-top: 0; }

/* Test Run (mock) button — grey so it's visually distinct from the real run */
.btn-test {
  display: inline-block;
  background: #fff;
  color: #6b7280;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
}

.btn-test:hover:not(:disabled) { background: #f9fafb; border-color: #9ca3af; }
.btn-test:disabled { opacity: 0.5; cursor: not-allowed; }

/* Cancel Run button — amber, appears during scraping/filtering only */
.btn-cancel {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  transition: background 0.15s;
}
.btn-cancel:hover:not(:disabled) { background: #fde68a; }
.btn-cancel:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Run status ──────────────────────────────────────────────────── */
.run-status {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  margin-top: 0.75rem;
}

.hidden { display: none !important; }

/* ── Results page ────────────────────────────────────────────────── */
.status-bar {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: #6b7280;
  gap: 1rem;
  flex-wrap: wrap;
}

.results-actions { display: flex; gap: 0.75rem; align-items: center; }
.results-actions .btn-primary { margin-top: 0; }
.results-actions .btn-secondary { margin-top: 0; }

.section-heading {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 1.5rem 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-heading.strong { color: #065f46; }
.section-heading.maybe  { color: #92400e; }

.count {
  border-radius: 999px;
  padding: 0.1em 0.5em;
  font-size: 0.75rem;
  font-weight: 700;
  color: #111;
}

.section-heading.strong .count {
  background: #6ee7b7;
}

.section-heading.maybe .count {
  background: #fcd34d;
}

/* ── Job cards ───────────────────────────────────────────────────── */
.job-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-left: 5px solid #d1d5db;
  border-radius: 8px;
  padding: 1.1rem 1.4rem;
  margin-bottom: 0.75rem;
  transition: box-shadow 0.15s;
}

.job-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }

.job-card.verdict-strong-match { border-left-color: #16a34a; }
.job-card.verdict-maybe        { border-left-color: #d97706; }
.job-card.verdict-skip         { border-left-color: #9ca3af; opacity: 0.75; }
.job-card.verdict-unknown      { border-left-color: #c4b5fd; }

.job-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.job-title {
  font-weight: 600;
  font-size: 0.975rem;
  display: block;
}

.job-company {
  font-size: 0.85rem;
  color: #374151;
  display: block;
  margin-top: 0.15rem;
}

.verdict-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25em 0.6em;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.verdict-strong-match .verdict-badge { background: #dcfce7; color: #15803d; font-weight: 700; }
.verdict-maybe        .verdict-badge { background: #fef9c3; color: #a16207; font-weight: 700; }
.verdict-skip         .verdict-badge { background: #f3f4f6; color: #4b5563; }
.verdict-unknown      .verdict-badge { background: #ede9fe; color: #5b21b6; }

.job-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.job-reason {
  font-size: 0.85rem;
  color: #374151;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.job-link {
  font-size: 0.85rem;
  font-weight: 500;
}

/* ── Skip section ────────────────────────────────────────────────── */
.skip-section {
  margin-top: 1.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  background: #fafafa;
}

.skip-section summary {
  cursor: pointer;
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
  list-style: none;
  user-select: none;
}

.skip-section summary::before { content: "▶  "; font-size: 0.65rem; }
.skip-section[open] summary::before { content: "▼  "; }
.skip-section[open] { padding-bottom: 1rem; }

/* ── Location & work preferences form ───────────────────────────── */
.prefs-radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.prefs-sectors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

/* Override the block-label default for inline checkbox/radio labels */
.prefs-option {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: #374151;
  cursor: pointer;
  margin-top: 0;
}

.prefs-option input[type="radio"],
.prefs-option input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex-shrink: 0;
}

/* ── Matching rule lists (profile page) ─────────────────────────── */
.matching-rule-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.matching-rule-list li {
  font-size: 0.875rem;
  color: #374151;
  padding-left: 0.75rem;
  position: relative;
}

.matching-rule-list li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: #9ca3af;
}

/* ── Empty state ─────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
  font-size: 0.95rem;
  line-height: 1.8;
}

/* ── Expand toggle button ──────────────────────────────────────── */
.btn-expand { background: none; border: none; color: #6b7280; font-size: 0.85rem; cursor: pointer; padding: 0 0.25rem; text-decoration: underline dotted; }
.btn-expand:hover { color: #374151; }

/* ── Filter note ─────────────────────────────────────────────────── */
.filter-note {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 1rem;
}

/* ── App footer ──────────────────────────────────────────────────── */
.app-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.5rem 1rem;
  margin-top: 2rem;
  font-size: 0.75rem;
  color: #9ca3af;
  border-top: 1px solid #ddd9f5;
}
.footer-legal a {
  color: #9ca3af;
  text-decoration: none;
}
.footer-legal a:hover {
  color: #6b7280;
}

@media (max-width: 480px) {
  .app-footer { flex-direction: column; gap: 0.4rem; text-align: center; }
}

/* ── Legal pages (Impressum / Datenschutz) ───────────────────────── */
.legal-page {
  max-width: 680px;
  margin: 2rem auto;
  padding: 0 1rem;
}
.legal-page h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.legal-page h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}
.legal-subtitle {
  color: #9ca3af;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}
.legal-dl dt {
  font-weight: 600;
  margin-top: 0.75rem;
}
.legal-dl dd {
  margin-left: 0;
  color: #374151;
}
.legal-note {
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  background: #f9fafb;
  border-left: 3px solid #e5e7eb;
  border-radius: 4px;
  font-size: 0.875rem;
  color: #6b7280;
}

/* ── Landing page ────────────────────────────────────────────────── */
.landing-hero {
  text-align: center;
  padding: 4rem 1rem 3rem;
  max-width: 680px;
  margin: 0 auto;
}

.landing-hero h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  color: #111827;
  margin-bottom: 1.25rem;
}

.landing-hero > p {
  font-size: 1.05rem;
  color: #4b5563;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.landing-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.landing-buttons .btn-primary,
.landing-buttons .btn-secondary { margin-top: 0; }

.landing-beta {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-top: 1.5rem;
}

.landing-steps-wrapper {
  max-width: 900px;
  margin: 3rem auto;
  padding: 0 1rem 2rem;
}

.landing-steps-heading {
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  color: #374151;
  margin-bottom: 1.5rem;
}

.landing-steps {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.25rem;
}

.landing-step {
  background: #fff;
  border: 1px solid #ddd9f5;
  border-radius: 10px;
  padding: 1.5rem;
}

.landing-step-number {
  font-size: 2.25rem;
  font-weight: 700;
  color: #3C3489;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.landing-step h3 {
  font-size: 0.975rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #111827;
}

.landing-step p {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .landing-hero h1 { font-size: 1.5rem; }
  .landing-steps   { grid-template-columns: 1fr; }
}
