:root {
  --ink: #122018;
  --muted: #5c6b63;
  --paper: #f3efe6;
  --card: #fffdf8;
  --line: #e3d9cb;
  --green: #127a4d;
  --green-dark: #0d5134;
  --deep: #10281c;
  --cream: #f7f3ea;
  --shadow: 0 18px 40px rgba(16, 40, 28, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(18, 122, 77, 0.12), transparent 60%),
    var(--paper);
  font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  line-height: 1.65;
}

a { color: var(--green-dark); }

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 6vw;
  background: rgba(255, 253, 248, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
}

.logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
}

nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 16px;
}

nav a { text-decoration: none; font-weight: 600; }

nav form { margin: 0; }

.who {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 4px 8px 4px 12px;
  border-radius: 999px;
  background: #e7f3ec;
  color: var(--ink);
  text-decoration: none;
}

.who.pending { background: #fff4df; }
.who.expired, .who.none { background: #f8e8e4; }
.who-name { font-weight: 700; }
.who-plan { color: var(--muted); font-weight: 600; }
.who .pill { margin: 0; }

.you-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 8px 0 0;
  color: #d5e6db;
}

.you-line .pill { margin: 0; }
.device-plan { margin: 10px 0 0; font-weight: 700; }

.lang {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  background: white;
}

main { padding: 28px 6vw 56px; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.25; margin: 0 0 12px; }
h2 { margin: 0 0 14px; font-size: 1.45rem; }
h3 { margin: 0; font-size: 1.25rem; }

.lead, .fine, .meta, .period { color: var(--muted); }
.period { margin-top: -8px; }

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.6fr);
  gap: 28px;
  align-items: center;
  background: linear-gradient(155deg, #184833, var(--deep) 62%);
  color: var(--cream);
  border-radius: 28px;
  padding: 40px 36px;
  box-shadow: var(--shadow);
}

