/* The Crow's Forge - Studio frontend. Deliberately plain for now (no logo/branding system yet, unlike the Vault -
   see docs/studio.md, "skipping this round") - the goal is a working, testable app, not a polished storefront. */
:root {
  --bg: #12100e;
  --panel: #1b1815;
  --panel-hi: #23201c;
  --text: #ece7e0;
  --muted: #9c9186;
  --line: #322d27;
  --gold: #c9a24b;
  --gold-hi: #e0bb63;
  --danger: #c8453a;
  --ok: #4c9a6a;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, "Segoe UI", Inter, Arial, sans-serif;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hi); }
.muted { color: var(--muted); }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 14px 24px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.topbar .brand { font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--gold); }
.topbar nav { display: flex; gap: 16px; flex: 1; }
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.auth-container { max-width: 420px; margin: 60px auto; padding: 32px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; }
.auth-container h1 { font-size: 1.3rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--gold); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 16px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.02em; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=datetime-local], select, textarea {
  width: 100%; padding: 9px 10px; background: var(--panel-hi); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; font-size: 0.95rem; font-family: inherit;
}
textarea { min-height: 80px; resize: vertical; }
input[type=checkbox] { width: 18px; height: 18px; }
button, .btn {
  display: inline-block; padding: 10px 18px; border-radius: 6px; border: 1px solid var(--gold);
  background: var(--gold); color: #1b1815; font-weight: 600; cursor: pointer; font-size: 0.9rem;
}
button.ghost, .btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
button.danger, .btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.error { color: var(--danger); margin: 10px 0; }
.message { color: var(--ok); margin: 10px 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.tile h3 { margin: 0 0 6px; font-size: 1rem; }
.tile .actions { display: flex; gap: 8px; margin-top: 10px; }
.tooltip-hint { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

/* editor layout: front | back | live preview */
.editor-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; align-items: start; }
.editor-col h2 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--gold); }
.preview-pane { position: sticky; top: 20px; }
.preview-frame-wrap { background: repeating-conic-gradient(#2a2622 0% 25%, #23201c 0% 50%) 50% / 20px 20px;
  border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; justify-content: center; }
.preview-frame-wrap iframe { border: 0; background: transparent; max-width: 100%; }
.save-bar { position: sticky; bottom: 0; background: var(--panel); border-top: 1px solid var(--line);
  padding: 14px 0; margin-top: 20px; display: flex; gap: 10px; align-items: center; }
