/* Color tokens (--color-*, --font-family, --radius) and the "scan results"
   component classes (.stat-tile, .checklist, .profile-card, etc.) now live
   in report.css, shared with the admin scan detail page -- report.css must
   be linked before this file (see form.html). */

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-fg);
}

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
  min-height: 480px;
}

h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 0.4rem; }
.subtitle { color: var(--color-muted); margin: 0 0 1.5rem; font-size: 1.05rem; }

.steps-dots {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 2rem;
}
.steps-dots .dot {
  height: 6px;
  flex: 1;
  border-radius: 999px;
  background: var(--color-track);
}
.steps-dots[data-step="1"] .dot:nth-child(1) { background: var(--color-accent); }
.steps-dots[data-step="2"] .dot:nth-child(-n+2) { background: var(--color-accent); }

.back-link, .restart-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 1rem;
}
.back-link:hover, .restart-link:hover { color: var(--color-fg); }

form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.optional-hint { font-weight: 400; color: var(--color-muted); font-size: 0.85rem; }

label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 700;
}

input, select, textarea {
  font: inherit;
  font-size: 1.05rem;
  padding: 0.85rem 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-fg);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-fg);
}

.autocomplete-wrap { position: relative; }
.autocomplete-list {
  position: absolute;
  top: calc(100% + 0.3rem);
  left: 0;
  right: 0;
  z-index: 5;
  margin: 0;
  padding: 0.4rem 0;
  list-style: none;
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.autocomplete-list li {
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-weight: 600;
}
.autocomplete-list li:hover,
.autocomplete-list li.active {
  background: var(--color-track);
}

.candidate-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.candidate-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
}
.candidate-info { min-width: 0; }
.candidate-name { font-weight: 800; margin: 0 0 0.2rem; }
.candidate-meta { margin: 0; font-size: 0.85rem; color: var(--color-muted); }
.candidate-item .btn-sm-pick {
  flex: 0 0 auto;
  font-size: 0.9rem;
  padding: 0.6rem 1rem;
  background: var(--color-accent);
  color: var(--color-accent-contrast);
}

.btn-plain {
  width: 100%;
  background: none;
  color: var(--color-muted);
  border: 2px solid var(--color-border);
  font-weight: 700;
  font-size: 0.9rem;
}
.btn-plain:hover:not(:disabled) { color: var(--color-fg); border-color: var(--color-fg); }

button {
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 0.9rem 1.25rem;
  border: none;
  /* Full pill, not var(--radius) -- clickables.nl's own CTA buttons
     ("Plan een marketingadvies", "Doe de lokale vindbaarheidscheck") are
     fully rounded, not moderately-rounded rectangles. */
  border-radius: 999px;
  /* Accent orange by default, not var(--color-fg)/black -- every step's
     primary action (Volgende, Genereer mijn rapport, Dit ben ik) is the
     step's main CTA, matching clickables.nl's own orange CTA buttons.
     Secondary/tertiary actions (.btn-plain, .action-btn, .restart-link)
     already override this with their own outline/plain styling below. */
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.15s ease;
}
button:hover:not(:disabled) { transform: translateY(-1px); }
button:disabled { opacity: 0.4; cursor: not-allowed; }

.error {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: #fde8e8;
  color: #b91c1c;
  font-weight: 600;
}
.error.hidden, [hidden] { display: none !important; }

.loading { margin-top: 1rem; }
.loading-label { color: var(--color-muted); font-weight: 600; margin: 0 0 0.6rem; }

.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--color-track);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--color-accent);
  transition: width 0.3s ease;
}
.progress-percent {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-muted);
  text-align: right;
}

/* Step 3 -- full-screen-feeling results panel */
.panel-results {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 70vh;
  justify-content: center;
}

.results-actions {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.consult-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  max-width: 260px;
}
.consult-caption {
  margin: 0;
  font-size: 0.78rem;
  color: var(--color-muted);
  text-align: right;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 2px solid var(--color-border);
  color: var(--color-fg);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.action-btn:hover { border-color: var(--color-fg); transform: none; }
.action-btn-primary,
.action-btn-primary:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-accent-contrast);
}

.email-popover {
  align-self: flex-end;
  max-width: 320px;
  margin: 0 0 1.5rem;
  padding: 1.1rem 1.25rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
}
.email-popover p { font-weight: 700; margin: 0 0 0.75rem; font-size: 0.9rem; }
.email-popover form { gap: 0.6rem; }
.email-status { margin-top: 0.75rem; font-weight: 600; color: var(--color-accent); }
.email-status.error { color: #b91c1c; }

@media (max-width: 480px) {
  .email-popover { max-width: 100%; }
}

.restart-link { margin-top: 2rem; align-self: flex-start; }
