/* SeriousPixel Studio form embeds, shown in iframes on seriouspixel.studio/contact.html.
   The colour tokens match the Studio site (website/assets/css/site.css in the
   SeriousPixel_Studio repo); keep them in step when the Studio look changes. */
:root {
  color-scheme: dark;
  --bg: #0a0b0d;
  --panel: #14161a;
  --panel-2: #1a1d22;
  --panel-3: #21252b;
  --line: #262a31;
  --line-2: #343a45;
  --text: #eceef1;
  --muted: #a8aeb8;
  --dim: #868d99;
  --accent: #ff6b3d;
  --accent-2: #ff8d66;
  --accent-ink: #1a0a04;
  --accent-soft: rgba(255, 107, 61, 0.14);
  --ok: #3ecf8e;
  --warn: #f2b84b;
  --info: #6aa7ff;
  --danger: #ff6b7a;
  --radius: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* The panel colour matches the .form-card the iframe sits in. The padding leaves room for focus
   rings and the button glow; the Studio page offsets it with negative margins on the iframe. */
html, body { margin: 0; background: var(--panel); }
body {
  padding: 4px 16px 20px;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
main { display: flow-root; }
button, input, select, textarea { font: inherit; color: inherit; }
h3 { margin: 0 0 0.5em; line-height: 1.12; letter-spacing: -0.022em; font-weight: 650; font-size: 1.2rem; }
p { margin: 0 0 1em; }
code { font-size: 0.88em; background: var(--panel-2); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line); }
.muted { color: var(--muted); }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.btn {
  --btn-bg: var(--panel-2); --btn-fg: var(--text); --btn-bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
  font-weight: 600; font-size: 0.95rem; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn:hover { --btn-bg: var(--panel-3); --btn-bd: #4a5160; }
.btn:active { transform: translateY(1px); }
.btn-primary { --btn-bg: var(--accent); --btn-fg: var(--accent-ink); --btn-bd: var(--accent); box-shadow: 0 8px 30px -10px rgba(255, 107, 61, 0.7); }
.btn-primary:hover { --btn-bg: var(--accent-2); --btn-bd: var(--accent-2); }
.btn-lg { min-height: 52px; padding: 12px 24px; font-size: 1rem; }
.btn[aria-busy="true"] { opacity: 0.7; cursor: progress; }

.callout {
  border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: var(--radius);
  padding: 16px 20px; background: var(--panel); color: var(--muted); font-size: 0.95rem;
}
.callout strong { color: var(--text); }
.callout-info { border-left-color: var(--info); }
.callout-warn { border-left-color: var(--warn); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; margin-top: 8px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.field { display: grid; gap: 6px; align-content: start; }
.field > label, .field legend { font-size: 0.88rem; font-weight: 600; color: var(--text); }
.field .opt { color: var(--dim); font-weight: 400; }
.field .hint { color: var(--dim); font-size: 0.8rem; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field legend { padding: 0; margin-bottom: 8px; }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--line-2); color: var(--text); font-size: 0.97rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat;
}
.input::placeholder, .textarea::placeholder { color: #6b7280; }
.input:hover, .select:hover, .textarea:hover { border-color: #4a5160; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
[aria-invalid="true"].input, [aria-invalid="true"].select, [aria-invalid="true"].textarea { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 0.82rem; }
.field-error:empty { display: none; }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 420px) { .checks { grid-template-columns: minmax(0, 1fr); } }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; font-size: 0.92rem; color: var(--muted); }
.check:hover { border-color: var(--line-2); }
.check input { accent-color: var(--accent); width: 18px; height: 18px; margin: 2px 0 0; flex-shrink: 0; }
.check:has(input:checked) { border-color: rgba(255, 107, 61, 0.5); color: var(--text); }
.check.plain { border: 0; background: transparent; padding: 0; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 24px; }
.form-actions small { color: var(--dim); font-size: 0.82rem; max-width: 52ch; }
.form-status { margin-top: 16px; }
.form-status:empty { display: none; }
.form-success { padding: 8px 0 4px; }
.form-success:focus { outline: none; }
.form-success h3 { display: flex; align-items: center; gap: 10px; }
.form-success h3::before { content: ""; width: 22px; height: 22px; border-radius: 50%; background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2304140c' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 14px no-repeat; flex-shrink: 0; }
.form-success p:last-child { margin-bottom: 0; }
