/* ============================================================
   AR&CO Insurance — Schadegevalaangifte
   Design tokens + component styles
   ============================================================ */

:root {
  /* Brand (from source document) */
  --arco-orange: #C06205;
  --arco-orange-700: #9c4f04;
  --arco-blue: #0D3072;
  --arco-blue-700: #0a2557;
  --arco-green: #22410D;
  --arco-red: #59130F;
  --ink: #1c1a14;
  --ink-soft: #54514a;
  --ink-faint: #8a877e;
  --cream: #FCF7F3;
  --paper: #ffffff;
  --line: #e7e3dc;
  --line-strong: #d6d1c7;

  /* Tweakable (overridden at runtime) */
  --accent: var(--arco-orange);
  --accent-deep: var(--arco-blue);
  --radius: 12px;
  --radius-sm: 8px;

  /* Density (overridden by .density-compact) */
  --pad-card: 40px;
  --field-h: 46px;
  --field-gap: 22px;
  --row-gap: 18px;
  --label-size: 13.5px;
  --input-size: 15px;

  --shadow-card: 0 1px 2px rgba(20,18,4,.04), 0 18px 40px -24px rgba(13,48,114,.22);
  --font-head: "Montserrat", system-ui, sans-serif;
  --font-body: "Open Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.density-compact {
  --pad-card: 28px;
  --field-h: 40px;
  --field-gap: 14px;
  --row-gap: 12px;
  --label-size: 13px;
  --input-size: 14.5px;
}

/* ---------- App shell ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 16px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.topbar .logo { height: 38px; display: block; }
.topbar-right { display: flex; align-items: center; gap: 22px; }
.langswitch { display: flex; border: 1.5px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.langswitch a {
  padding: 7px 13px; font-family: var(--font-head); font-weight: 700; font-size: 12.5px;
  letter-spacing: .03em; color: var(--ink-soft); text-decoration: none; line-height: 1;
  transition: background .15s, color .15s;
}
.langswitch a + a { border-left: 1.5px solid var(--line-strong); }
.langswitch a:hover { background: var(--cream); color: var(--ink); }
.langswitch a.active { background: var(--accent); color: #fff; }
.topbar .brand-meta {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  font-family: var(--font-head);
}
.topbar .brand-meta .doc-name {
  font-size: 13px; font-weight: 600; color: var(--arco-blue); letter-spacing: .01em;
}
.topbar .brand-meta .help {
  font-size: 12px; color: var(--ink-faint); font-family: var(--font-body);
}
.topbar .brand-meta .help a { color: var(--accent); text-decoration: none; font-weight: 600; }

.progress-track { height: 4px; background: var(--line); position: relative; overflow: hidden; }
.progress-fill {
  height: 100%; background: var(--accent);
  transition: width .45s cubic-bezier(.4,0,.1,1);
}

/* ---------- Layout ---------- */
.layout {
  max-width: 1200px; margin: 0 auto; width: 100%;
  display: grid; grid-template-columns: 268px 1fr; gap: 40px;
  padding: 40px 32px 80px;
  align-items: start;
}

