:root {
  /* --- TruSteel Group huisstijl: kleuren --- */
  --color-white: #ffffff;
  --color-anthracite: #2b2b2b;
  --color-anthracite-light: #484849;
  --color-anthracite-gradient: linear-gradient(155deg, var(--color-anthracite) 0%, var(--color-anthracite-light) 100%);
  --color-grey-light: #eeeded;
  --color-grey-gradient: linear-gradient(180deg, var(--color-grey-light) 0%, #ffffff 100%);
  --color-red: #d21231;
  --color-red-dark: #a20e26;
  --color-border: #e2dfdf;
  --color-text: #2b2b2b;
  --color-muted: #6f6b6b;
  --color-danger-bg: #fbe7e9;

  /* statuskleuren (functioneel, blijven herkenbaar naast het accentrood) */
  --color-ok: #2e7d32;
  --color-nok: var(--color-red);
  --color-na: #8a8686;

  /* --- Typografie --- */
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Archivo Black", "Arial Narrow Bold", "Arial Black", Impact, var(--font-body);

  /* --- Vormtaal: asymmetrische afronding (2 tegenover elkaar liggende hoeken), TruSteel-signatuur --- */
  --shape-radius: 18px;
  --shape: var(--shape-radius) 4px var(--shape-radius) 4px;
  --shape-sm: 10px 3px 10px 3px;

  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-grey-gradient);
  background-attachment: fixed;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-anthracite-gradient);
  color: #fff;
  padding: 12px 16px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 1rem;
}
.app-header-title { display: flex; align-items: center; gap: 12px; }
.app-header-logo {
  height: 30px;
  width: auto;
  display: block;
}
.icon-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  padding: 6px 8px;
  cursor: pointer;
}
.icon-btn:hover { color: var(--color-red); }

/* Progress */
.progress-wrap {
  position: sticky;
  top: 54px;
  z-index: 19;
  background: var(--color-white);
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--color-border);
}
.progress-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--color-grey-light);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--color-red);
  transition: width 0.25s ease;
}
.progress-label {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--color-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Main */
.app-main {
  padding: 16px 16px calc(96px + var(--safe-bottom));
  max-width: 640px;
  margin: 0 auto;
  min-height: 60vh;
}
.app-main.full-bleed {
  padding: 0;
  max-width: none;
}

.centered-message {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-muted);
}
.error-text { color: var(--color-red); }

.step-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 900;
  font-size: 1.3rem;
  margin: 4px 0 18px;
  color: var(--color-anthracite);
}
.step-subtitle {
  color: var(--color-muted);
  text-align: center;
  line-height: 1.5;
}

/* Selecteerbare lijst (startscherm: project + checklist-type kiezen) */
.select-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.select-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: var(--shape);
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  color: var(--color-text);
}
.select-tile-name { flex: 1; }
.select-tile.selected {
  border-color: var(--color-red);
  background: #fdecee;
  color: var(--color-red-dark);
}
.select-tile.disabled {
  cursor: not-allowed;
  color: var(--color-muted);
  background: var(--color-grey-light);
  border-color: var(--color-border);
}
.select-tile-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-muted);
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--shape-sm);
  padding: 3px 8px;
  flex-shrink: 0;
}

/* Fields */
.field { margin-bottom: 16px; }
.field label, .small-label {
  display: block;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
  color: var(--color-anthracite);
}
.field input[type="text"],
.field input[type="email"],
.field input[type="date"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: var(--font-body);
  background: var(--color-white);
  color: var(--color-text);
}
.field input:focus {
  outline: none;
  border-color: var(--color-red);
  box-shadow: 0 0 0 2px rgba(210, 18, 49, 0.15);
}
.field input:disabled {
  background: var(--color-grey-light);
  color: var(--color-muted);
}
.checkbox-field {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 14px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--shape-sm);
  font-weight: 500;
  line-height: 1.4;
}
.checkbox-field input[type="checkbox"] {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  accent-color: var(--color-red);
}
.checkbox-field .select-tile-badge { margin-left: auto; }

