/* DTE Platform P1 — aanvullende stijlen op rua-a-rua.css & rua-a-rua-v2.css */
:root {
  --plate: #004974;
  --plate2: #07263b;
  --loener: #07263b;
  --accent: #16689e;
  --ok: #15803d;
  --bad: #b42318;
  --ink: #0c2030;
  --ink2: #3b5368;
  --muted: #56708a;
  --line: #d6e4ef;
  --bg: #f3f8fc;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--hemel, #f3f8fc);
  color: var(--ink);
  font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Zorg dat buttons echte klikbare controls zijn met hoog W3C-contrast */
button.btn,
a.btn,
.btn {
  cursor: pointer;
  text-decoration: none;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

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

.btn.pri {
  background: var(--navy, linear-gradient(135deg, #07263b 0%, #004974 58%, #16689e 100%));
  color: #ffffff;
  border: 0;
}

.btn.ok {
  background: #15803d;
  background-image: linear-gradient(135deg, #166534, #15803d);
  color: #ffffff;
  border: 0;
}

.btn.gh {
  background: #ffffff;
  color: #004974;
  border: 1.5px solid var(--line);
}

.btn.danger {
  background: #ffffff;
  color: #b42318;
  border: 1.5px solid #f1c4c0;
}

.btn.danger:hover {
  background: #fef2f2;
}

.btn-sm {
  height: 40px;
  padding: 0 14px;
  font-size: 14px;
  border-radius: 10px;
}

/* Taalknoppen */
.lang button,
.lang span[data-lang] {
  background: transparent;
  border: 0;
  color: #ffffff;
  padding: 5px 10px;
  border-radius: 7px;
  font: 600 13.5px 'IBM Plex Sans', sans-serif;
  cursor: pointer;
  opacity: 0.78;
}

.lang button.is,
.lang span.is {
  background: #ffffff;
  color: #07263b;
  opacity: 1;
  font-weight: 700;
}

/* Kleurknoppen & badges met gegarandeerd >= 4.5:1 contrast */
.n-grijs, .sti.s-grijs { background: linear-gradient(135deg, #4b5563, #374151); color: #ffffff; }
.n-geel,  .sti.s-geel  { background: linear-gradient(135deg, #fde047, #facc15); color: #1f1600; }
.n-blauw, .sti.s-blauw { background: linear-gradient(135deg, #1d4ed8, #1e40af); color: #ffffff; }
.n-rood,  .sti.s-rood  { background: linear-gradient(135deg, #b91c1c, #991b1b); color: #ffffff; }
.n-groen, .sti.s-groen { background: linear-gradient(135deg, #15803d, #166534); color: #ffffff; }

.voorstel {
  outline: 4px solid #ffd24a;
  outline-offset: 2px;
  position: relative;
}

.voorstel-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ffd24a;
  color: #3a2800;
  font: 700 12px 'IBM Plex Sans', sans-serif;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

/* Verberg pseudo ::after als expliciete .voorstel-tag wordt gebruikt of houd hoog contrast */
.voorstel.no-pseudo::after {
  display: none;
}

.voorstel::after {
  background: #ffd24a;
  color: #3a2800;
}

/* AI wachtbalk */
.ai-wait-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: linear-gradient(90deg, #07263b, #004974);
  color: #ffffff;
  font-weight: 600;
  font-size: 15px;
  position: relative;
  overflow: hidden;
}

.ai-wait-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.ai-wait-bar::before {
  content: '';
  position: absolute;
  left: -35%;
  width: 35%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #88bfda, #ffffff, transparent);
  animation: ai-slide 1.4s ease-in-out infinite;
}

@keyframes ai-slide {
  0% { left: -35%; }
  100% { left: 100%; }
}

/* App Shell */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  overflow-x: hidden;
}

.appbar {
  height: 66px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  color: #ffffff;
  flex-wrap: nowrap;
}

.appbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.btn-logout {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 9px;
  padding: 6px 12px;
  font: 600 13.5px 'IBM Plex Sans', sans-serif;
  cursor: pointer;
  white-space: nowrap;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.24);
}

/* Login Pagina */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--hemel);
}

.login-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.login-card {
  width: 100%;
  max-width: 920px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: #ffffff;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--sch2, 0 18px 44px rgba(7, 38, 59, .16));
}

.login-hero {
  position: relative;
  min-height: 420px;
  padding: 28px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: #07263b;
}

.login-hero img.bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 30%;
  z-index: 0;
}

.login-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 38, 59, 0.55) 0%, rgba(0, 73, 116, 0.85) 65%, rgba(7, 38, 59, 0.96) 100%);
  z-index: 1;
}

.login-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.login-hero-content .logo-dte {
  height: 42px;
  align-self: flex-start;
  margin-bottom: auto;
}

.login-form-wrap {
  padding: 36px 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink);
}

.field input,
.field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid #c9d3df;
  border-radius: 12px;
  padding: 12px 14px;
  font: 500 16px 'IBM Plex Sans', sans-serif;
  color: var(--ink);
  background: #ffffff;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--plate);
  box-shadow: 0 0 0 3px rgba(0, 73, 116, 0.16);
}

.alert-box {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14.5px;
  line-height: 1.45;
  font-weight: 500;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #f5c2c0;
  color: #8f1d14;
}

.alert-warn {
  background: #fff8e6;
  border: 1px solid #f0d58a;
  color: #5c3d00;
}

.alert-ok {
  background: #ecfdf3;
  border: 1px solid #abefc6;
  color: #115e32;
}

.alert-info {
  background: #eef6fc;
  border: 1px solid #cfe3f1;
  color: #0c2030;
}

/* Operador Views (1180x820 tablet en desktop/mobiel responsive) */
.op-main {
  flex: 1;
  padding: 16px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.route-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 440px);
  gap: 16px;
  align-items: start;
}

.map-panel {
  padding: 0;
  overflow: hidden;
  position: relative;
  min-height: 520px;
  display: flex;
  flex-direction: column;
}

.map-panel svg#kaart {
  width: 100%;
  height: 520px;
  display: block;
}

.map-legend {
  padding: 10px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 13.5px;
  background: #ffffff;
  border-top: 1px solid var(--line);
}

.stops-scroll {
  max-height: 360px;
  overflow-y: auto;
}

#stops-list .rij {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  min-height: 54px;
  border-bottom: 1px solid #eef2f6;
  cursor: pointer;
  transition: background 0.12s ease;
}

#stops-list .rij:hover {
  background: #f4f9fd;
}

#stops-list .rij.nu {
  background: linear-gradient(90deg, #dcecf8, #f1f8fd);
}

#stops-list .rij .plaat,
#stops-list .rij .mk {
  flex: 0 0 34px;
  width: 34px;
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  font: 700 16px 'Bricolage Grotesque', sans-serif;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.88), 0 2px 6px rgba(7, 38, 59, 0.2);
}

