:root {
  --bg: #0b0b0f;
  --surface: #15151c;
  --surface-alt: #1c1c26;
  --border: #2a2a35;
  --text: #e8e8ee;
  --text-dim: #9a9aa5;
  --accent: #6c5ce7;
  --accent-hover: #7d6ff0;
  --danger: #e74c3c;
  --success: #2ecc71;
  --warning: #f1c40f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; }

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  padding: 1.5rem 1rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.site-header h1 { margin: 0.25rem 0; font-size: 1.6rem; }
.site-header p { color: var(--text-dim); margin: 0; }
.site-header a { text-decoration: none; font-size: 0.85rem; color: var(--text-dim); }

.site-main {
  flex: 1;
  padding: 1.5rem 1rem;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
}

.type-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .type-grid { grid-template-columns: 1fr 1fr; }
}

.type-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.type-card h2 { margin: 0 0 0.5rem; font-size: 1.15rem; }
.type-card p { color: var(--text-dim); flex: 1; margin: 0 0 1rem; }
.type-card .price { color: var(--text); font-weight: 600; margin-bottom: 1rem; }
.price { color: var(--text); font-weight: 600; }
.price-secondary { color: var(--text-dim); font-size: 0.8rem; margin: -0.75rem 0 1rem; }

.req { color: var(--danger); }

label { display: block; margin: 1rem 0 0.35rem; font-size: 0.9rem; color: var(--text-dim); }

input, select, textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}

textarea { min-height: 120px; }

/* v1.0.8: radio/checkboxes field types. The generic `input { width: 100% }`
   rule above is for full-width text-style inputs — explicitly overridden
   here since a radio/checkbox stretched to 100% width would look broken. */
input[type="radio"], input[type="checkbox"] { width: auto; margin: 0; }
.radio-group, .checkbox-group { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.35rem; }
.option-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
}

button, .btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}

button:hover, .btn:hover { background: var(--accent-hover); }
button:disabled { opacity: 0.6; cursor: default; }

.btn-secondary { background: var(--surface-alt); border: 1px solid var(--border); color: var(--text); }

.msg { padding: 0.7rem 0.9rem; border-radius: 8px; font-size: 0.9rem; margin: 1rem 0; }
.msg-error { background: rgba(231, 76, 60, 0.15); color: var(--danger); }
.msg-warning { background: rgba(241, 196, 15, 0.15); color: var(--warning); }

.preview-frame-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

#previewFrame {
  width: 100%;
  height: 70vh;
  border: none;
  display: block;
}

/* v1.1.5 Part A: native Fullscreen API target is the WRAPPER div, not the
   iframe itself — requesting fullscreen on the iframe directly would work
   too, but the wrapper also has the border/border-radius styling above,
   which fullscreen-ing the iframe alone would visually clip/lose. Only
   the standard (unprefixed) and WebKit-prefixed forms are covered —
   Firefox has supported the unprefixed :fullscreen pseudo-class since
   ESR 64 (well past this app's realistic browser support floor), and
   there is no realistic remaining browser needing the old -moz- prefix. */
#previewFrameWrap:fullscreen,
#previewFrameWrap:-webkit-full-screen {
  border: none;
  border-radius: 0;
  background: #fff;
}
#previewFrameWrap:fullscreen #previewFrame,
#previewFrameWrap:-webkit-full-screen #previewFrame {
  height: 100vh;
}