.settings-block {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

/* Error banner */
.error-banner {
  background: var(--color-danger-bg);
  color: var(--color-red-dark);
  border: 1px solid #f0b8bf;
  padding: 12px 14px;
  border-radius: var(--shape-sm);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.info-banner {
  background: var(--color-grey-light);
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  padding: 12px 14px;
  border-radius: var(--shape-sm);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.5;
  margin: 4px 0 0;
}

/* Item cards */
.item-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--shape);
  padding: 14px;
  margin-bottom: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.item-card-error {
  border-color: var(--color-red);
  box-shadow: 0 0 0 2px rgba(210, 18, 49, 0.15);
}
.item-card-hold {
  background: var(--color-anthracite-gradient);
  border-color: var(--color-anthracite);
  color: #fff;
  border-left: 4px solid var(--color-red);
}
.item-card-header {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 12px;
}
.item-number {
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--color-red);
  min-width: 34px;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.item-card-hold .item-number { color: var(--color-red); }
.item-text { font-weight: 500; line-height: 1.4; }
.item-card-hold .item-text { color: #fff; }
.item-card-hold .small-label { color: #e6e6e6; }

.result-group {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.result-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 4px;
  border: 2px solid var(--color-border);
  border-radius: var(--shape-sm);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.9rem;
  cursor: pointer;
  position: relative;
  background: var(--color-white);
  color: var(--color-text);
  user-select: none;
}
.item-card-hold .result-option { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.25); color: #fff; }
.result-option input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.result-option-ok:has(input:checked) { background: var(--color-ok); border-color: var(--color-ok); color: #fff; }
.result-option-nok:has(input:checked) { background: var(--color-nok); border-color: var(--color-nok); color: #fff; }
.result-option-na:has(input:checked) { background: var(--color-na); border-color: var(--color-na); color: #fff; }

.item-extra { margin-bottom: 10px; max-width: 200px; }
.item-card-hold .check-date-input {
  background: rgba(255, 255, 255, 0.9);
}

.link-btn {
  display: inline-block;
  background: none;
  border: none;
  color: var(--color-red);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 6px 0;
  margin-right: 16px;
  cursor: pointer;
}
.item-card-hold .link-btn { color: #ffb3bd; }

.note-input {
  width: 100%;
  min-height: 64px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  resize: vertical;
}

.photo-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.photo-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: var(--shape-sm);
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 10px;
  padding: 12px 16px calc(12px + var(--safe-bottom));
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  z-index: 20;
}
.btn {
  display: block;
  width: 100%;
  min-height: 50px;
  border-radius: var(--shape);
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}
.bottom-nav .btn { flex: 1; width: auto; }
.btn-primary { background: var(--color-red); color: #fff; }
.btn-primary:hover { background: var(--color-red-dark); }
.btn-primary:disabled { opacity: 0.6; }
.btn-secondary { background: #fff; color: var(--color-anthracite); border: 2px solid var(--color-anthracite); }

/* Success screen: donkere hero-sectie in de huisstijl */
.centered-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: calc(100vh - 54px);
  padding: 14vh 24px 40px;
  gap: 10px;
  background: var(--color-anthracite-gradient);
  color: #fff;
  overflow: hidden;
}
.centered-step::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("/assets/brand/trusteel-icon.png");
  background-repeat: repeat;
  background-size: 220px auto;
  background-position: -50px -40px;
  opacity: 0.05;
  pointer-events: none;
}
.centered-step > * { position: relative; z-index: 1; }
.success-wordmark { height: 26px; width: auto; margin-bottom: 18px; opacity: 0.95; }
.centered-step .step-title { color: #fff; }
.centered-step .step-subtitle { color: #d8d5d5; margin-bottom: 8px; }

.login-form {
  width: 100%;
  max-width: 320px;
  margin-top: 12px;
}
.login-field label { color: #fff; }
.login-form .info-banner { margin-top: 14px; text-align: left; }
.login-form .error-banner { margin-top: 14px; margin-bottom: 0; text-align: left; }
.success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--color-ok);
  color: #fff;
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.08);
}
.success-icon.warning-icon { background: var(--color-red); }
.centered-step .btn-primary { flex: none; width: auto; padding: 0 28px; margin-top: 20px; }

.hint-text { color: var(--color-ok); font-size: 0.9rem; font-weight: 700; }

@media (min-width: 640px) {
  .app-main:not(.full-bleed) { padding-left: 24px; padding-right: 24px; }
  .bottom-nav { max-width: 640px; margin: 0 auto; left: 0; right: 0; border-radius: var(--shape) var(--shape) 0 0; }
}