#stops-list .rij .plaat.n-grijs { background: linear-gradient(135deg, #4b5563, #374151); color: #ffffff; }
#stops-list .rij .plaat.n-geel  { background: linear-gradient(135deg, #fde047, #facc15); color: #1f1600; }
#stops-list .rij .plaat.n-blauw { background: linear-gradient(135deg, #1d4ed8, #1e40af); color: #ffffff; }
#stops-list .rij .plaat.n-rood  { background: linear-gradient(135deg, #b91c1c, #991b1b); color: #ffffff; }
#stops-list .rij .plaat.n-groen { background: linear-gradient(135deg, #15803d, #166534); color: #ffffff; }

/* Foto stappen chips */
#photo-steps-bar .stap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 600;
  font-size: 14.5px;
}

#photo-steps-bar .stap.ok {
  background: #e6f6ec;
  border-color: #b5e3c6;
  color: #15653a;
}

#photo-steps-bar .stap.nu,
#photo-steps-bar .is {
  background: var(--navy, linear-gradient(135deg, #07263b 0%, #004974 58%, #16689e 100%));
  border-color: transparent;
  color: #ffffff !important;
  font-weight: 700;
}

/* Zijbalk 8 vragen */
#questions-sidebar .ql {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid #eef2f6;
  font-size: 15.5px;
  color: var(--ink);
}

#questions-sidebar .ql .n {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e6eff6;
  color: #07263b;
  font-weight: 700;
  font-size: 12.5px;
}

#questions-sidebar .ql.nu {
  background: linear-gradient(90deg, #dcecf8, #f4f9fd);
  font-weight: 700;
  border-radius: 12px;
  margin: 2px 8px;
}

#questions-sidebar .ql.nu .n {
  background: var(--navy, #004974);
  color: #ffffff;
}

#questions-sidebar .ql.klaar .n {
  background: #15803d;
  color: #ffffff;
}

#questions-sidebar .ql .v {
  margin-left: auto;
  font-weight: 600;
  color: var(--ok);
  font-size: 14px;
}

/* Foto scherm */
.photo-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 390px);
  gap: 16px;
  align-items: start;
}

.photo-stage {
  position: relative;
  min-height: 360px;
  max-height: 490px;
  background: #0c2030;
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.photo-stage img {
  width: 100%;
  height: 100%;
  max-height: 490px;
  object-fit: contain;
  display: block;
}

.photo-stage-svg {
  width: 100%;
  height: auto;
  max-height: 490px;
  display: block;
  background: #0c2030;
}

.photo-stage-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  pointer-events: none;
}

.photo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  font: 700 14px 'IBM Plex Sans', sans-serif;
  line-height: 1.2;
  box-shadow: 0 4px 12px rgba(7, 38, 59, 0.24);
}

.photo-badge-good {
  background: #15803d;
  color: #ffffff;
}

.photo-badge-count {
  background: rgba(255, 255, 255, 0.96);
  color: #07263b;
  border: 1px solid rgba(7, 38, 59, 0.14);
}

/* 8 vragen scherm */
.q-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.q-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 20px;
  align-items: start;
}

