/* Palette, type and control sizes follow the Zirosol builder's account screens
   (apps/builder/app/globals.css, the --auth-* tokens). */
:root {
  color-scheme: dark;
  --bg: #0a0a0b;
  --art-bg: #050506;
  --fg: #f3f3f4;
  --fg-label: #dfdfe2;
  --fg-muted: #9a9aa1;
  --fg-faint: #6b6b72;
  --field-bg: #141417;
  --field-bg-focus: #17171b;
  --field-border: #26262b;
  --field-hover: #323238;
  --field-focus: #4a4a52;
  --accent: #ff4500;
  --accent-hover: #ff6a2a;
  --accent-soft: rgb(255 69 0 / .12);
  --danger: #ff6369;
  --success: #4ade80;
  --radius: 9px;
  --font: 'Satoshi', 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

/* ── Shell: form rail, and on wide screens the orb panel ─────────────── */

.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 1000px) {
  .shell { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

.rail {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding:
    max(22px, env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right))
    max(22px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
}
@media (min-width: 600px) {
  .rail { padding: 30px clamp(24px, 4.8vw, 74px) 26px; }
}

.topbar { display: flex; align-items: center; }
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: #f2f2f3;
}
.wordmark svg { width: 26px; height: 26px; }

.body { flex: 1; display: flex; align-items: center; padding: 36px 0 32px; }
@media (min-width: 600px) { .body { padding: 56px 0 40px; } }
.content { width: 100%; max-width: 542px; }

.footer { font-size: 13px; color: var(--fg-faint); }

/* ── Headings ─────────────────────────────────────────────────────────── */

.eyebrow {
  margin: 0 0 14px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.eyebrow-success { color: var(--success); }

.title {
  margin: 0;
  font-size: clamp(2.35rem, 9vw, 4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.035em;
  color: #fff;
}
.subtitle {
  margin: 14px 0 0;
  max-width: 30em;
  font-size: 16.5px;
  color: var(--fg-muted);
}

/* ── Form ─────────────────────────────────────────────────────────────── */

form { margin-top: 36px; }

.step {
  margin: 0;
  padding: 26px 0 0;
  border: 0;
  border-top: 1px solid var(--field-border);
  min-width: 0;
}
.step + .step { margin-top: 14px; }
.step legend {
  float: left;
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 20px;
  padding: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.step legend + * { clear: both; }
.step-no { font: 600 12px var(--mono); color: var(--accent); letter-spacing: 0; }

.field { margin-bottom: 18px; }
.pair { display: grid; gap: 0 14px; }
@media (min-width: 600px) { .pair { grid-template-columns: 1fr 1fr; } }

label, .label {
  display: block;
  margin-bottom: 8px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--fg-label);
}
.optional { font-weight: 400; color: var(--fg-faint); margin-left: 4px; }

input:not([type=radio]):not([type=file]), textarea {
  width: 100%;
  height: 53px;
  padding: 0 17px;
  border-radius: var(--radius);
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  color: var(--fg);
  font: 16px var(--font); /* 16px keeps iOS from zooming in on focus */
  outline: none;
  transition: border-color .15s, background .15s;
  -webkit-appearance: none;
  appearance: none;
}
textarea { height: auto; min-height: 96px; padding: 14px 17px; resize: vertical; line-height: 1.45; }
input[type=date] { min-width: 0; }
input[type=date]::-webkit-date-and-time-value { text-align: left; }
::placeholder { color: #5a5a61; }
input:hover, textarea:hover { border-color: var(--field-hover); }
input:focus, textarea:focus { border-color: var(--field-focus); background: var(--field-bg-focus); }

/* One box holding two controls: currency + amount, date + Today */
.joined {
  display: flex;
  height: 53px;
  border-radius: var(--radius);
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  transition: border-color .15s, background .15s;
}
.joined:hover { border-color: var(--field-hover); }
.joined:focus-within { border-color: var(--field-focus); background: var(--field-bg-focus); }
.joined > input[name], .joined > input[name]:hover, .joined > input[name]:focus {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
}
.joined select {
  flex: none;
  height: 100%;
  padding: 0 32px 0 16px;
  border: 0;
  border-right: 1px solid var(--field-border);
  border-radius: var(--radius) 0 0 var(--radius);
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9aa1' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center / 14px;
  color: var(--fg);
  font: 600 14px var(--mono);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.joined select option { background: var(--field-bg); color: var(--fg); }

/* Country code: an invisible native select over a face showing flag + code */
.dial {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  padding: 0 32px 0 14px;
  border-right: 1px solid var(--field-border);
  border-radius: var(--radius) 0 0 var(--radius);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9aa1' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center / 14px;
  font: 600 14px var(--mono);
  white-space: nowrap;
}
.joined .dial select {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  font-size: 16px;
}
.dial:has(select:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.today {
  flex: none;
  height: 100%;
  padding: 0 16px;
  border: 0;
  border-left: 1px solid var(--field-border);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: transparent;
  color: var(--fg-label);
  font: 500 14.5px var(--font);
  cursor: pointer;
  transition: color .15s;
}
.today:hover { color: var(--accent); }
.joined select:focus-visible, .today:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.field.invalid input, .field.invalid textarea, .field.invalid .joined { border-color: rgb(255 99 105 / .55); }
.field-error {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 8px 0 0;
  font-size: 13.5px;
  color: var(--danger);
}
.field-error::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 7.5v5.5M12 16.5v.01'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9.5'/%3E%3Cpath d='M12 7.5v5.5M12 16.5v.01'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Payment method chips */
.chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 600px) { .chips { grid-template-columns: repeat(4, 1fr); } }
.chip { margin: 0; position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 10px;
  border-radius: var(--radius);
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--fg-label);
  font-size: 14.5px;
  font-weight: 500;
  text-align: center;
  transition: border-color .15s, background .15s, color .15s;
}
.chip:hover span { border-color: var(--field-hover); }
.chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Drop zone */
.dropzone {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 30px 18px;
  border-radius: var(--radius);
  border: 1px dashed #34343b;
  background: var(--field-bg);
  color: var(--fg);
  font: 500 16px var(--font);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone svg {
  width: 26px;
  height: 26px;
  margin-bottom: 4px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dropzone u { text-decoration-color: var(--accent); text-underline-offset: 3px; }
.drop-hint { font-size: 13px; font-weight: 400; color: var(--fg-faint); }
.drop-fine { display: none; }
@media (hover: hover) and (pointer: fine) {
  .drop-touch { display: none; }
  .drop-fine { display: inline; }
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: #17140f; }
.dropzone:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone.missing { border-color: rgb(255 99 105 / .6); }

.file-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.file-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--field-border);
  background: var(--field-bg);
}
.thumb {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  background: #1c1c20;
  display: grid;
  place-items: center;
  font: 600 10px var(--mono);
  color: var(--fg-muted);
}
.file-info { flex: 1; min-width: 0; }
.file-info strong { display: block; font-size: 14.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info span { font: 500 12px var(--mono); color: var(--fg-faint); }
.file-list li.uploaded .file-info span::after { content: " · sent"; color: var(--success); }
.remove {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--fg-faint);
  cursor: pointer;
}
.remove svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.remove:hover { background: #1f1f23; color: var(--fg); }
.remove:disabled { opacity: .4; cursor: default; }

.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.note {
  margin: 26px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid rgb(255 99 105 / .3);
  background: rgb(255 99 105 / .08);
  color: var(--danger);
  font-size: 14px;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */

.btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: 600 16px var(--font);
  cursor: pointer;
  transition: background .16s, border-color .16s;
}
.btn-primary { margin-top: 26px; background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:disabled { cursor: progress; }
.btn-primary .arrow { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary:disabled .arrow { display: none; }
.btn-primary .label, .btn-primary .btn-orb, .btn-primary .arrow { position: relative; z-index: 1; }
.btn-orb { --zo-ink: #ffffff; --zo-accent: #ffffff; }
.btn .progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--pct, 0%);
  background: rgb(255 255 255 / .16);
  transition: width .25s ease-out;
}
.btn-ghost { margin-top: 28px; background: #101013; border-color: var(--field-border); color: var(--fg-label); font-weight: 500; }
.btn-ghost:hover { background: #16161a; border-color: #3a3a42; }

.fineprint { margin: 14px 0 0; font-size: 13px; color: var(--fg-faint); text-align: center; }

/* ── Done ─────────────────────────────────────────────────────────────── */

.done-orb { display: block; margin: 0 0 22px -10px; color: var(--fg); }
@media (min-width: 1000px) { .done-orb { display: none; } }

.ref {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 30px;
  padding: 16px 16px 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--field-border);
  background: var(--field-bg);
}
.ref-label { font-size: 11.5px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-faint); }
.ref code { flex: 1; font: 600 clamp(18px, 5.4vw, 22px) var(--mono); letter-spacing: .04em; color: #fff; }
.ref-copy {
  height: 38px;
  padding: 0 14px;
  border-radius: 7px;
  border: 1px solid var(--field-border);
  background: #1a1a1e;
  color: var(--fg-label);
  font: 500 14px var(--font);
  cursor: pointer;
}
.ref-copy:hover { border-color: #3a3a42; }
@media (max-width: 420px) {
  .ref { flex-wrap: wrap; row-gap: 6px; }
  .ref-label { width: 100%; }
}

/* ── Orb panel (wide screens only) ────────────────────────────────────── */

.art { display: none; }
@media (min-width: 1000px) {
  .art {
    position: sticky;
    top: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 48px;
    background-color: var(--art-bg);
    /* The editor canvas's dot grid, very faint */
    background-image: radial-gradient(rgb(255 255 255 / .045) 1px, transparent 1.2px);
    background-size: 22px 22px;
    border-left: 1px solid #111114;
    color: var(--fg);
  }
}
.art-copy { max-width: 400px; text-align: center; }
.art-copy h2 { margin: 0; font-size: clamp(1.6rem, 2.3vw, 2.15rem); font-weight: 700; line-height: 1.15; letter-spacing: -.03em; color: #fff; }
.art-copy p { margin: 12px 0 0; font-size: 16px; color: rgb(243 243 244 / .62); }
.shell[data-state=error] .art-copy h2 { color: var(--danger); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