/* ---------- Stepper ---------- */
.stepper { position: sticky; top: 104px; }
.stepper-title {
  font-family: var(--font-head); font-weight: 700; font-size: 12px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint);
  margin: 0 0 20px 4px;
}
.steps-list { list-style: none; margin: 0; padding: 0; position: relative; }
.steps-list::before {
  content: ""; position: absolute; left: 15px; top: 14px; bottom: 14px;
  width: 2px; background: var(--line);
}
.step-item {
  position: relative; display: flex; gap: 14px; align-items: center;
  padding: 7px 0; cursor: pointer; z-index: 1;
}
.step-dot {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--line-strong);
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 600; font-size: 13px; color: var(--ink-faint);
  transition: all .25s ease;
}
.step-label {
  font-size: 14px; color: var(--ink-soft); font-weight: 500; line-height: 1.25;
  transition: color .2s ease;
}
.step-item:hover .step-label { color: var(--ink); }
.step-item.is-active .step-dot {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
.step-item.is-active .step-label { color: var(--ink); font-weight: 700; }
.step-item.is-done .step-dot {
  background: var(--accent-deep); border-color: var(--accent-deep); color: #fff;
}
.step-item.is-done .step-label { color: var(--ink-soft); }

/* mobile step header */
.mobile-stephead { display: none; }

/* ---------- Card ---------- */
.card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.card-style-outlined .card { box-shadow: none; border: 1px solid var(--line-strong); }
.card-style-flat .card { box-shadow: none; border: 1px solid var(--line); background: #fffdfa; }

.card-head { padding: var(--pad-card) var(--pad-card) 0; }
.eyebrow {
  font-family: var(--font-head); font-weight: 700; font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 10px;
}
.card-head h1 {
  font-family: var(--font-head); font-weight: 700; font-size: 27px; line-height: 1.15;
  margin: 0; color: var(--ink); letter-spacing: -.01em;
}
.card-head .lede {
  margin: 14px 0 0; color: var(--ink-soft); font-size: 15px; line-height: 1.6; max-width: 60ch;
}
.card-body { padding: 28px var(--pad-card) var(--pad-card); }

/* ---------- Section blocks within a step ---------- */
.block { margin-top: 34px; }
.block:first-child { margin-top: 4px; }
.block-head {
  display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.block-head h2 {
  font-family: var(--font-head); font-weight: 600; font-size: 17px; color: var(--arco-blue);
  margin: 0; letter-spacing: -.01em;
}
.block-head .opt { font-size: 12.5px; color: var(--ink-faint); font-weight: 500; }
.block-note { font-size: 14px; color: var(--ink-soft); line-height: 1.6; margin: -6px 0 18px; }

/* ---------- Fields ---------- */
.grid { display: grid; gap: var(--field-gap) var(--row-gap); }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label {
  font-size: var(--label-size); font-weight: 600; color: var(--ink);
  letter-spacing: .005em; display: flex; align-items: center; gap: 6px;
}
.field .req, .req { color: var(--accent); font-weight: 700; }
.field .hint { font-size: 12.5px; color: var(--ink-faint); font-weight: 400; }

.input, .textarea, select.input {
  width: 100%; height: var(--field-h);
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; padding: 0 14px;
  font-family: var(--font-body); font-size: var(--input-size); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 104px; padding: 12px 14px; line-height: 1.55; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: #b4b0a6; }
.input:focus, .textarea:focus, select.input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--accent) 15%, transparent);
}
.input:hover:not(:focus), .textarea:hover:not(:focus) { border-color: var(--ink-faint); }
.input.has-error, .textarea.has-error { border-color: var(--arco-red); }
.input.has-error:focus { box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--arco-red) 16%, transparent); }
.err-msg { font-size: 12.5px; color: var(--arco-red); font-weight: 600; display: flex; align-items: center; gap: 5px; }

.input-prefix { position: relative; display: flex; align-items: center; }
.input-prefix .pfx {
  position: absolute; left: 14px; font-size: var(--input-size); color: var(--ink-faint);
  font-weight: 600; pointer-events: none;
}
.input-prefix .input { padding-left: 34px; }

