/* The sign-up page: the look of crustypixel.com (cream, ink and the flame), on one page. */
:root {
  color-scheme: light;
  --cream: #fff8f0;
  --cream-2: #ffefe1;
  --white: #fff;
  --ink: #1a1210;
  --ink-2: #4a3b35;
  --muted: #776860;
  --line: rgba(26, 18, 16, 0.1);
  --line-2: rgba(26, 18, 16, 0.18);
  --red: #c8141e;
  --ok: #1d7a46;
  --flame-btn: linear-gradient(100deg, #c8141e 0%, #e8361f 45%, #f26b1d 100%);
  --display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 18px;
  --shadow: 0 2px 6px rgba(26, 18, 16, 0.05), 0 18px 40px rgba(26, 18, 16, 0.08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 16px/1.55 var(--sans); }
[hidden] { display: none !important; }
a { color: var(--red); }
h1, h2 { font-family: var(--display); letter-spacing: -0.02em; margin: 0; }

.top { max-width: 960px; margin: 0 auto; padding: 20px 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 800 18px var(--display); }
.testmode { margin: 0; padding: 10px 16px; background: #fff3c4; color: #5b4500; text-align: center; font-size: 14px; }

.wrap { max-width: 960px; margin: 0 auto; padding: 8px 16px 64px; }
.intro { max-width: 640px; margin: 12px 0 28px; }
.intro h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.1; font-weight: 800; }
.intro p { color: var(--ink-2); margin: 12px 0 0; font-size: 17px; }

.notice { background: var(--cream-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 16px; margin: 0 0 20px; }

.step { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 24px; margin: 0 0 20px; }
.step h2 { font-size: 21px; display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--white); font: 700 14px var(--sans); }

/* Whose AI key */
.keymode { display: inline-flex; flex-wrap: wrap; gap: 6px; padding: 5px; background: var(--cream); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; }
.keymode label { cursor: pointer; }
.keymode input { position: absolute; opacity: 0; pointer-events: none; }
.keymode span { display: block; padding: 8px 14px; border-radius: 10px; }
.keymode b { display: block; font-size: 15px; }
.keymode small { color: var(--muted); font-size: 13px; }
.keymode input:checked + span { background: var(--white); box-shadow: 0 1px 4px rgba(26, 18, 16, 0.12); }
.keymode input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }

/* Plans */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.plan { position: relative; cursor: pointer; display: block; }
.plan input { position: absolute; opacity: 0; pointer-events: none; }
.plan .card { height: 100%; border: 2px solid var(--line); border-radius: 16px; padding: 18px; transition: border-color 0.15s, box-shadow 0.15s; }
.plan:hover .card { border-color: var(--line-2); }
.plan input:checked + .card { border-color: var(--red); box-shadow: 0 8px 24px rgba(200, 20, 30, 0.12); }
.plan input:focus-visible + .card { outline: 2px solid var(--red); outline-offset: 3px; }
.plan input:disabled + .card { opacity: 0.5; cursor: not-allowed; }
.plan .label { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.plan .name { font: 800 24px/1.2 var(--display); letter-spacing: -0.02em; }
.plan .price { margin: 8px 0 12px; font: 800 30px/1 var(--display); }
.plan .price small { font: 500 14px var(--sans); color: var(--muted); }
.plan ul { list-style: none; margin: 0; padding: 0; font-size: 14px; color: var(--ink-2); }
.plan li { padding: 3px 0 3px 22px; position: relative; }
.plan li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 10px; height: 6px; border-left: 2px solid var(--red); border-bottom: 2px solid var(--red); transform: rotate(-45deg); }
.plan .tick { position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); }
.plan input:checked + .card .tick { border-color: var(--red); background: var(--red); box-shadow: inset 0 0 0 4px var(--white); }

/* Fields */
.field { margin: 0 0 16px; }
.field label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.opt { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="email"] { width: 100%; font: inherit; color: inherit; padding: 11px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--white); }
input:focus { outline: 2px solid rgba(200, 20, 30, 0.35); outline-offset: 1px; border-color: var(--red); }
.hint { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.hint.ok { color: var(--ok); }
.hint.bad { color: var(--red); }
.address { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: 12px; background: var(--white); overflow: hidden; }
.address:focus-within { outline: 2px solid rgba(200, 20, 30, 0.35); outline-offset: 1px; border-color: var(--red); }
.address input { border: 0 !important; outline: 0 !important; border-radius: 0; padding-left: 2px; padding-right: 2px; min-width: 0; flex: 1; }
.address .pre, .address .post { display: flex; align-items: center; color: var(--muted); background: var(--cream); padding: 0 12px; white-space: nowrap; }
.address .pre { padding-right: 6px; background: transparent; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--red); }

/* Paying */
.pay { text-align: center; padding: 8px 0; }
.total { font-size: 17px; margin-bottom: 14px; }
.total b { font-family: var(--display); }
.btn { font: 700 18px var(--display); color: var(--white); background: var(--flame-btn); border: 0; border-radius: 999px; padding: 16px 40px; cursor: pointer; box-shadow: 0 10px 30px rgba(232, 54, 31, 0.3); }
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.error { color: var(--red); font-weight: 600; margin: 0 0 12px; }
.small { font-size: 14px; color: var(--muted); margin: 14px 0 0; }
.agree + .small { margin-top: 6px; }

/* After paying */
.done { display: grid; place-items: center; min-height: 50vh; }
.done .card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 36px 28px; max-width: 520px; text-align: center; }
.done h1 { font-size: 28px; margin-bottom: 10px; }
.done p { color: var(--ink-2); margin: 0; }
.done .small { margin-top: 14px; }
.spinner { width: 36px; height: 36px; margin: 0 auto 16px; border-radius: 50%; border: 4px solid var(--cream-2); border-top-color: var(--red); animation: spin 0.9s linear infinite; }
.spinner.ok { animation: none; border-color: var(--ok); position: relative; }
.spinner.ok::after { content: ""; position: absolute; left: 9px; top: 7px; width: 12px; height: 7px; border-left: 4px solid var(--ok); border-bottom: 4px solid var(--ok); transform: rotate(-45deg); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

@media (max-width: 760px) {
  .plans { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr; }
  .step { padding: 20px 16px; }
  .keymode { display: flex; }
  .keymode label { flex: 1; }
  .address .pre { display: none; }
  .address input { padding-left: 12px; }
  .address .post { padding: 0 8px; font-size: 14px; }
  .btn { width: 100%; padding: 16px 20px; }
}
