/* Chase Marketing — handtekening generator
   Waarden komen 1:1 uit het Claude Design-ontwerp (Handtekening Generator.dc.html). */

/* Paneelkleuren op één plek. Het beige is #FAF6EB — dezelfde kleur als de
   merkbalk en de actiepil in de handtekening. De inkttinten zijn warm gekozen
   zodat ze bij dat beige horen, en donker genoeg om leesbaar te blijven. */
:root {
  --panel-bg: #FAF6EB;
  --panel-edge: #EBE1C8;
  --panel-ink: #1F2025;
  --panel-ink-soft: #6E6758;
  --panel-ink-faint: #78705F;
  --field-bg: #FFFFFF;
  --field-edge: #E0D7BF;
  --field-placeholder: #8C8474;
  --accent: #0042E4;
  --accent-dark: #0033B0;
}

html, body { margin: 0; padding: 0; }

body {
  background: #F4F5F7;
  color: #1F2025;
  font-family: 'Epilogue', Helvetica, Arial, sans-serif;
}

a { color: #0042E4; }
a:hover { color: #0033B0; }

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

.app {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}

/* ─────────── invulpaneel ─────────── */

.panel {
  flex: 0 1 400px;
  min-width: 320px;
  background: var(--panel-bg);
  color: var(--panel-ink);
  border-right: 1px solid var(--panel-edge);
  padding: 36px 34px 44px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.panel-head {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Op het beige past het logo in eigen kleur — geen invert-filter meer nodig. */
.panel-logo {
  width: 186px;
  height: auto;
  display: block;
}

.panel-intro {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-title {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.panel-sub {
  margin: 0;
  font-size: 14px;
  line-height: 21px;
  color: var(--panel-ink-soft);
  max-width: 320px;
}

.fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.field-sep {
  border-top: 1px solid var(--panel-edge);
  padding-top: 20px;
}

.field-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--panel-ink-soft);
}

.field-opt {
  color: var(--panel-ink-faint);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.hint {
  font-size: 12px;
  color: var(--panel-ink-faint);
}

.panel input,
.panel select {
  background: var(--field-bg);
  border: 1px solid var(--field-edge);
  border-radius: 10px;
  padding: 13px 15px;
  font-family: inherit;
  font-size: 15px;
  color: var(--panel-ink);
  outline: none;
  min-width: 0;
}

.panel input::placeholder { color: var(--field-placeholder); }

.panel input:focus,
.panel select:focus {
  border-color: var(--accent);
}

.panel select {
  appearance: none;
  cursor: pointer;
}

.portret-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.portret-thumb {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 5px;
  background: var(--field-bg);
  border: 1px solid var(--field-edge);
  overflow: hidden;
}

.portret-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portret-row input { flex: 1; }

.pill-row {
  display: flex;
  gap: 10px;
}

.pill-row input { flex: 1; }

.pill-row .pill-emoji {
  width: 64px;
  flex: 0 0 64px;
  text-align: center;
  padding: 13px 8px;
}

/* ─────────── styling-blok ─────────── */

.styling {
  border: 1px solid var(--field-edge);
  border-radius: 12px;
  background: rgba(255, 255, 255, .55);
}

.styling-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 13px 15px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

/* Eigen chevron in plaats van het browser-driehoekje. */
.styling-head::-webkit-details-marker { display: none; }

.styling-head::after {
  content: "";
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--panel-ink-soft);
  border-bottom: 1.5px solid var(--panel-ink-soft);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .15s;
}

.styling[open] .styling-head::after { transform: rotate(-135deg) translateY(-2px); }

.styling-head:hover { background: rgba(255, 255, 255, .8); border-radius: 11px; }

.styling-sub {
  font-size: 12px;
  color: var(--panel-ink-faint);
}

.styling-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 15px;
  border-top: 1px solid var(--panel-edge);
}

.field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-pair .field { min-width: 0; }

.swatches {
  display: flex;
  gap: 8px;
}

.swatch {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(31, 32, 37, .18);
  background: var(--sw);
  cursor: pointer;
  box-shadow: 0 0 0 0 var(--sw);
  transition: box-shadow .15s;
}

.swatch:hover { box-shadow: 0 0 0 3px rgba(31, 32, 37, .1); }

.swatch.is-on {
  box-shadow: 0 0 0 2px var(--panel-bg), 0 0 0 4px var(--sw);
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  line-height: 20px;
  color: var(--panel-ink);
  cursor: pointer;
}

.check input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.warning {
  display: flex;
  gap: 10px;
  background: #FBF0D5;
  border: 1px solid #E3C77E;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 19px;
  color: #6B5518;
}

.warning-mark { font-weight: 800; }

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding-top: 8px;
}

.btn {
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  border: 0;
  background: var(--accent);
  color: #fff;
  padding: 16px 24px;
  transition: background .15s, opacity .15s;
}

.btn-primary:hover { background: var(--accent-dark); }

.btn-ghost {
  border: 1px solid #CFC5AC;
  background: transparent;
  color: var(--panel-ink);
  padding: 15px 24px;
  transition: border-color .15s, background .15s, opacity .15s;
}

.btn-ghost:hover { border-color: var(--panel-ink); background: var(--field-bg); }

/* Geblokkeerd = duidelijk uit, maar nog wel klikbaar: de klik legt uit wat er
   nog mist. Eigen tinten in plaats van opacity, want een doorschijnend blauw
   op beige wordt een vieze waas. */
.btn-primary.is-blocked,
.btn-primary.is-blocked:hover {
  background: #E2D9C2;
  color: var(--panel-ink-faint);
}

.btn-ghost.is-blocked,
.btn-ghost.is-blocked:hover {
  border-color: var(--field-edge);
  background: transparent;
  color: var(--panel-ink-faint);
}

/* ─────────── voorbeeld ─────────── */

.preview {
  flex: 1 1 auto;
  min-width: 0;
  padding: 48px 32px 64px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: flex-start;
}

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8A8E9B;
}

.mail {
  width: 100%;
  max-width: 760px;
  background: #fff;
  border: 1px solid #E3E4E8;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 40px -28px rgba(31, 32, 37, .35);
}

.mail-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 22px;
  border-bottom: 1px solid #EDEEF1;
  background: #FAFAFB;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #E1E2E6;
  display: block;
}

