:root {
  --bg: #0f172a;
  --card: #1e293b;
  --fg: #f1f5f9;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-fg: #04141f;
  --ok: #22c55e;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.4 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 18px calc(24px + env(safe-area-inset-bottom));
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
h1 { font-size: 20px; text-align: center; margin: 8px 0 20px; }
.hint { color: var(--muted); text-align: center; margin: 0 0 16px; }
.step { display: none; flex-direction: column; gap: 14px; }
.step.active { display: flex; }

button {
  font: inherit;
  border: 0;
  border-radius: 12px;
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 600;
}
.primary { background: var(--accent); color: var(--accent-fg); }
.ghost { background: var(--card); color: var(--fg); }
.big { padding: 20px; font-size: 18px; }
.link {
  background: none;
  color: var(--muted);
  text-decoration: underline;
  padding: 6px;
  font-weight: 500;
  align-self: center;
}
button:disabled { opacity: .5; }
.row { display: flex; gap: 12px; }
.row button { flex: 1; }

#preview {
  width: 100%;
  border-radius: 14px;
  background: #000;
  max-height: 50vh;
  object-fit: contain;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
input {
  font: 16px/1.3 inherit;
  color: var(--fg);
  background: var(--card);
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 13px 14px;
}
input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.cc { flex: 0 0 34%; }
.ph { flex: 1; }

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  margin-right: 6px;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.big-check {
  font-size: 64px;
  color: var(--ok);
  text-align: center;
  margin-top: 24px;
}
#done-msg { text-align: center; color: var(--muted); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: #111827;
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: .25s;
  max-width: 90%;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
