:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --border: #e3e6eb;
  --text: #14171c;
  --muted: #6a717d;
  --accent: #0f9d76;
  --accent-ink: #ffffff;
  --accent-soft: #e3f5ef;
  --warn: #b26b00;
  --warn-soft: #fff4df;
  --danger: #c4372f;
  --danger-soft: #fdeceb;
  --info: #2459c7;
  --info-soft: #e8effc;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1013;
    --surface: #171a1f;
    --surface-2: #1e2228;
    --border: #2a2f37;
    --text: #eef0f3;
    --muted: #98a0ac;
    --accent: #2fc597;
    --accent-ink: #06231a;
    --accent-soft: #123328;
    --warn: #f0ad3c;
    --warn-soft: #34270f;
    --danger: #f06a61;
    --danger-soft: #3a1917;
    --info: #7aa5ff;
    --info-soft: #18243d;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans Arabic", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 16px 48px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.brand-name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand-name span { color: var(--accent); }

.net-chip {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  background: var(--surface);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.card + .card { margin-top: 14px; }

h1 {
  font-size: 20px;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.sub {
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 14px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.field { margin-bottom: 16px; }

.input-wrap { position: relative; }

input {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Amount is typed LTR, so the unit sits on the physical right in both directions */
.input-wrap input[dir="ltr"] { padding-right: 64px; }

.suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-ink);
}

.btn:disabled { opacity: 0.6; cursor: progress; }

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-sm {
  width: auto;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  padding: 4px 12px;
  background: var(--info-soft);
  color: var(--info);
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status.waiting::before { animation: pulse 1.6s ease-in-out infinite; }
.status.ok { background: var(--accent-soft); color: var(--accent); }
.status.warn { background: var(--warn-soft); color: var(--warn); }
.status.bad { background: var(--danger-soft); color: var(--danger); }

@keyframes pulse { 50% { opacity: 0.3; } }

.row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.timer {
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
  color: var(--muted);
}

.amount-box {
  text-align: center;
  padding: 18px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 14px;
}

.amount-label { font-size: 13px; color: var(--muted); margin-bottom: 2px; }

.desc {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

a.btn { text-decoration: none; }

.amount {
  font-family: "IBM Plex Mono", monospace;
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.02em;
  direction: ltr;
}

.amount small { font-size: 16px; color: var(--muted); font-weight: 500; }

.amount .frac { color: var(--accent); }

.note {
  font-size: 13px;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 12px 0;
}

.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.ok { background: var(--accent-soft); color: var(--accent); }
.note.bad { background: var(--danger-soft); color: var(--danger); }
.note.info { background: var(--info-soft); color: var(--info); }

.address-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.mono {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  direction: ltr;
  word-break: break-all;
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.qr {
  display: flex;
  justify-content: center;
  margin: 16px 0 4px;
}

.qr canvas, .qr img, .qr svg {
  background: #fff;
  padding: 10px;
  border-radius: 12px;
  width: 168px;
  height: 168px;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.steps li::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.steps li.active { color: var(--text); font-weight: 600; }
.steps li.active::before { border-color: var(--info); border-width: 5px; }
.steps li.done { color: var(--text); }
.steps li.done::before { background: var(--accent); border-color: var(--accent); }

.kv {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}

.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-family: "IBM Plex Mono", monospace; direction: ltr; }

.section-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 12px;
}

.success {
  text-align: center;
  padding: 10px 0 4px;
}

.success .check {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  margin: 0 auto 10px;
  font-size: 28px;
  font-weight: 700;
}

.hidden { display: none !important; }

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 22px;
}

.footer a { color: inherit; }
