/*
 * style.css — editorial redesign of the Blauwdruk-tool.
 * Cream paper, serif display headings, monospace labels, thin rules.
 * All element IDs and JS-created class hooks (.notice, .crop-row, .opt-card …)
 * are preserved so app.js / crop.js keep working untouched.
 */

:root {
  --paper:      #f4f0e7;   /* warm cream background        */
  --panel:      #fbf9f3;   /* card surface                 */
  --panel-head: #ece6d8;   /* step header bar              */
  --ink:        #23262b;   /* near-black, warm             */
  --muted:      #7c7666;   /* warm grey                    */
  --line:       #d6cdbc;   /* warm hairline                */
  --line-soft:  #e4ddcf;
  --accent:     #1f3a5f;   /* deep navy (selected, links)  */
  --accent-tint:#e8edf4;
  --btn:        #b1a589;   /* taupe primary button         */
  --btn-dark:   #978a6c;
  --green:      #4a7a4a;
  --red:        #b23b3b;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--serif);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1000px; margin: 0 auto; padding: 0 28px; }

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

/* ---- Masthead ---------------------------------------------------------- */
.masthead { padding: 38px 28px 0; }
.masthead-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--ink);
}
.masthead-note {
  margin: 0; text-align: right; font-family: var(--mono);
  font-size: 11.5px; line-height: 1.7; letter-spacing: .4px; color: var(--muted);
}
.display {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(40px, 6vw, 68px); line-height: 1.02;
  letter-spacing: -1px; margin: 18px 0 24px;
}
.display .arrow { font-weight: 400; }
.rule { border: 0; border-top: 2px solid var(--ink); margin: 0; }

/* ---- Steps ------------------------------------------------------------- */
main { padding: 30px 0 50px; }

.step {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-bottom: 26px;
  overflow: hidden;
}
.step-head {
  display: flex; align-items: center; gap: 16px;
  background: var(--panel-head);
  border-bottom: 1px solid var(--line);
  padding: 18px 26px;
}
.step-head h2 {
  margin: 0; font-family: var(--serif); font-weight: 600;
  font-size: 26px; letter-spacing: -0.4px;
}
.num {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--ink); background: transparent;
  font-family: var(--serif); font-size: 17px; font-weight: 600;
}
.thin { font-weight: 400; color: var(--muted); }
.tag-optional {
  font-family: var(--mono); font-size: 11px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line); border-radius: 20px; padding: 3px 11px;
  vertical-align: middle; margin-left: 4px;
}

.step-body { padding: 24px 26px 28px; }
.lead { margin: 0 0 22px; font-size: 18px; max-width: 70ch; }
.lead strong { font-weight: 600; }

