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

:root {
  /* Colour tokens — adesso-inspired dark */
  --bg:            #0b0c0e;
  --bg-card:       #13151a;
  --bg-card-2:     #0f1114;
  --accent:        #1a80d4;
  --accent-dark:   #1268b3;
  --accent-glow:   rgba(26, 128, 212, 0.15);
  --text:          #f0f1f2;
  --text-muted:    #7a8898;
  --border:        rgba(255, 255, 255, 0.06);
  --border-bright: rgba(255, 255, 255, 0.10);

  /* Answer colours */
  --ans-yes:       #1e5c35;
  --ans-prob-yes:  #2c6230;
  --ans-dk:        #1e2e40;
  --ans-prob-no:   #5c3010;
  --ans-no:        #5c1818;

  /* Rank colours */
  --gold:   #c9a84c;
  --silver: #8e8e9a;
  --bronze: #9a5424;

  /* Layout */
  --h-pad:  20px;
  --radius: 10px;

  /* Typography — Inter only */
  --font-display: 'Inter', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* ── Screen system ──────────────────────────────────────────── */
.screen {
  display: none;
  position: relative;
  min-height: 100dvh;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
}

.screen.active {
  display: block;
}

.screen-inner {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  min-height: 100vh;
  padding-top: env(safe-area-inset-top, 16px);
  padding-bottom: env(safe-area-inset-bottom, 16px);
  padding-left: var(--h-pad);
  padding-right: var(--h-pad);
}

/* ── Landing background — subtle dot grid ───────────────────── */
.stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.stars::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 28px 28px;
}

.stars::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 55% at 50% 0%, rgba(26, 128, 212, 0.07) 0%, transparent 65%);
}


/* ── Progress bar ───────────────────────────────────────────── */
.progress-bar-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border);
  z-index: 100;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 300ms ease;
}

/* ── Landing screen ─────────────────────────────────────────── */
#screen-landing {
  position: relative;
}

.landing-inner {
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding-top: 48px;
  padding-bottom: 48px;
  position: relative;
  z-index: 1;
}

.landing-text {
  text-align: center;
}

.logo {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 11vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.05;
  margin-bottom: 14px;
}

.tagline {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 280px;
  margin: 0 auto;
  line-height: 1.65;
  font-weight: 400;
}

/* ── Primary button ─────────────────────────────────────────── */
.btn-primary {
  display: block;
  width: 100%;
  min-height: 54px;
  background: var(--accent);
  color: #fff;
  font-size: 0.975rem;
  font-weight: 600;
  border-radius: var(--radius);
  letter-spacing: 0.01em;
  transition: background 150ms ease, transform 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:active {
  transform: scale(0.97);
  background: var(--accent-dark);
}

.btn-primary:disabled {
  background: var(--bg-card-2);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ── Ghost button ───────────────────────────────────────────── */
.btn-ghost {
  display: block;
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border-bright);
  color: var(--text-muted);
  font-size: 0.9rem;
  border-radius: var(--radius);
  transition: border-color 150ms ease, color 150ms ease;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--text);
}

.btn-sm {
  min-height: 44px;
  font-size: 0.875rem;
}

/* ── Filter screens ─────────────────────────────────────────── */
.filter-inner {
  padding-top: 40px;
  gap: 0;
}

.filter-header {
  padding-bottom: 24px;
  flex-shrink: 0;
}

.filter-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* Type pills */
.type-pills {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.type-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px var(--h-pad);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
  -webkit-tap-highlight-color: transparent;
  text-align: left;
}

.type-pill:active {
  transform: scale(0.99);
}

.type-pill.selected {
  border-color: var(--accent);
  background: rgba(26, 128, 212, 0.08);
}

.type-pill .pill-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.type-pill .pill-count {
  font-size: 0.825rem;
  color: var(--text-muted);
}

/* Filter footer */
.filter-footer {
  flex-shrink: 0;
  padding-top: 16px;
  padding-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Location controls */
.location-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--h-pad);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  gap: 12px;
}

.toggle-label {
  font-size: 0.95rem;
  color: var(--text);
}

