/*
 * rw-expres/public/wizard.css
 * ───────────────────────────
 * FR/EN signup wizard styling — built on the AIOS Shell (aios-bg / aios-card).
 * Brand colour and surfaces come from CSS variables ONLY (never hardcoded hex
 * in markup or JS). Dark theme default; light via :root.theme-day. Responsive
 * at the 768px shell breakpoint. No CDN; all assets are platform-served.
 */

:root {
  --rwx-brand: #2563eb;
  --rwx-brand-soft: rgba(37, 99, 235, 0.14);
  --rwx-accent: #6366f1;
  --rwx-text: #e5e7eb;
  --rwx-muted: #94a3b8;
  --rwx-line: rgba(148, 163, 184, 0.2);
  --rwx-ok: #10b981;
  --rwx-warn: #f59e0b;
  --rwx-err: #ef4444;
  --rwx-card: rgba(9, 14, 28, 0.78);
  --rwx-radius: 14px;
}

:root.theme-day {
  --rwx-text: #0f172a;
  --rwx-muted: #475569;
  --rwx-line: rgba(15, 23, 42, 0.14);
  --rwx-card: rgba(255, 255, 255, 0.92);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--rwx-text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh;
}

.rwx-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 20px 96px;
}

/* ── Top bar: brand + language toggle ────────────────────────────── */
.rwx-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.rwx-brand {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--rwx-brand);
}

.rwx-lang {
  display: inline-flex;
  border: 1px solid var(--rwx-line);
  border-radius: 10px;
  overflow: hidden;
}

.rwx-lang button {
  border: none;
  background: transparent;
  color: var(--rwx-muted);
  font: inherit;
  font-weight: 700;
  padding: 6px 14px;
  cursor: pointer;
  min-height: 36px;
}

.rwx-lang button[aria-pressed="true"] {
  background: var(--rwx-brand);
  color: #fff;
}

/* ── Stepper ─────────────────────────────────────────────────────── */
.rwx-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.rwx-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--rwx-line);
  flex-shrink: 0;
}

.rwx-dot.done { background: var(--rwx-brand); border-color: var(--rwx-brand); }
.rwx-dot.now { border-color: var(--rwx-brand); box-shadow: 0 0 0 4px var(--rwx-brand-soft); }
.rwx-bar { flex: 1; height: 2px; background: var(--rwx-line); }
.rwx-bar.done { background: var(--rwx-brand); }

.rwx-stepcaption {
  font-size: 0.8rem;
  color: var(--rwx-muted);
  margin-bottom: 18px;
}

/* ── Panels ──────────────────────────────────────────────────────── */
.rwx-panel { padding: 24px; }
.rwx-panel[hidden] { display: none; }
.rwx-panel h2 { margin: 0 0 4px; font-size: 1.35rem; font-weight: 800; }
.rwx-panel .rwx-sub { color: var(--rwx-muted); font-size: 0.88rem; margin: 0 0 20px; }

/* ── Plan tiles ──────────────────────────────────────────────────── */
.rwx-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.rwx-tile {
  border: 1px solid var(--rwx-line);
  border-radius: var(--rwx-radius);
  padding: 18px;
  background: var(--rwx-card);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s, transform 0.15s;
}

.rwx-tile:hover { border-color: var(--rwx-brand); transform: translateY(-2px); }
.rwx-tile[aria-pressed="true"] { border-color: var(--rwx-brand); box-shadow: 0 0 0 2px var(--rwx-brand-soft); }
.rwx-tile .rwx-price { font-size: 1.5rem; font-weight: 800; color: var(--rwx-brand); }
.rwx-tile .rwx-tname { font-weight: 700; font-size: 1rem; }
.rwx-tile .rwx-tdesc { color: var(--rwx-muted); font-size: 0.82rem; }
.rwx-tile .rwx-credit { font-size: 0.78rem; color: var(--rwx-ok); font-weight: 600; }

.rwx-inclusions {
  margin-top: 18px;
  font-size: 0.84rem;
  color: var(--rwx-muted);
  line-height: 1.5;
}

/* ── Quantity stepper ────────────────────────────────────────────── */
.rwx-qty {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.rwx-qty[hidden] { display: none; }
.rwx-qty label { font-weight: 600; font-size: 0.9rem; }

.rwx-qty .rwx-stepbtn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--rwx-line);
  background: transparent;
  color: var(--rwx-text);
  font-size: 1.2rem;
  cursor: pointer;
}

.rwx-qty .rwx-stepbtn:disabled { opacity: 0.4; cursor: default; }
.rwx-qty output { min-width: 34px; text-align: center; font-weight: 800; font-size: 1.15rem; }
.rwx-qty .rwx-qtyhint { color: var(--rwx-muted); font-size: 0.78rem; }

/* ── Tabs (OAuth modes) ──────────────────────────────────────────── */
.rwx-tabs { display: flex; gap: 4px; border: 1px solid var(--rwx-line); border-radius: 10px; padding: 4px; margin-bottom: 16px; }
.rwx-tabs button { flex: 1; border: none; background: transparent; color: var(--rwx-muted); font: inherit; font-weight: 600; padding: 9px; border-radius: 7px; cursor: pointer; min-height: 40px; }
.rwx-tabs button[aria-selected="true"] { background: var(--rwx-brand); color: #fff; }
.rwx-tabpanel[hidden] { display: none; }

/* ── Trust / info boxes ──────────────────────────────────────────── */
.rwx-trust {
  border: 1px solid var(--rwx-line);
  border-left: 3px solid var(--rwx-brand);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--rwx-brand-soft);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 16px;
}