.q-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.btn.qb {
  height: 82px;
  font-size: 20px;
  border-radius: 16px;
  width: 100%;
  background: #ffffff;
  color: var(--ink);
  border: 2px solid var(--line);
}

.btn.qb.is-selected {
  border-color: var(--plate);
  background: #eaf4fc;
  color: #004974;
  font-weight: 700;
}

/* Resultaat & Offerte & 5 kleuren */
.result-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 295px;
  gap: 14px;
  align-items: start;
}

.freq-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.frq.gk {
  border: 0;
  background: var(--navy, linear-gradient(135deg, #07263b 0%, #004974 58%, #16689e 100%));
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(7, 38, 59, 0.32);
}

.frq.gk .fk,
.frq.gk .p,
.frq.gk .fr,
.frq.gk .fr span,
.frq.gk .fr b {
  color: #ffffff !important;
}

.frq.gk .pb {
  color: #dcecf6 !important;
}

.frq.gk .fr {
  border-top-color: rgba(255, 255, 255, 0.22);
}

.frq .gekozen {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff !important;
}

.done-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 10px;
}

.done-stat-card {
  background: #f8fbfe;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.done-stat-card .val {
  font: 700 24px 'Bricolage Grotesque', sans-serif;
  color: var(--ink);
}

.done-stat-card .lbl {
  font-size: 13px;
  color: var(--ink2);
  font-weight: 600;
}

.color-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 3px solid transparent;
  font: 700 15.5px 'IBM Plex Sans', sans-serif;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 4px 12px rgba(7, 38, 59, 0.14);
}

.color-btn.is-selected {
  border-color: #07263b;
  box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px #07263b;
}

/* QR Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 38, 59, 0.65);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 100;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 24px 56px rgba(7, 38, 59, 0.35);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.qr-box {
  display: grid;
  place-items: center;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  min-height: 220px;
}

.qr-box svg {
  width: 210px;
  height: 210px;
  display: block;
}

/* Morador Mobile-first (390x844) */
.morador-wrap {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(7, 38, 59, 0.08);
}

.morador-body {
  padding: 14px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.frq-btn {
  text-align: left;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fbfe;
  border: 1px solid var(--line);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink);
  cursor: pointer;
}

.consent-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex: none;
  margin-top: 2px;
  accent-color: #004974;
  cursor: pointer;
}

/* Responsief zonder horizontale overflow */
@media (max-width: 1060px) {
  .route-grid,
  .photo-grid,
  .q-grid,
  .q-body-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .login-card {
    grid-template-columns: 1fr;
  }
  .login-hero {
    min-height: 220px;
  }
  .q-options-grid {
    grid-template-columns: 1fr;
  }
  .freq-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .appbar {
    padding: 0 12px;
    gap: 8px;
  }
  .appbar .met {
    display: none;
  }
}

@media (max-width: 420px) {
  .freq-grid {
    grid-template-columns: 1fr;
  }
  .morador-wrap .freq-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .morador-wrap .freq-grid-3 .frq {
    padding: 9px 7px;
  }
  .morador-wrap .freq-grid-3 .frq .p {
    font-size: 18px;
  }
  .morador-wrap .freq-grid-3 .frq .fr {
    font-size: 11.5px;
    flex-direction: column;
    gap: 1px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-wait-bar::before {
    animation: none;
  }
}

/* PEDIDO 3034 visual enhancements: route hero, route color bar, facade viewfinder */
.op-main {
  padding: 10px 14px;
}

.alert-box {
  padding: 8px 12px;
  font-size: 13.5px;
}

.op-hero-banner {
  position: relative;
  height: 46px;
  overflow: hidden;
  background: #07263b;
}

.op-hero-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 35%;
  display: block;
}

.op-hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 38, 59, 0.14), rgba(7, 38, 59, 0.84));
}

.op-hero-text {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 6px;
  color: #ffffff;
  font: 700 16px 'Bricolage Grotesque', sans-serif;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

.stops-scroll {
  max-height: 142px;
}

#stops-list .rij {
  min-height: 36px;
  padding: 5px 12px;
  gap: 10px;
}

.route-color-panel {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.route-color-panel label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-color-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.route-color-grid .color-btn.route-cbtn {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12.5px;
  border-radius: 8px;
}

.route-color-grid .color-btn.route-cbtn[data-route-color="orcamento_feito"] {
  grid-column: 1 / -1;
}

.photo-stage-guide {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 320px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  box-sizing: border-box;
  overflow: hidden;
}

.photo-stage-guide .photo-guide-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.42;
  filter: saturate(0.95);
}

.photo-stage-guide .photo-guide-scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(7, 38, 59, 0.56) 0%, rgba(7, 38, 59, 0.88) 100%);
}

.photo-stage-guide .photo-guide-frame {
  position: absolute;
  inset: 18px;
  border: 2px dashed rgba(255, 255, 255, 0.45);
  border-radius: 14px;
  pointer-events: none;
}