.toggle-wrap {
  position: relative;
  flex-shrink: 0;
}

.toggle-wrap input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  display: block;
  width: 44px;
  height: 26px;
  background: var(--bg-card-2);
  border: 1px solid var(--border-bright);
  border-radius: 13px;
  cursor: pointer;
  transition: background 200ms ease;
}

.toggle-track .toggle-thumb {
  display: block;
  width: 20px;
  height: 20px;
  background: var(--text-muted);
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 200ms ease, background 200ms ease;
}

input:checked ~ .toggle-track {
  background: rgba(26, 128, 212, 0.25);
  border-color: var(--accent);
}

input:checked ~ .toggle-track .toggle-thumb {
  transform: translateX(18px);
  background: var(--accent);
}

/* City list */
.city-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 calc(-1 * var(--h-pad));
  padding: 0 var(--h-pad);
}

/* Location page: Fertig footer always visible at the bottom */
#screen-filter-location .filter-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px var(--h-pad) max(env(safe-area-inset-bottom, 0px), 16px);
  background: var(--bg);
  border-top: 1px solid var(--border-bright);
  z-index: 50;
}

/* Extra bottom padding so last city isn't hidden behind the sticky footer */
#screen-filter-location .city-list {
  padding-bottom: 130px;
}

.city-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.city-item:last-child {
  border-bottom: none;
}

.city-checkbox {
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--border-bright);
  border-radius: 5px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 150ms ease, background 150ms ease;
}

.city-item.checked .city-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.city-checkbox::after {
  content: '';
  display: none;
  width: 6px;
  height: 10px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

.city-item.checked .city-checkbox::after {
  display: block;
}

.city-name {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text);
}

.city-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.city-section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 16px 0 8px;
}

.city-section-toggle {
  width: 100%;
  text-align: left;
  padding: 14px 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1px solid var(--border);
}