.rwx-code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--rwx-brand);
  -webkit-user-select: all;
  user-select: all;
}

.rwx-pending { display: flex; align-items: center; gap: 10px; color: var(--rwx-muted); font-size: 0.85rem; }
.rwx-spin { width: 16px; height: 16px; border: 2px solid var(--rwx-line); border-top-color: var(--rwx-brand); border-radius: 50%; animation: rwx-rot 0.8s linear infinite; }
@keyframes rwx-rot { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rwx-spin { animation: none; } }

.rwx-chip-ok { display: inline-flex; align-items: center; gap: 6px; color: var(--rwx-ok); font-weight: 700; font-size: 0.9rem; }

/* ── Fields ──────────────────────────────────────────────────────── */
.rwx-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.rwx-field label { font-size: 0.84rem; font-weight: 600; color: var(--rwx-muted); }
.rwx-input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--rwx-line);
  border-radius: 10px;
  background: transparent;
  color: var(--rwx-text);
  font: inherit;
}
.rwx-input:focus { outline: none; border-color: var(--rwx-brand); box-shadow: 0 0 0 3px var(--rwx-brand-soft); }
.rwx-reveal { display: flex; gap: 8px; align-items: center; }
.rwx-reveal .rwx-input { flex: 1; }

/* ── Persona picker ──────────────────────────────────────────────── */
.rwx-personas { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.rwx-persona { border: 1px solid var(--rwx-line); border-radius: var(--rwx-radius); padding: 14px; background: var(--rwx-card); cursor: pointer; font: inherit; color: inherit; text-align: left; }
.rwx-persona:hover { border-color: var(--rwx-brand); }
.rwx-persona[aria-pressed="true"] { border-color: var(--rwx-brand); box-shadow: 0 0 0 2px var(--rwx-brand-soft); }
.rwx-persona .rwx-pname { font-weight: 700; }
.rwx-persona .rwx-pdesc { color: var(--rwx-muted); font-size: 0.8rem; margin-top: 4px; }

/* ── Pay summary ─────────────────────────────────────────────────── */
.rwx-summary { border: 1px solid var(--rwx-line); border-radius: var(--rwx-radius); padding: 18px; background: var(--rwx-card); margin-bottom: 16px; }
.rwx-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.9rem; }
.rwx-row.total { border-top: 1px solid var(--rwx-line); margin-top: 6px; padding-top: 12px; font-weight: 800; font-size: 1.05rem; }
.rwx-row .rwx-credit { color: var(--rwx-ok); }

/* ── Provisioning feed ───────────────────────────────────────────── */
.rwx-feed { list-style: none; padding: 0; margin: 16px 0; display: flex; flex-direction: column; gap: 10px; }
.rwx-feed li { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; }
.rwx-feed .rwx-tick { color: var(--rwx-ok); font-weight: 800; }
.rwx-token-box { border: 1px dashed var(--rwx-warn); border-radius: 10px; padding: 14px; background: rgba(245, 158, 11, 0.08); margin: 14px 0; }
.rwx-token-val { font-family: ui-monospace, Menlo, monospace; font-weight: 700; word-break: break-all; }

/* ── Buttons / nav ───────────────────────────────────────────────── */
.rwx-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }
.rwx-btn { border: none; border-radius: 10px; font: inherit; font-weight: 700; padding: 12px 22px; cursor: pointer; min-height: 44px; }
.rwx-btn:disabled { opacity: 0.45; cursor: default; }
.rwx-btn-primary { background: var(--rwx-brand); color: #fff; }
.rwx-btn-ghost { background: transparent; border: 1px solid var(--rwx-line); color: var(--rwx-muted); }
.rwx-btn-ghost:hover { border-color: var(--rwx-brand); color: var(--rwx-text); }

.rwx-skeleton { height: 64px; border-radius: var(--rwx-radius); background: linear-gradient(90deg, var(--rwx-line), rgba(148,163,184,0.06), var(--rwx-line)); background-size: 200% 100%; animation: rwx-shimmer 1.2s linear infinite; }
.rwx-skeleton--gap { margin-top: 12px; }
@keyframes rwx-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .rwx-skeleton { animation: none; } }

.rwx-error { color: var(--rwx-err); font-size: 0.85rem; margin-top: 8px; }

/* ── Utility ─────────────────────────────────────────────────────── */
.rwx-hidden { visibility: hidden; }

/* ── Mobile (<=768px shell breakpoint) ───────────────────────────── */
@media (max-width: 768px) {
  .rwx-tiles { grid-template-columns: 1fr; }
  .rwx-personas { grid-template-columns: 1fr; }
  .rwx-wrap { padding: 18px 14px 80px; }
  .rwx-actions { flex-direction: column-reverse; }
  .rwx-btn { width: 100%; }
}
