:root {
  --navy: #123b52;
  --teal: #1e7b7d;
  --gold: #a9803a;
  --page: #f4efe6;
  --card: #fffcf6;
  --line: #d9d2c3;
  --muted: #5c6d7c;
  --warn: #fff4d6;
  --danger: #8f2f2f;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "IBM Plex Sans Arabic", Cairo, sans-serif;
  color: var(--navy);
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(169, 128, 58, 0.16), transparent 55%),
    radial-gradient(700px 380px at -10% 18%, rgba(30, 123, 125, 0.12), transparent 50%),
    var(--page);
}

.wrap {
  width: min(560px, calc(100% - 28px));
  margin: 0 auto;
  padding: 16px 0 48px;
  display: grid;
  gap: 12px;
}

.trial {
  background: #fff3cd;
  border: 1px solid #e6d28a;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.brand { display: grid; gap: 6px; padding: 4px 2px; }
.kicker { margin: 0; color: var(--teal); font-size: 13px; font-weight: 800; }
.brand h1 {
  margin: 0;
  font-family: "Aref Ruqaa", Cairo, serif;
  font-size: clamp(34px, 10vw, 46px);
  line-height: 1.15;
  font-weight: 700;
}
.lead { margin: 0; color: var(--muted); font-size: 14px; font-weight: 500; line-height: 1.7; }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.steps li {
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  border-bottom: 3px solid var(--line);
  padding: 6px 2px;
}
.steps li.on { color: var(--navy); border-color: var(--gold); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 10px;
  box-shadow: 0 12px 28px rgba(18, 59, 82, 0.06);
}
h2 { margin: 0; font-family: Cairo, sans-serif; font-size: 18px; font-weight: 800; }
.subhead { margin: 8px 0 0; font-size: 15px; font-weight: 800; }
label { display: grid; gap: 4px; font-size: 13px; font-weight: 800; }
input, select, textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: 500 15px "IBM Plex Sans Arabic", Cairo, sans-serif;
  color: var(--navy);
  background: #fff;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hint { margin: 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.countline { font-size: 13px; font-weight: 800; color: var(--teal); }

.primary, .row a, #copyBtn, #saveQrBtn {
  min-height: 50px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #123b52, #1a5a6e);
  color: #fff8ea;
  font: 800 15px Cairo, sans-serif;
  cursor: pointer;
  display: grid;
  place-items: center;
  text-decoration: none;
}
.primary:disabled { opacity: 0.45; cursor: not-allowed; }
.ghost, #saveQrBtn {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
}

.drop {
  border: 2px dashed var(--gold);
  border-radius: 16px;
  padding: 28px 14px;
  text-align: center;
  background: #fffdf8;
  cursor: pointer;
  display: grid;
  gap: 6px;
}
.drop.drag { background: #fff7e8; border-color: var(--navy); }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 220px; overflow: auto; }
.list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  background: #fff;
}

.bar {
  height: 12px;
  border-radius: 999px;
  background: #e7e0d2;
  overflow: hidden;
}
.bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 0.25s ease;
}

.review {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  background: #fff;
}
.review.warn { background: var(--warn); }
.review .top { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.review b { font-size: 14px; }
.review small { color: var(--muted); }
.review button[data-act="remove"] {
  background: #f4e4e4;
  color: var(--danger);
  border: 0;
  border-radius: 10px;
  min-height: 40px;
  font: 800 12px Cairo, sans-serif;
  cursor: pointer;
}

.templates { display: grid; gap: 8px; }
.tpl {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  text-align: right;
  cursor: pointer;
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 2px;
  align-items: center;
}
.tpl strong { font-size: 15px; }
.tpl small { grid-column: 2; color: var(--muted); font-size: 12px; font-weight: 600; }
.tpl.on { border-color: var(--navy); box-shadow: 0 0 0 2px rgba(18, 59, 82, 0.12); }
.swatch {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  grid-row: 1 / span 2;
}
.swatch.rasmi { background: linear-gradient(135deg, #123b52, #a9803a); }
.swatch.wadih { background: linear-gradient(135deg, #e8f2f3, #1a6b6d); }
.swatch.muneer { background: linear-gradient(135deg, #071525, #c9a227); }

.qrbox { display: grid; place-items: center; padding: 8px; background: #fff; border-radius: 16px; border: 1px solid var(--line); }
.qrbox svg { width: min(100%, 220px); height: auto; }
.link { text-align: center; word-break: break-all; font-weight: 800; margin: 0; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row a { grid-column: 1 / -1; }

.msg {
  background: #ffe8e8;
  border: 1px solid #f0b4b4;
  color: #7a1f1f;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 420px) {
  .grid2 { grid-template-columns: 1fr; }
  .steps { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .bar span { transition: none; }
}