.city-count-selected {
  font-size: 0.825rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ── Thinking screen ────────────────────────────────────────── */
.thinking-inner {
  align-items: center;
  justify-content: center;
  gap: 32px;
  text-align: center;
}

.thinking-text {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 260px;
  line-height: 1.65;
  animation: fade-in 0.5s ease;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Question screen ────────────────────────────────────────── */
.question-inner {
  padding-top: 24px;
  gap: 20px;
  align-items: center;
}

.question-card {
  width: 100%;
  text-align: center;
  padding: 0 4px;
}

.question-meta {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.question-text {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.55;
}

.answer-buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ans-btn {
  width: 100%;
  min-height: 54px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.01em;
  transition: transform 120ms ease, opacity 120ms ease;
  -webkit-tap-highlight-color: transparent;
  border: 1px solid transparent;
}

.ans-btn.ans-yes      { background: var(--ans-yes); }
.ans-btn.ans-prob-yes { background: var(--ans-prob-yes); }
.ans-btn.ans-dk       { background: var(--ans-dk); }
.ans-btn.ans-prob-no  { background: var(--ans-prob-no); }
.ans-btn.ans-no       { background: var(--ans-no); }

.ans-btn.pressed {
  transform: scale(0.97);
  opacity: 0.8;
}

.ans-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.jobs-counter {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding-bottom: 8px;
}

/* ── Results screen ─────────────────────────────────────────── */
.results-inner {
  padding-top: 24px;
  gap: 16px;
  align-items: center;
}

.results-heading {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  text-align: center;
}

.results-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Job card */
.job-card {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  overflow: hidden;
  width: 100%;
}

.card-accent-bar {
  height: 3px;
  width: 100%;
}

.rank-1 .card-accent-bar { background: var(--gold); }
.rank-2 .card-accent-bar { background: var(--silver); }
.rank-3 .card-accent-bar { background: var(--bronze); }
.rank-4 .card-accent-bar,
.rank-5 .card-accent-bar { background: var(--border-bright); }

.card-body {
  padding: 14px 16px;
}

.card-rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.rank-badge {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.rank-1 .rank-badge { color: var(--gold); }
.rank-2 .rank-badge { color: var(--silver); }
.rank-3 .rank-badge { color: var(--bronze); }
.rank-4 .rank-badge,
.rank-5 .rank-badge { color: var(--text-muted); }

.match-bar-wrap {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.match-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 600ms ease;
}

.rank-1 .match-bar { background: var(--gold); }
.rank-2 .match-bar { background: var(--silver); }
.rank-3 .match-bar { background: var(--bronze); }
.rank-4 .match-bar,
.rank-5 .match-bar { background: var(--text-muted); }

.match-pct {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.card-title {
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.4;
}

.card-company {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.card-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-card-2);
  border: 1px solid var(--border);
}

.btn-apply {
  display: block;
  width: 100%;
  min-height: 46px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  text-align: center;
  text-decoration: none;
  line-height: 46px;
  transition: background 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-apply:active {
  background: var(--accent-dark);
}

.btn-restart {
  margin-top: 8px;
  margin-bottom: 16px;
}

.btn-weitere-matches {
  width: 100%;
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.weitere-matches-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.weitere-matches-wrap[hidden] { display: none; }

.weitere-matches-wrap .job-card {
  opacity: 0.75;
}

/* ── Cookie banner ──────────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: max(env(safe-area-inset-bottom, 0px), 16px);
  left: var(--h-pad);
  right: var(--h-pad);
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 998;
  animation: slide-up 300ms ease;
  max-width: 480px;
  margin: 0 auto;
}

.cookie-banner[hidden] { display: none; }

.cookie-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.cookie-actions {
  display: flex;
  gap: 10px;
}

/* ── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: max(env(safe-area-inset-bottom, 0px), 16px);
  left: var(--h-pad);
  right: var(--h-pad);
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 0.875rem;
  color: var(--text);
  display: none;
  flex-direction: column;
  gap: 10px;
  z-index: 999;
  animation: slide-up 250ms ease;
}

.toast.visible {
  display: flex;
}

@keyframes slide-up {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.toast-retry {
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  padding: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

/* ── Language toggle ─────────────────────────────────────────── */
.lang-toggle {
  position: absolute;
  top: max(env(safe-area-inset-top, 0px), 16px);
  right: var(--h-pad);
  z-index: 2;
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: 6px;
  overflow: hidden;
}

.lang-btn {
  padding: 6px 11px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease;
}

.lang-btn.active {
  color: #fff;
  background: var(--accent);
}

/* ── Legal footer ────────────────────────────────────────────── */
.landing-footer {
  position: absolute;
  bottom: max(env(safe-area-inset-bottom, 0px), 14px);
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 1;
}

.link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 4px;
  opacity: 0.7;
  transition: opacity 150ms ease;
}

.link-btn:hover {
  opacity: 1;
}

.footer-sep {
  color: var(--border-bright);
  font-size: 0.72rem;
  user-select: none;
}

/* ── Modals ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade-in 180ms ease;
}

.modal-overlay[hidden] {
  display: none;
}

.modal-sheet {
  width: 100%;
  max-height: 88dvh;
  max-height: 88vh;
  background: var(--bg-card);
  border-top: 1px solid var(--border-bright);
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  animation: slide-up 280ms ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--h-pad) 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-card-2);
  color: var(--text-muted);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-bright);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 150ms ease;
}

.modal-close:hover { color: var(--text); }

.modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px var(--h-pad) max(env(safe-area-inset-bottom, 0px), 28px);
  flex: 1;
}

/* Legal content typography */
.legal-content {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.legal-content h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin: 18px 0 5px;
}

.legal-content h3:first-child { margin-top: 0; }

.legal-content p { margin-bottom: 8px; }

.legal-content a {
  color: var(--accent);
  text-underline-offset: 2px;
}

.legal-placeholder {
  display: inline-block;
  background: rgba(220, 120, 40, 0.12);
  border: 1px solid rgba(220, 120, 40, 0.28);
  color: #d4845a !important;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 0.78rem !important;
  font-style: italic;
  margin-bottom: 14px !important;
}
