/* FrameLoom — lokale foto-inkadertool
   Rustige, leesbare stijl; brede klikbare knoppen, hoog contrast. */

:root {
  --plum: #4b2e83;
  --plum-dark: #2f1c54;
  --plum-gradient: linear-gradient(135deg, #6c3fb0, var(--plum-dark));
  --ink: #221c33;
  --ink-soft: #4a4360;
  --paper: #faf9f7;
  --paper-card: #ffffff;
  --border: #e4e0ea;
  --accent: #e0a13d;
  --accent-dark: #b87d1f;
  --success-bg: #eaf8ef;
  --success-ink: #1a7a3d;
  --error-bg: #fdeceb;
  --error-ink: #a3271a;
  --radius: 16px;
  --radius-sm: 9px;
  --shadow: 0 8px 30px rgba(34, 28, 51, 0.10);
  --max-width: 1180px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

img { max-width: 100%; display: block; }
a { color: var(--plum); }
a:focus, button:focus, input:focus, select:focus, .btn:focus {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

h1, h2, h3 { line-height: 1.25; color: var(--ink); font-weight: 700; }
h1 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.8rem); margin-bottom: 0.4em; }
h3 { font-size: 1.05rem; margin: 0 0 10px; }
p { margin: 0 0 1em; }
.lead { font-size: 1.1rem; color: var(--ink-soft); }
.hint { font-size: 0.88rem; color: var(--ink-soft); margin: 6px 0 12px; }

/* ---------- header ---------- */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 249, 247, 0.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
header.site .bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.15rem; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }

.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.license-pill {
  border: 1px solid var(--border);
  background: var(--paper-card);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.85rem;
  cursor: pointer;
}
.license-pill.is-active { color: var(--success-ink); background: var(--success-bg); border-color: transparent; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 26px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.05s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--plum-gradient); color: #fff; box-shadow: var(--shadow); }
.btn-ghost { background: transparent; color: var(--plum); border: 1.5px solid var(--border); }
.btn-small { padding: 8px 16px; font-size: 0.85rem; }
.btn-export {
  background: var(--paper-card);
  border: 1.5px solid var(--border);
  color: var(--ink);
  padding: 10px 18px;
}
.btn-export:hover { border-color: var(--plum); color: var(--plum); }

/* ---------- intro ---------- */
.intro { max-width: 720px; margin: 48px auto; text-align: center; }
.unsupported { max-width: 640px; margin: 48px auto; text-align: center; }
.badge {
  display: inline-block; background: var(--error-bg); color: var(--error-ink);
  border-radius: 999px; padding: 4px 14px; font-size: 0.8rem; font-weight: 700;
  margin-bottom: 12px;
}
.privacy-note {
  background: var(--success-bg); color: var(--success-ink);
  border-radius: var(--radius); padding: 18px 22px; margin-top: 28px;
  font-size: 0.95rem; text-align: left;
}
.max-note { font-size: 0.85rem; color: var(--ink-soft); text-align: center; margin-top: 18px; }

/* ---------- editor ---------- */
.editor { margin: 32px auto 64px; }
.editor-layout { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; }

.panel {
  background: var(--paper-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.field-group { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.field-group:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

select, input[type="text"], input[type="number"] {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); font-size: 0.95rem; background: #fff; color: var(--ink);
}
.custom-size-row { display: flex; gap: 10px; }
.custom-size-row .sub-label { flex: 1; }
.sub-label { display: block; font-size: 0.85rem; color: var(--ink-soft); margin: 10px 0 4px; font-weight: 600; }
.sub-label[hidden] { display: none; }
input[type="range"] { width: 100%; }
input[type="color"] { width: 56px; height: 34px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 2px; background: #fff; cursor: pointer; }
.checkbox-label, .radio-label { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; margin: 8px 0; cursor: pointer; }

.stage-wrap { display: flex; flex-direction: column; gap: 14px; }
.stage {
  background:
    linear-gradient(45deg, #eee 25%, transparent 25%),
    linear-gradient(-45deg, #eee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eee 75%),
    linear-gradient(-45deg, transparent 75%, #eee 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 420px;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
#previewCanvas { max-width: 100%; max-height: 60vh; cursor: grab; touch-action: none; border-radius: 4px; }
#previewCanvas:active { cursor: grabbing; }

.export-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--paper-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px;
}
.export-label { font-weight: 600; color: var(--ink-soft); font-size: 0.9rem; margin-right: 4px; }
.svg-note { font-size: 0.82rem; color: var(--ink-soft); }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(34, 28, 51, 0.55);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: #fff; border-radius: var(--radius); padding: 28px; max-width: 440px; width: 100%;
  position: relative; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-close {
  position: absolute; top: 14px; right: 14px; background: none; border: none;
  font-size: 1.2rem; cursor: pointer; color: var(--ink-soft);
}
#licenseMsg.error { color: var(--error-ink); }
#licenseMsg.success { color: var(--success-ink); }

/* ---------- footer ---------- */
footer.site { border-top: 1px solid var(--border); margin-top: 48px; padding: 32px 0; }
footer.site .cols { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; font-size: 0.9rem; color: var(--ink-soft); }

@media (max-width: 780px) {
  .editor-layout { grid-template-columns: 1fr; }
}