.mail-bar-label {
  margin-left: 10px;
  font-size: 12.5px;
  color: #8A8E9B;
}

.mail-head {
  padding: 22px 30px;
  border-bottom: 1px solid #EDEEF1;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 13.5px;
  color: #6B6E7A;
}

.mail-head-row {
  display: flex;
  gap: 14px;
}

.mail-head-key {
  flex: 0 0 82px;
  color: #9CA0AD;
}

.mail-head-val { color: #1F2025; }
.mail-head-subject { white-space: nowrap; }

.mail-body { padding: 32px 24px 38px; }

.mail-copy {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 22px;
  color: #1F2025;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

/* De handtekening is een vaste 520px. Bij een smaller voorbeeldvak schaalt hij
   mee via container queries — geen JS-meting, dus geen timing die fout kan gaan. */
.sig-fit {
  width: 100%;
  container-type: inline-size;
}

/* --sig-w wordt door app.js op de echte breedte van het gekozen formaat gezet. */
.sig {
  width: var(--sig-w, 400px);
  transform-origin: top left;
  scale: min(1, calc(100cqi / var(--sig-w, 400px)));
  margin-bottom: calc(-1 * (1 - min(1, calc(100cqi / var(--sig-w, 400px)))) * 100%);
}

.guidelines {
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 4px;
}

.guideline-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.card {
  background: #fff;
  border: 1px solid #E3E4E8;
  border-radius: 12px;
  padding: 18px 20px;
  font-size: 13.5px;
  line-height: 21px;
  color: #5A5C66;
}

.card-title {
  font-weight: 700;
  color: #1F2025;
  margin-bottom: 6px;
}

/* ─────────── smalle vensters ─────────── */

@media (max-width: 900px) {
  .app { flex-direction: column; }

  .panel {
    flex: 0 0 auto;
    min-width: 0;
    padding: 30px 22px 34px;
  }

  .actions { margin-top: 26px; }

  .preview { padding: 32px 22px 48px; }

  .guideline-grid { grid-template-columns: 1fr; }

  .mail-head { padding: 18px 20px; }
  .mail-body { padding: 26px 18px 30px; }
}