/* ---------- Choice controls ---------- */
.choice {
  display: flex; align-items: flex-start; gap: 11px; cursor: pointer;
  padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; transition: border-color .15s, background .15s;
  font-size: 14.5px; line-height: 1.4; color: var(--ink);
}
.choice:hover { border-color: var(--ink-faint); }
.choice.is-disabled { opacity: .45; cursor: not-allowed; }
.choice.checked { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, #fff); }
.choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.box {
  flex: none; width: 20px; height: 20px; border-radius: 5px;
  border: 2px solid var(--line-strong); background: #fff;
  display: grid; place-items: center; margin-top: 1px; transition: all .15s;
}
.choice.radio .box { border-radius: 50%; }
.choice.checked .box { border-color: var(--accent); background: var(--accent); }
.box svg { opacity: 0; transform: scale(.6); transition: all .15s; color: #fff; }
.choice.checked .box svg { opacity: 1; transform: scale(1); }
.choice.radio .box::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff;
  opacity: 0; transform: scale(.4); transition: all .15s;
}
.choice.radio.checked .box::after { opacity: 1; transform: scale(1); }
.choice-label { display: flex; flex-direction: column; gap: 2px; }
.choice-sub { font-size: 12.5px; color: var(--ink-faint); }

.choice-grid { display: grid; gap: 10px; }
.choice-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.choice-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

/* nested choices (sub-options under a checkbox) */
.choice-nest {
  margin: 8px 0 4px 16px; padding-left: 18px;
  border-left: 2px solid var(--line); display: grid; gap: 9px;
}

/* compact pill choice for phases etc */
.pill-grid { display: grid; gap: 10px; grid-template-columns: repeat(3,1fr); }

/* ---------- Repeatable party / table rows ---------- */
.party-card {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 22px; margin-bottom: 14px; background: #fffdfa; position: relative;
}
.party-card .party-num {
  font-family: var(--font-head); font-weight: 700; font-size: 12px; color: var(--accent);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px;
}
.row-remove {
  position: absolute; top: 16px; right: 16px;
  border: none; background: none; color: var(--ink-faint); cursor: pointer;
  font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 5px;
  padding: 4px 8px; border-radius: 6px; transition: all .15s; font-family: var(--font-body);
}
.row-remove:hover { color: var(--arco-red); background: color-mix(in srgb, var(--arco-red) 8%, transparent); }
.add-row {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1.5px dashed var(--line-strong); background: #fff;
  color: var(--accent); font-weight: 700; font-family: var(--font-head); font-size: 13.5px;
  padding: 11px 18px; border-radius: var(--radius-sm); cursor: pointer; transition: all .15s;
}
.add-row:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, #fff); }

/* ---------- Upload ---------- */
.upload-item { margin-bottom: 14px; }
.upload-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.upload-head .name { font-size: 14.5px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.upload-head .req-tag {
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 3px 8px; border-radius: 20px;
}
.upload-head .opt-tag {
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-faint); background: var(--cream); padding: 3px 8px; border-radius: 20px;
}
.dropzone {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm);
  padding: 18px; display: flex; align-items: center; gap: 14px; cursor: pointer;
  background: #fffdfa; transition: all .15s; color: var(--ink-soft); font-size: 14px;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, #fff); color: var(--ink); }
.dropzone.has-error { border-color: var(--arco-red); background: color-mix(in srgb, var(--arco-red) 5%, #fff); }
.dropzone .dz-icon { flex: none; width: 40px; height: 40px; border-radius: 9px; background: color-mix(in srgb, var(--accent) 12%, transparent); display: grid; place-items: center; color: var(--accent); }
.dropzone .dz-text b { color: var(--accent); }
.file-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.file-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  background: var(--cream); border: 1px solid var(--line); border-radius: 20px;
  padding: 6px 8px 6px 12px; font-size: 13px; color: var(--ink);
}
.file-chip .fname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.file-chip .fsize { color: var(--ink-faint); font-size: 12px; }
.file-chip button { border: none; background: none; cursor: pointer; color: var(--ink-faint); display: grid; place-items: center; padding: 2px; border-radius: 50%; }
.file-chip button:hover { color: var(--arco-red); }

/* ---------- Callouts ---------- */
.callout {
  border-radius: var(--radius-sm); padding: 16px 18px; font-size: 14px; line-height: 1.6;
  display: flex; gap: 13px; align-items: flex-start;
}
.callout.info { background: color-mix(in srgb, var(--arco-blue) 7%, #fff); border: 1px solid color-mix(in srgb, var(--arco-blue) 18%, transparent); color: var(--arco-blue-700); }
.callout.warn { background: color-mix(in srgb, var(--arco-orange) 9%, #fff); border: 1px solid color-mix(in srgb, var(--arco-orange) 22%, transparent); color: var(--arco-orange-700); }
.callout .ci { flex: none; margin-top: 1px; }
.callout b { font-weight: 700; }
.mandate-text { font-size: 14.5px; line-height: 1.7; color: var(--ink); }

/* ---------- Card footer / nav ---------- */
.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px var(--pad-card); border-top: 1px solid var(--line); background: #fffdfa;
}
.step-count { font-size: 13.5px; color: var(--ink-faint); font-weight: 600; font-family: var(--font-head); }
.foot-actions { display: flex; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-family: var(--font-head); font-weight: 600; font-size: 14.5px;
  padding: 0 22px; height: 46px; border-radius: var(--radius-sm); border: 1.5px solid transparent;
  transition: all .15s; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary:disabled:hover { background: var(--accent); }
.btn-spin {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink-faint); background: var(--cream); }
.btn-ghost:disabled { opacity: .4; cursor: not-allowed; }
.btn-deep { background: var(--accent-deep); color: #fff; }
.btn-deep:hover { background: color-mix(in srgb, var(--accent-deep) 88%, #000); }
.btn svg { flex: none; }

/* validation banner */
.valbanner {
  margin: 0 var(--pad-card) 0; padding: 13px 16px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--arco-red) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--arco-red) 25%, transparent);
  color: var(--arco-red); font-size: 13.5px; font-weight: 600;
  display: flex; align-items: center; gap: 9px;
  animation: shake .35s;
}
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-4px)} 75%{transform:translateX(4px)} }

/* ---------- Review (step overzicht) ---------- */
.review-group { margin-bottom: 26px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.review-group-head {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--cream); padding: 13px 18px; border-bottom: 1px solid var(--line);
}
.review-group-head h3 { font-family: var(--font-head); font-weight: 600; font-size: 15px; color: var(--arco-blue); margin: 0; }
.review-edit { border: none; background: none; color: var(--accent); font-weight: 700; font-size: 13px; cursor: pointer; font-family: var(--font-head); }
.review-edit:hover { text-decoration: underline; }
.review-dl { padding: 6px 0; }
.review-row { display: grid; grid-template-columns: 220px 1fr; gap: 16px; padding: 9px 18px; font-size: 14px; }
.review-row:nth-child(even) { background: #fffdfa; }
.review-row dt { color: var(--ink-faint); font-weight: 600; }
.review-row dd { margin: 0; color: var(--ink); }
.review-row dd.empty { color: var(--ink-faint); font-style: italic; }

/* ---------- Confirmation ---------- */
.confirm { text-align: center; padding: 30px 20px 20px; }
.confirm .check {
  width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 24px;
  background: color-mix(in srgb, var(--arco-green) 12%, #fff);
  display: grid; place-items: center; color: var(--arco-green);
  animation: pop .5s cubic-bezier(.3,1.4,.5,1);
}
@keyframes pop { from { transform: scale(0); } }
.confirm h1 { font-family: var(--font-head); font-size: 28px; margin: 0 0 12px; color: var(--ink); }
.confirm p { color: var(--ink-soft); font-size: 15.5px; line-height: 1.6; max-width: 52ch; margin: 0 auto 8px; }
.confirm .refnum {
  display: inline-block; margin: 18px 0 26px; font-family: var(--font-head); font-weight: 700;
  font-size: 15px; color: var(--arco-blue); background: var(--cream); border: 1px dashed var(--line-strong);
  padding: 10px 20px; border-radius: 10px; letter-spacing: .03em;
}
.confirm-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }

/* autosave indicator */
.saved-pill {
  position: fixed; bottom: 18px; left: 18px; z-index: 40;
  display: flex; align-items: center; gap: 7px;
  background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 600;
  padding: 8px 14px; border-radius: 30px; opacity: 0; transform: translateY(8px);
  transition: opacity .3s, transform .3s; pointer-events: none; font-family: var(--font-head);
}
.saved-pill.show { opacity: .92; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 0; padding: 0 0 60px; }
  .stepper { display: none; }
  .topbar-inner { padding: 14px 18px; }
  .topbar .brand-meta .help { display: none; }
  .mobile-stephead {
    display: block; padding: 20px 20px 0; max-width: 640px; margin: 0 auto;
  }
  .mobile-stephead .ms-count { font-family: var(--font-head); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
  .mobile-stephead .ms-dots { display: flex; gap: 5px; margin-top: 10px; }
  .mobile-stephead .ms-dot { height: 4px; flex: 1; border-radius: 3px; background: var(--line); }
  .mobile-stephead .ms-dot.done { background: var(--accent-deep); }
  .mobile-stephead .ms-dot.active { background: var(--accent); }
  .card-wrap { padding: 16px; max-width: 640px; margin: 0 auto; }
  :root { --pad-card: 22px; }
  .card-head h1 { font-size: 22px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .choice-grid.cols-2, .choice-grid.cols-3, .pill-grid { grid-template-columns: 1fr; }
  .review-row { grid-template-columns: 1fr; gap: 3px; }
  .card-foot { flex-direction: column-reverse; align-items: stretch; }
  .foot-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .step-count { text-align: center; }
}

@media (min-width: 901px) {
  .card-wrap { min-width: 0; }
}

/* ---------- Print ---------- */
.print-document { display: none; }
@media print {
  .topbar, .progress-track, .stepper, .card-foot, .mobile-stephead, .saved-pill, .tweaks-host, #tweaks-root { display: none !important; }
  body, html { background: #fff; }
  .layout { display: block; padding: 0; max-width: none; }
  .card, .card-wrap { box-shadow: none !important; border: none !important; padding: 0 !important; }
  .app > *:not(.print-document) { display: none !important; }
  .print-document { display: block !important; }
}

/* ---------- Blazor InputFile overlay (drag & drop) ---------- */
.dropzone { position: relative; }
.dz-input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}
