/* Contriqa Scan S - Huisstijl afgeleid van Contriqa Scan (accessscan-local) */
/* Bron: /Users/lieuwehoitinga/Projects/accessscan-local/src/idscan/interfaces/templates/base.html */
/* Bron: /Users/lieuwehoitinga/Projects/accessscan-local/src/idscan/interfaces/static/scan-shell.css */

:root {
  /* CONTRIQA brand colors - exacte kopie uit scan-shell.css */
  --cq-midnight: #102a43;
  --cq-teal: #00a6a6;
  --cq-deep-slate: #243b53;
  --cq-text: #243b53;
  --cq-background: #f7f9fa;
  --cq-surface: #fff;
  --cq-mist: #eef3f5;
  --cq-slate: #64748b;
  --cq-muted: #586a80;
  --cq-border: #d6e0e5;
  --cq-field-border: #82939f;
  --cq-selection-surface: #e8f6f6;
  --cq-success: #27ae88;
  --cq-success-text: #16654f;
  --cq-success-surface: #eaf7f2;
  --cq-warning: #f2b84b;
  --cq-warning-text: #79520b;
  --cq-warning-surface: #fff6e3;
  --cq-error: #e76f51;
  --cq-error-text: #993c28;
  --cq-error-surface: #fff0ec;
  --cq-info: #3b82b6;
  
  color-scheme: light;
}

/* Base reset */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Aptos", "Calibri", system-ui, -apple-system, sans-serif;
  background: var(--cq-background);
  color: var(--cq-text);
  line-height: 1.5;
}

/* Skip link - voor toegankelijkheid */
.skip-to-content {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: .75rem 1rem;
  background: white;
  color: var(--cq-midnight);
}

.skip-to-content:focus {
  top: .5rem;
}

/* Header - exacte kopie van base.html stylen */
header {
  background: var(--cq-surface);
  padding: .8rem max(2vw, 1rem);
  border-bottom: 3px solid var(--cq-teal);
}