/* ---- Dropzone ---------------------------------------------------------- */
.dropzone {
  border: 1.5px dashed var(--line);
  border-radius: 3px;
  background: transparent;
  padding: 52px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone:focus { border-color: var(--accent); background: #faf7ef; outline: none; }
.dropzone.over { border-color: var(--accent); background: var(--accent-tint); }
.drop-inner { display: flex; flex-direction: column; gap: 12px; }
.drop-inner strong { font-size: 22px; font-weight: 600; }
.drop-inner small {
  font-family: var(--mono); color: var(--muted);
  font-size: 12px; letter-spacing: .6px;
}

/* ---- Status + meldingen ------------------------------------------------ */
.busy {
  margin-top: 18px; padding: 12px 16px; border-radius: 3px;
  background: var(--accent-tint); color: var(--accent);
  font-family: var(--mono); font-size: 13px;
}
.busy::before { content: "› "; }
.error {
  margin-top: 18px; padding: 12px 16px; border-radius: 3px;
  background: #fbeeee; color: var(--red); border: 1px solid #eccccc;
}
.notices { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.notice { padding: 12px 15px; border-radius: 3px; font-size: 15px; }
.notice.info { background: var(--accent-tint); color: var(--accent); border: 1px solid #cdd8e6; }
.notice.warn { background: #f7efd9; color: #7d5a14; border: 1px solid #e6d6ab; }

/* ---- Options (OPTIE A/B/C) -------------------------------------------- */
.options {
  border: 0; margin: 0 0 24px; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.opt-card { position: relative; cursor: pointer; display: block; }
.opt-card input { position: absolute; opacity: 0; pointer-events: none; }
.opt-inner {
  display: flex; flex-direction: column; gap: 7px; height: 100%;
  border: 1.5px solid var(--line); border-radius: 4px;
  background: var(--panel); padding: 16px 18px; transition: border-color .12s, background .12s, box-shadow .12s;
}
.opt-card:hover .opt-inner { border-color: var(--muted); }
.opt-card input:checked + .opt-inner {
  border-color: var(--accent); background: var(--accent-tint);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.opt-card input:focus-visible + .opt-inner { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt-tag {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--muted);
}
.opt-title { font-size: 19px; font-weight: 600; }
.opt-inner small { color: var(--muted); font-size: 14px; line-height: 1.45; }

/* ---- Preview ----------------------------------------------------------- */
.preview-wrap {
  background: #ece7db; border: 1px solid var(--line); border-radius: 3px;
  min-height: 300px; display: flex; align-items: center; justify-content: center;
  padding: 16px; overflow: auto; margin-bottom: 22px;
}
.preview { background: #fff; box-shadow: 0 1px 6px rgba(40,30,10,.12); max-width: 100%; }

/* ---- Action row -------------------------------------------------------- */
.action-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 18px; flex-wrap: wrap; padding-top: 18px; border-top: 1px solid var(--line-soft);
}
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; }
.toggle input { width: 16px; height: 16px; accent-color: var(--accent); }
.split-toggle { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line-soft); font-weight: 600; }
.download-line { display: flex; gap: 10px; }
.name-field {
  min-width: 190px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 3px; font-family: var(--mono); font-size: 13px; background: #fff;
}

/* ---- Buttons ----------------------------------------------------------- */
button, .primary { font-family: var(--mono); cursor: pointer; }
.primary {
  display: inline-block; background: var(--btn); color: #fff; border: none;
  border-radius: 3px; padding: 12px 22px; font-size: 12px; font-weight: 600;
  letter-spacing: 1.2px; text-transform: uppercase; text-decoration: none;
  white-space: nowrap; transition: background .12s;
}
.primary:hover { background: var(--btn-dark); }
.primary:disabled { background: #cfc7b4; cursor: not-allowed; }
.primary.block { width: 100%; margin-top: 16px; padding: 14px; }

/* ---- CAD step ---------------------------------------------------------- */
.wip {
  margin: 0 0 16px; font-family: var(--mono); font-weight: 600;
  font-size: 14px; letter-spacing: .5px; color: var(--red);
  text-transform: uppercase;
}
.upload-note {
  margin: 0 0 22px; padding: 13px 16px; border-radius: 3px;
  background: #f7efd9; border: 1px solid #e6d6ab; color: #7d5a14; font-size: 15px;
}
.upload-note em { font-style: italic; }
.cad-action { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.cad-status {
  font-family: var(--mono); font-size: 13px; color: var(--accent);
}
.cad-status::before { content: "› "; }
.cad-result {
  margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line-soft);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.cad-meta { display: flex; gap: 34px; }
.cad-stat { display: flex; flex-direction: column; gap: 3px; }
.cad-stat-label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--muted);
}
.cad-stat-val { font-size: 22px; font-weight: 600; }

/* ---- Opsplitsen -------------------------------------------------------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.tool {
  background: var(--panel); border: 1px solid var(--line); border-radius: 3px;
  padding: 10px 15px; font-family: var(--mono); font-size: 12px; letter-spacing: .5px;
  color: var(--ink);
}
.tool:hover { border-color: var(--accent); }
.tool.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.spacer { flex: 1; }
.margin-field { font-family: var(--mono); font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.margin-field input { width: 64px; padding: 8px; border: 1px solid var(--line); border-radius: 3px; font-family: var(--mono); }

.hint { color: var(--muted); font-size: 15px; margin: 4px 0 16px; max-width: 75ch; }
.divider-hint { background: #f3ecdb; border: 1px solid #e3d4ac; color: #6f5524; padding: 12px 15px; border-radius: 3px; }
.divider-hint em { font-style: normal; font-weight: 600; }

.split-grid { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.canvas-stack {
  position: relative; background: #ece7db; border: 1px solid var(--line);
  border-radius: 3px; padding: 10px; display: inline-block; max-width: 100%;
}
.layer { display: block; }
.canvas-stack .overlay { position: absolute; top: 10px; left: 10px; cursor: crosshair; }

.crop-panel h3 { margin: 0 0 12px; font-family: var(--serif); font-size: 20px; font-weight: 600; }
.muted { color: var(--muted); font-size: 15px; }
.crop-list { display: flex; flex-direction: column; gap: 11px; }
.crop-row {
  border: 1px solid var(--line); border-radius: 4px; padding: 12px;
  display: flex; flex-direction: column; gap: 9px; background: var(--panel);
}
.crop-row.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.crop-name { padding: 8px 10px; border: 1px solid var(--line); border-radius: 3px; font-family: var(--mono); font-size: 13px; }
.crop-meta { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.crop-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.mini {
  background: var(--panel-head); border: 1px solid var(--line); border-radius: 3px;
  padding: 7px 11px; font-family: var(--mono); font-size: 11px; letter-spacing: .5px;
  text-transform: uppercase; color: var(--ink);
}
.mini:hover { background: #e2dccd; }
.mini.danger { color: var(--red); }
.mini.danger:hover { background: #f6e7e7; }
.mini.ghost { color: var(--muted); }

/* ---- Footer ------------------------------------------------------------ */
.footer { padding: 16px 28px 40px; color: var(--muted); }
.footer p { font-family: var(--mono); font-size: 12px; letter-spacing: .5px; }

@media (max-width: 820px) {
  .options { grid-template-columns: 1fr; }
  .split-grid { grid-template-columns: 1fr; }
  .action-row { flex-direction: column; align-items: stretch; }
}