.hero-band .lead { color: #d5e6db; max-width: 38rem; }
.hero-band .eyebrow { color: #9ddec0; }
.hero-band h1 { max-width: 16ch; }

.device {
  justify-self: center;
  width: min(230px, 100%);
  padding: 12px;
  border-radius: 32px;
  background: #0b1c14;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.device-screen {
  min-height: 280px;
  border-radius: 22px;
  padding: 28px 18px;
  background:
    radial-gradient(120px 80px at 50% 0%, rgba(157, 222, 192, 0.25), transparent 70%),
    #143528;
}

.device-brand { margin: 0; font-weight: 700; }
.device-status {
  display: inline-block;
  margin: 18px 0 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: #1d6b48;
  font-weight: 700;
}

.device-bars {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.device-bars span {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: rgba(247, 243, 234, 0.18);
}

.device-bars span:first-child { width: 72%; background: #9ddec0; }

.feature-row, .steps, .grid {
  display: grid;
  gap: 14px;
}

.feature-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.feature-row article, .card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
}

.feature-row h2 { font-size: 1.05rem; }
.feature-row p { margin: 0; color: var(--muted); }

.block { margin-top: 36px; }

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.steps.compact { grid-template-columns: 1fr; }

.steps li {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 16px 16px 58px;
}

[dir="rtl"] .steps li { padding: 18px 58px 16px 16px; }

.steps li::before {
  content: counter(step);
  counter-increment: step;
  position: absolute;
  top: 16px;
  left: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

[dir="rtl"] .steps li::before { left: auto; right: 16px; }

.grid, .plans { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.plans { align-items: stretch; }

.card, .panel { box-shadow: var(--shadow); }
.panel { max-width: 28rem; }
.panel.wide { max-width: none; overflow-x: auto; }

.price { font-size: 2rem; font-weight: 700; margin: 10px 0 0; line-height: 1.1; }

.includes {
  margin: 16px 0 18px;
  padding: 0;
  list-style: none;
}

.includes li {
  position: relative;
  padding: 6px 0 6px 18px;
}

[dir="rtl"] .includes li { padding: 6px 18px 6px 0; }

.includes li::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

[dir="rtl"] .includes li::before { left: auto; right: 0; }

.badge {
  display: inline-block;
  margin: 0 0 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e7f3ec;
  color: var(--green-dark);
  font-weight: 700;
}

.featured .badge {
  background: rgba(157, 222, 192, 0.16);
  color: #9ddec0;
}

.featured {
  background: var(--deep);
  color: var(--cream);
  border-color: transparent;
}

.featured .period, .featured .includes { color: #d5e6db; }
.featured .includes li::before { background: #9ddec0; }
.featured .button { background: var(--cream); color: var(--deep); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.button, button {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  background: var(--green);
  color: white;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button.ghost {
  background: transparent;
  color: var(--cream);
  border: 1px solid rgba(247, 243, 234, 0.35);
}

.button.line {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.setup .button,
.setup form { margin-top: 12px; }

.nav-cta { padding: 8px 14px; }

.dash {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(280px, 1.2fr);
  gap: 16px;
  align-items: start;
}

.status-card { min-height: 220px; }
.status-card.active { box-shadow: inset 4px 0 0 var(--green), var(--shadow); }
.status-card.pending { box-shadow: inset 4px 0 0 #c8882d, var(--shadow); }
.status-card.expired, .status-card.none { box-shadow: inset 4px 0 0 #b85a48, var(--shadow); }
[dir="rtl"] .status-card.active { box-shadow: inset -4px 0 0 var(--green), var(--shadow); }
[dir="rtl"] .status-card.pending { box-shadow: inset -4px 0 0 #c8882d, var(--shadow); }
[dir="rtl"] .status-card.expired,
[dir="rtl"] .status-card.none { box-shadow: inset -4px 0 0 #b85a48, var(--shadow); }

.setup { display: grid; justify-items: start; gap: 12px; }

.qr-frame {
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 24px;
}

.qr { display: block; width: min(240px, 100%); background: white; }

.wait-box {
  width: 100%;
  padding: 8px 0 4px;
}

.pill {
  display: inline-block;
  margin: 0 0 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e7f3ec;
  color: var(--green-dark);
  font-weight: 700;
}

.pill.pending { background: #fff4df; color: #8a5a12; }
.pill.expired { background: #f8e8e4; color: #8d3b2b; }

.page-head { max-width: 40rem; margin-bottom: 22px; }

.auth {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: center;
}

.auth aside {
  background: var(--deep);
  color: var(--cream);
  border-radius: 24px;
  padding: 32px 28px;
  min-height: 280px;
}

.auth aside .eyebrow, .auth aside .lead { color: #d5e6db; }

.admin-auth aside { background: #3d2a14; }
.admin-auth aside .eyebrow { color: #f0d7a8; }
.button.admin-button { background: #8a5a12; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.stats .price { margin: 0; }
.table-card { padding: 8px 12px 4px; overflow-x: auto; }
tr.is-pending { background: #fff8ee; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.row-actions form { margin: 0; }
.row-actions button { padding: 7px 12px; }
.row-actions button.stop { background: #8a5a12; }
.row-actions button.danger { background: #8d3b2b; }
.server-note code { display: block; margin: 4px 0 14px; }

.pay-layout, .methods { display: grid; gap: 14px; }
.rate-line, .due { font-weight: 700; }
.offer {
  margin: 0 0 18px;
  padding: 18px 20px;
  border-radius: 20px;
  background: #123828;
  color: var(--cream);
}
.offer .eyebrow, .offer p { color: #d5e6db; }
.was { margin: 0; color: var(--muted); text-decoration: line-through; }
.method { align-items: center; }
.method label { display: flex; gap: 12px; align-items: flex-start; margin: 0; cursor: pointer; }
.copy {
  border: 1px solid var(--line);
  background: white;
  color: var(--green-dark);
  padding: 6px 12px;
}
.promo-form, .promo-create { display: grid; gap: 8px; margin-bottom: 14px; }
.field-label { margin: 14px 0 0; font-weight: 600; }
.file-picker { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-picker .button { cursor: pointer; }
.file-name { color: var(--muted); word-break: break-all; }
select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  background: white;
}
.due { display: block; margin-top: 4px; }
.method {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
}
.method input { width: auto; margin-top: 6px; }
.details { display: block; white-space: pre-wrap; color: var(--muted); }
textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
}
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: auto; margin: 0; }
.server-note p { margin: 0; color: var(--muted); font-weight: 700; }
.auth .panel { max-width: none; }

label { display: block; margin: 14px 0; font-weight: 600; }

input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  font: inherit;
}

input:focus {
  outline: 2px solid rgba(18, 122, 77, 0.35);
  border-color: var(--green);
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 6vw 28px;
  color: var(--muted);
}

.foot-links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.legal p { margin: 0 0 14px; }
.contact-panel { max-width: 46rem; }
.contact-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.contact-box { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: #f7fbf8; }
.contact-box h2 { margin: 0 0 12px; font-size: 1.05rem; }
.form-error { color: #9a3412; margin: 0 0 12px; }
.account-note {
  white-space: pre-wrap;
  margin: 12px 0 0;
  color: var(--muted);
  font: inherit;
}

nav button {
  background: transparent;
  color: var(--ink);
  padding: 0;
  font-weight: 600;
}

.flash {
  background: #fff4df;
  border: 1px solid #efd3a4;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 18px;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: 10px 8px; border-bottom: 1px solid var(--line); }
code { word-break: break-all; }

@media (max-width: 860px) {
  .top { align-items: flex-start; flex-direction: column; }
  .hero-band, .feature-row, .steps, .dash, .auth, .stats, .contact-boxes { grid-template-columns: 1fr; }
  .hero-band { padding: 28px 22px; }
  .hero-band h1 { max-width: none; }
  main { padding: 20px 5vw 40px; }
}