header .shell {
  max-width: 2400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header .brand-lockup {
  min-width: 0;
  gap: 1.4rem;
  display: flex;
  align-items: center;
}

.brand-logo-wrap {
  background: transparent;
  border-radius: 0;
  padding: 0;
  min-height: 0;
  flex: 0 0 auto;
}

.brand-logo {
  width: 13rem;
  max-width: 13rem;
  height: auto;
  max-height: none;
  display: block;
}

header .brand-lockup > div {
  border-left: 1px solid var(--cq-border);
  padding-left: 1.4rem;
}

header h1 {
  font-family: inherit;
  font-size: .88rem;
  font-weight: 400;
  color: var(--cq-muted);
  margin: .15rem 0;
}

.eyebrow {
  color: var(--cq-midnight);
  font-size: .91rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* Main content - dichtheid conform opgegeven waarden */
main {
  box-sizing: border-box;
  width: 96%;
  max-width: 2400px;
  margin: 0 auto;
  padding: .8rem 1.25rem 3rem;
}

/* Typography */
h1 {
  font-size: 1.65rem;
  line-height: 1.25;
  letter-spacing: -.025em;
  font-family: "Aptos Display", "Aptos", "Calibri", system-ui, sans-serif;
  color: var(--cq-midnight);
  font-weight: 700;
  margin-top: 0;
}

h2 {
  font-size: 1.28rem;
  line-height: 1.35;
  font-family: "Aptos Display", "Aptos", "Calibri", system-ui, sans-serif;
  color: var(--cq-midnight);
  font-weight: 600;
  margin-top: 0;
}

h3 {
  font-size: 1.06rem;
  margin-top: 0;
}

h4 {
  font-size: .98rem;
}

p {
  max-width: 85ch;
}

a {
  color: var(--cq-deep-slate);
  text-underline-offset: .2em;
}

/* Cards - conform base.html:18 (inline L) */
.card {
  border-color: var(--cq-border);
  border: 1px solid var(--cq-border);
  border-radius: 12px;
  box-shadow: 0 2px 10px #18213b0d;
  padding: 1.1rem 1.25rem;
  margin: .75rem 0;
  background: var(--cq-surface);
}

.card h2 {
  margin: .35rem 0 .5rem;
}

.card h3 {
  margin: 1rem 0 .1rem;
  font-size: 1rem;
}

.card p {
  margin: .45rem 0;
}

.card .card {
  box-shadow: none;
  background: var(--cq-background);
}

/* Muted text */
.muted, .help {
  color: var(--cq-muted);
}

/* Buttons - exacte kopie */
button, .button-link {
  border-radius: 7px;
  font-weight: 650;
  min-height: 44px;
  box-sizing: border-box;
  cursor: pointer;
  border: 0;
  font: inherit;
  padding: .7rem 1rem;
}

button:not(.secondary), .button-link:not(.secondary-link) {
  background: var(--cq-midnight);
  color: white;
}

button:not(.secondary):hover:not(:disabled), .button-link:not(.secondary-link):hover {
  background: var(--cq-deep-slate);
}

button.secondary, .button-link.secondary-link {
  background: var(--cq-mist);
  color: var(--cq-midnight);
  border: 1px solid var(--cq-field-border);
}

button.secondary:hover:not(:disabled), .button-link.secondary-link:hover {
  background: var(--cq-selection-surface);
  border-color: var(--cq-teal);
}

button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* Focus states */
:focus-visible {
  outline: 3px solid var(--cq-deep-slate);
  outline-offset: 3px;
}

/* Grid layout - conform scan-shell.css */
.grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* Antwoordopties (stap 2) */
.antwoord-opties {
  grid-template-columns: repeat(5, 1fr);
  gap: .5rem;
  margin-top: .25rem;
}

.antwoord-opties input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.antwoord-optie {
  display: block;
  padding: .4rem;
  background: var(--cq-mist);
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  text-align: center;
  font-size: .78rem;
  font-weight: 400;
  margin: 0;
}

/* Form elements */
form {
  margin: 0;
  max-width: 860px;
}

form .actions {
  max-width: none;
}

label {
  font-size: .92rem;
  display: block;
  font-weight: 650;
  margin: .55rem 0 .15rem;
}

input, select, textarea {
  background: #fff;
  color: var(--cq-text);
  border-color: var(--cq-field-border);
  border: 1px solid var(--cq-field-border);
  border-radius: 7px;
  box-sizing: border-box;
  display: block;
  font: inherit;
  margin-top: .25rem;
  padding: .5rem .6rem;
  width: 100%;
}

input[type="checkbox"], input[type="radio"] {
  accent-color: var(--cq-midnight);
  display: inline-block;
  width: auto;
  margin-right: .5rem;
}

/* Radio button selection highlight (for stap2 grid layout) */
input[type="radio"]:checked + label {
  background: var(--cq-selection-surface);
  border: 1px solid var(--cq-teal);
}

textarea {
  min-height: 5.5rem;
  resize: vertical;
}

/* Badges */
.badge {
  display: inline-block;
  border-radius: 999px;
  background: #e9edf8;
  color: #314575;
  padding: .35rem .7rem;
  font-size: .85rem;
}

.badge.decided {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

/* Form errors - conform L (base.html:117 + scan-shell.css:125 override) */
.form-error, [role="alert"] {
  background: var(--cq-error-surface);
  color: var(--cq-error-text);
  border: 1px solid var(--cq-error);
  border-left: 4px solid var(--cq-error);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  overflow-wrap: anywhere;
}

/* Foutmelding in scan-start - conform scan-shell.css:123 */
.scan-start-error {
  color: var(--cq-error-text);
}

.invalid-field {
  border: 2px solid #b42b3f;
}

[role="status"] {
  background: #edf7f3;
  color: #176b45;
  border-left: 4px solid #176b45;
  border-radius: 8px;
  padding: 1rem;
}

/* Scan progress */
.scan-progress {
  display: grid;
  gap: .45rem;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
}

.scan-progress li {
  padding: 0.5rem;
  border-bottom: 3px solid transparent;
  border-radius: 6px 6px 0 0;
  background: var(--cq-mist);
  min-width: 0;
}

.scan-progress a {
  align-items: center;
  color: var(--cq-muted);
  display: flex;
  gap: .45rem;
  min-height: 2.7rem;
  overflow-wrap: anywhere;
  padding: .5rem .6rem;
  text-decoration: none;
}

.scan-progress small {
  display: block;
  margin-top: .25rem;
  font-size: .78rem;
  font-weight: 400;
}

.scan-progress-icon {
  align-items: center;
  border: 1px solid var(--cq-field-border);
  border-radius: 50%;
  display: inline-flex;
  flex: 0 0 1.35rem;
  font-size: .78rem;
  height: 1.35rem;
  justify-content: center;
}

.scan-progress li.is-complete {
  background: var(--cq-success-surface);
}

.scan-progress li.is-complete a,
.scan-progress li.is-complete .scan-progress-icon {
  color: var(--cq-success-text);
}

.scan-progress li.is-current {
  background: var(--cq-surface);
  border-bottom-color: var(--cq-midnight);
  box-shadow: 0 0 0 1px #00a6a626;
}

.scan-progress li.is-current a {
  color: var(--cq-midnight);
  font-weight: 700;
}

.scan-progress li.is-current .scan-progress-icon {
  background: var(--cq-midnight);
  border-color: var(--cq-midnight);
  color: #fff;
}

/* Scan status */
.scan-status {
  background: #edf7f3;
  border: 1px solid #b9ddd0;
  border-left: 4px solid #176b68;
  border-radius: 9px;
  margin: 1rem 0;
  padding: .9rem 1rem;
}

.scan-status strong {
  color: #176b45;
  display: block;
  margin-bottom: .25rem;
}

.scan-status p {
  margin: 0;
}

/* Details/summary */
details {
  border-color: var(--cq-border);
  padding-top: .85rem;
  margin-top: .85rem;
}

summary {
  color: var(--cq-deep-slate);
  padding: .35rem 0;
  min-height: 28px;
  cursor: pointer;
  font-weight: 650;
}

details[open] > summary {
  margin-bottom: .85rem;
}

/* scan-consent - conform base.html:29-30 (inline L) */
.scan-consent {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  font-weight: 400;
  cursor: pointer;
}

.scan-consent input {
  width: auto;
  flex: 0 0 auto;
}

/* Actions */
.actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: .9rem;
}

.actions form {
  display: inline;
}

/* Field help */
.field-note {
  color: #667085;
  display: block;
  font-size: .78rem;
  font-weight: 400;
  margin-top: .25rem;
}

/* Status classes */
.status-positive {
  color: var(--cq-success-text);
  font-weight: 650;
}

.status-warning {
  color: var(--cq-warning-text);
  font-weight: 650;
}

/* Notice warning - conform base.html:119 (inline L) */
.notice-warning {
  background: var(--cq-warning-surface);
  border: 1px solid var(--cq-warning);
  border-left: 4px solid var(--cq-warning);
  border-radius: 8px;
  color: var(--cq-warning-text);
  padding: 1rem;
  margin: 1rem 0;
}

/* Maturity levels */
.state-pill {
  border-radius: 999px;
  display: inline-block;
  font-size: .82rem;
  font-weight: 650;
  padding: .32rem .55rem;
  white-space: nowrap;
}

.state-established {
  background: #dff4e9;
  color: var(--cq-success-text);
}

.state-partially_established {
  background: #fff0cf;
  color: var(--cq-warning-text);
}

.state-not_established {
  background: #fbe2e4;
  color: #a22638;
}

/* Resultaat-onderdelen (stap 3/4) */
.card h1 {
  font-size: 1.5rem;
  margin: 0 0 .5rem;
}

.domein-kop {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.domein-kop h3 {
  margin: 0;
}

.domein-kop .badge,
.card h3 .badge {
  font-size: .7rem;
}

.score-domein {
  padding-bottom: .75rem;
  margin-bottom: .75rem;
  border-bottom: 1px solid var(--cq-border);
}

.score-domein:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.actielijst {
  padding-left: 1.5rem;
}

.actielijst li {
  margin-bottom: .65rem;
}

/* Score bars */
.score-bar-container {
  margin-top: 0.5rem;
}

.score-bar-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--cq-muted);
}

.score-bar {
  height: 24px;
  background-color: var(--cq-mist);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.score-fill {
  height: 100%;
  border-radius: 12px;
  transition: width 0.3s;
}

.score-fill.score-niet-geregeld {
  background-color: #fbe2e4;
  color: #8c1f2e;
}

.score-fill.score-instap {
  background-color: #ffe8cf;
  color: #934d00;
}

.score-fill.score-bezig {
  background-color: #fff2bf;
  color: #765700;
}

.score-fill.score-geregeld {
  background-color: #dff1de;
  color: #27633b;
}

.score-value {
  font-weight: 650;
  text-align: right;
  color: var(--cq-text);
}

/* Flash messages */
.flash-messages {
  margin-bottom: 1.5rem;
}

.flash {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
}

.flash-success {
  background: var(--cq-success-surface);
  color: var(--cq-success-text);
  border: 1px solid #b9ddd0;
  border-left: 4px solid var(--cq-success);
}

.flash-error {
  background: var(--cq-error-surface);
  color: var(--cq-error-text);
  border: 1px solid #e9a8b2;
  border-left: 4px solid var(--cq-error);
}

.flash-warning {
  background: var(--cq-warning-surface);
  color: var(--cq-warning-text);
  border: 1px solid #d8a149;
  border-left: 4px solid var(--cq-warning);
}

/* Responsive */
@media (max-width: 640px) {
  header {
    padding: .8rem 1rem;
  }
  
  main {
    padding: 1.25rem .8rem 3rem;
    width: 100%;
  }
  
  .card {
    padding: 1.1rem;
  }
  
  .scan-progress {
    grid-template-columns: 1fr 1fr;
  }
  
  .scan-progress li:last-child {
    grid-column: 1 / -1;
  }

  .antwoord-opties {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    background: white;
  }
  
  header {
    border-bottom: 1px solid #ccc;
    margin-bottom: 1rem;
  }
  
  main {
    max-width: 100%;
    padding: 0;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
  }
  
  button, .button-link {
    display: none;
  }
  
  .actions {
    display: none;
  }
}

/* Merkblok: variante-letter prominent + versiechip (familie-look Scan L,
   eigen S-huisstijl: accentkleur uit --cq-teal) */
.eyebrow .product-variant {
  color: var(--cq-teal);
  font-weight: 800;
}

.eyebrow .product-version {
  color: var(--cq-muted);
  font-weight: 600;
  font-size: .8em;
  margin-left: .35em;
}

/* Uitlog-knop in de header (alleen zichtbaar bij ingelogde consultant) */
.scan-logout-form {
  margin: 0;
}

.scan-logout-button {
  font-size: .8rem;
  padding: .35rem .8rem;
}
