/* Generator page UI only. Nothing here reaches the signature itself —
   the signature is inline-styled tables built in js/signature.js. */
:root {
  --accent: #9b1b1f;
  --ink: #111827;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: #e5e7eb;
  --bg: #f6f7f9;
  --card: #ffffff;
  --ok: #059669;
  --error: #b91c1c;
  --radius: 16px;
  --mono: ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  display: flex;
  gap: 24px;
  padding: 28px 32px 48px;
  align-items: flex-start;
  flex-wrap: wrap;
  max-width: 1280px;
  margin: 0 auto;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.05);
}
.form { flex: 0 0 360px; max-width: 100%; padding: 12px; }
.out { flex: 1 1 540px; min-width: 0; position: sticky; top: 24px; }

@media (max-width: 720px) {
  .wrap { padding: 16px; }
  .out { position: static; }
}

/* ---------- form fields ---------- */
label { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); margin: 12px 0 5px; }
input[type=text], input[type=url], input[type=email], input[type=tel] {
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color .12s, box-shadow .12s;
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
input::placeholder { color: #c4c7cd; }

.hint { font-size: 11.5px; color: var(--faint); margin-top: 5px; line-height: 1.5; }
.hint.flush { margin: 0; }
.hint.spaced { margin: 0 0 14px; }
.hint code { background: var(--bg); padding: 1px 5px; border-radius: 5px; font-size: 10.5px; }
.hint a { color: var(--accent); }

/* ---------- accordion sections ---------- */
.acc { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; background: #fff; transition: background .15s; }
.acc:last-child { margin-bottom: 0; }
.acc.open { background: var(--bg); }
.acc-head {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 0;
  border-radius: 14px;
  background: none;
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.acc-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.acc-title { display: block; font-size: 15px; font-weight: 600; color: var(--ink); }
.acc.open .acc-title { color: var(--accent); }
.acc-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.acc-chevron { flex: 0 0 auto; width: 22px; height: 22px; color: var(--faint); transition: transform .18s, color .15s; }
.acc.open .acc-chevron { transform: rotate(180deg); color: var(--accent); }
.acc-body { padding: 0 16px 16px; }
.acc:not(.open) .acc-body { display: none; }

.disc-box {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 4px;
}

/* ---------- buttons & status ---------- */
.btns { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.btns.tight { margin: 12px 0 0; }
.btn {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  transition: filter .12s, transform .05s;
}
.btn:hover { filter: brightness(0.97); }
.btn:active { transform: translateY(1px); }
.btn:disabled { cursor: not-allowed; opacity: .55; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }

.status { font-size: 13px; font-weight: 500; color: var(--ok); min-height: 1em; }
.status.is-error, .hint.is-error { color: var(--error); }

/* ---------- preview & source ---------- */
.preview-card {
  background:
    linear-gradient(#fff, #fff) padding-box,
    repeating-linear-gradient(45deg, var(--line) 0 6px, transparent 6px 12px) border-box;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 26px;
  overflow-x: auto;
}
.preview-note { font-size: 11.5px; color: var(--faint); margin: 10px 2px 0; line-height: 1.5; }
.preview-warnings {
  font-size: 12px;
  color: var(--error);
  background: color-mix(in srgb, var(--error) 6%, #fff);
  border: 1px solid color-mix(in srgb, var(--error) 25%, #fff);
  border-radius: 10px;
  padding: 8px 12px;
  margin-top: 10px;
}

details { margin-top: 16px; }
details.flush { margin-top: 0; }
summary { cursor: pointer; font-size: 13px; font-weight: 500; color: var(--muted); }
.code {
  width: 100%;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
}
.code.tall { min-height: 220px; }
.code.medium { min-height: 180px; }


footer.author { text-align: center; padding: 18px 32px 28px; font-size: 11.5px; color: var(--faint); }
footer.author a { color: var(--faint); text-decoration: none; }
footer.author a:hover { color: var(--muted); text-decoration: underline; }
