/* Colors from the «بقاء» logo: royal blue disc, gold ornament, dark green detailing, small red jewels.
   Change the brand here; every rule below uses these tokens. */
:root {
  --blue-950: #06125F;   /* deepest blue: footer, inputs, text on gold */
  --blue-900: #081898;   /* gradient end, top bar */
  --blue-800: #0828A8;   /* royal blue: primary background */
  --blue-500: #3A55D0;   /* lighter royal for chips and level tags */
  --blue-200: #AFC0F5;   /* light blue: level 1 */
  --gold-500: #F2C21B;   /* buttons, accents */
  --gold-400: #F8D838;   /* hover, headline accents */
  --gold-300: #F8E858;   /* links and numbers on blue */
  --green-900: #0B3B1E;  /* borders and secondary details */
  --red-600: #D6232A;    /* small alerts only */
  --on-gold: #06125F;    /* text on gold */
  --white: #ffffff;
  --text-soft: rgba(255, 255, 255, 0.82);
  --text-muted: rgba(255, 255, 255, 0.64);
  --line: rgba(255, 255, 255, 0.16);
  --line-gold: rgba(242, 194, 27, 0.55);
  --card: rgba(255, 255, 255, 0.06);
  --card-strong: rgba(255, 255, 255, 0.11);
  --field: rgba(6, 18, 95, 0.6);
  --gold-soft: rgba(242, 194, 27, 0.16);
  --warn: #F8D838;
  --danger: #FF9A9E;
  --radius: 14px;
  /* Maturity scale: light blue to gold */
  --lv1: #AFC0F5;
  --lv2: #C9CFE8;
  --lv3: #E2D9A6;
  --lv4: #F2D86A;
  --lv5: #F2C21B;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: 'Cairo', system-ui, sans-serif;
  color: var(--white);
  background: linear-gradient(180deg, var(--blue-800) 0%, var(--blue-900) 55%, var(--blue-950) 100%) fixed;
  background-color: var(--blue-900);
  min-height: 100vh;
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
}

a { color: var(--gold-300); }
h1, h2, h3 { line-height: 1.35; margin: 0 0 .5rem; }
h1 { font-size: 1.9rem; font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: .3rem 0 .8rem; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 28px; padding-bottom: 48px; }
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.note { color: var(--text-soft); font-size: .92rem; }
.center { text-align: center; }

/* Top bar */
.topbar { background: var(--blue-950); border-bottom: 3px solid var(--gold-500); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; }
.brand { color: var(--white); text-decoration: none; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.brand-mark { color: var(--gold-500); font-size: 1.3rem; }
.brand-logo { width: 42px; height: 42px; object-fit: contain; }
.nav { display: flex; gap: 6px; align-items: center; }
.nav a { color: var(--white); text-decoration: none; padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: .95rem; }
.nav a.active, .nav a:hover { background: var(--card-strong); box-shadow: inset 0 -2px 0 var(--gold-500); }
.nav a.lang { border: 1px solid var(--line-gold); }

/* Buttons: primary = gold with dark blue text, secondary = gold outline */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; font-family: inherit; font-weight: 700; text-decoration: none; border-radius: 10px; padding: 10px 20px; font-size: 1rem; color: var(--white); transition: transform .08s ease, background .2s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gold-500); color: var(--on-gold); box-shadow: 0 6px 18px rgba(242, 194, 27, 0.28); }
.btn-primary:hover { background: var(--gold-400); }
.btn-ghost { background: transparent; border: 1.5px solid var(--gold-500); color: var(--white); }
.btn-ghost:hover { background: var(--gold-soft); }
.btn-link { background: none; color: var(--danger); padding: 4px 8px; font-weight: 600; }
.btn-lg { padding: 14px 28px; font-size: 1.08rem; }
.btn-sm { padding: 7px 14px; font-size: .9rem; }
.btn-block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }

/* Cards & panels */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.panel.narrow { max-width: 560px; margin-inline: auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card p { color: var(--text-soft); margin-bottom: 0; }
.card-link { color: var(--white); text-decoration: none; text-align: center; transition: background .2s, transform .2s, border-color .2s; }
.card-link:hover { background: var(--card-strong); border-color: var(--line-gold); transform: translateY(-2px); }
.card-icon { font-size: 2rem; margin-bottom: 6px; }
.step-num { width: 34px; height: 34px; border-radius: 50%; background: var(--gold-500); color: var(--on-gold); display: grid; place-items: center; font-weight: 800; margin-bottom: 8px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid > * { min-width: 0; }
.section { margin-top: 40px; }
.section h2 { margin-bottom: 16px; }

.hero { text-align: center; padding: 36px 0 12px; }
.hero h1 { font-size: 2.3rem; }
.hero h1::after { content: ''; display: block; width: 90px; height: 4px; margin: 12px auto 0; border-radius: 4px; background: var(--gold-500); }
.hero .lead { font-size: 1.15rem; color: var(--text-soft); max-width: 760px; margin: 8px auto; }
.hero .actions { justify-content: center; }

.chip { display: inline-block; background: var(--card-strong); border: 1px solid var(--line-gold); border-radius: 999px; padding: 2px 12px; font-size: .85rem; margin-bottom: 8px; margin-inline-end: 6px; }

/* Levels: light blue (1) to gold (5), dark text on every step */
.levels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.level-step { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.level-step span { color: var(--text-soft); font-size: .86rem; }
.level-num { width: 36px; height: 36px; margin: 0 auto 4px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: var(--on-gold); background: var(--lv3); }
.level-1 .level-num { background: var(--lv1); }
.level-2 .level-num { background: var(--lv2); }
.level-3 .level-num { background: var(--lv3); }
.level-4 .level-num { background: var(--lv4); }
.level-5 .level-num { background: var(--lv5); }
.levels-compact { margin-bottom: 20px; }
.levels-compact .level-step { padding: 10px; opacity: .55; }
.levels-compact .level-step.passed { opacity: .85; }
.levels-compact .level-step.current { opacity: 1; border-color: var(--gold-500); background: var(--card-strong); box-shadow: 0 0 0 2px rgba(242, 194, 27, 0.35); }

/* Forms */
.form { display: flex; flex-direction: column; gap: 6px; position: relative; }
.form label { font-weight: 600; margin-top: 10px; }
.form small { color: var(--text-muted); }
.form .btn { margin-top: 18px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=tel], input[type=number], select, textarea {
  font-family: inherit; font-size: 1rem; color: var(--white);
  background: var(--field); border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 10px; padding: 11px 14px; width: 100%; max-width: 100%;
}
select option { background: var(--blue-950); color: var(--white); }
optgroup { background: var(--blue-950); color: var(--gold-300); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold-500); outline-offset: 1px; }
input[readonly] { opacity: .75; }

/* Flash */
.flash { border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; font-weight: 600; }
.flash-error { background: rgba(214, 35, 42, 0.22); border: 1px solid rgba(255, 154, 158, 0.65); }
.flash-success { background: rgba(242, 194, 27, 0.14); border: 1px solid var(--line-gold); }
.flash-warn { background: rgba(248, 216, 56, 0.14); border: 1px solid rgba(248, 216, 56, 0.6); }
.flash a { color: var(--gold-300); font-weight: 800; }

/* Documents page */
.doc-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.doc-head p { color: var(--text-soft); max-width: 640px; }
.progress-box { min-width: 240px; }
.progress-label { font-weight: 700; margin-bottom: 6px; }
.small-link { display: inline-block; margin-top: 8px; font-weight: 700; }
.bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--lv1), var(--gold-500)); border-radius: 999px; }

.axis-block { margin-bottom: 26px; }
.axis-title { padding-inline-start: 12px; border-inline-start: 4px solid var(--gold-500); margin-bottom: 12px; }
.doc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 12px; position: relative; }
.doc-done { border-color: var(--line-gold); background: rgba(242, 194, 27, 0.07); }
.doc .hint { color: var(--text-soft); font-size: .93rem; margin-bottom: 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .8rem; padding: 1px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); border: 1px solid var(--line); }
.tag-critical { background: var(--gold-500); color: var(--on-gold); border-color: var(--gold-500); font-weight: 700; }
.tag-ok { background: var(--gold-soft); border-color: var(--line-gold); }
.tag-level { background: rgba(58, 85, 208, 0.6); }
.tag-muted { color: var(--text-soft); }
.refs { font-size: .8rem; color: var(--text-muted); margin: 8px 0 0; }

.doc-form { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 12px; }
.questions { border: 0; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: .95rem; }
.check input { width: 18px; height: 18px; margin-top: 5px; accent-color: var(--gold-500); flex-shrink: 0; }
.exists-choice { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.exists-choice legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.radio { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: .95rem; }
.radio input { accent-color: var(--gold-500); margin: 0; }
.radio:has(input:checked) { background: var(--gold-500); color: var(--on-gold); border-color: var(--gold-500); font-weight: 700; }
.consent { margin-top: 10px; font-size: .9rem; }
.code { direction: ltr; text-align: left; white-space: pre-wrap; word-break: break-all; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-family: Consolas, monospace; font-size: .88rem; }
.danger-btn { border-color: rgba(214, 35, 42, 0.9) !important; color: #FFC2C4 !important; }
.doc-actions { margin-top: 12px; }
.evaluate-bar { text-align: center; }
.save-bar { position: sticky; bottom: 8px; z-index: 5; background: var(--blue-950); border: 2px solid var(--gold-500); padding-block: 12px; box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.35); }
.save-bar .actions { justify-content: center; margin-top: 0; }
.save-bar .note { margin: 8px 0 0; }
#unsaved { color: var(--gold-300); font-weight: 700; }
.doc-missing { border-color: var(--red-600) !important; box-shadow: 0 0 0 2px rgba(214, 35, 42, 0.5); }

/* Result */
.result-hero { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.result-hero .org { font-size: 1.2rem; font-weight: 700; margin: 0; }
.gauge { min-width: 200px; text-align: center; padding: 18px 26px; border-radius: 18px; background: var(--blue-950); border: 3px solid var(--gold-500); }
.gauge-num { font-size: 3.4rem; font-weight: 800; line-height: 1; color: var(--gold-400); }
.gauge-num small { font-size: 1.2rem; color: var(--text-muted); }
.gauge-name { font-size: 1.4rem; font-weight: 800; color: var(--white); }
.gauge-score { color: var(--text-soft); }
.axes { display: grid; gap: 12px; }
.axis-row { display: grid; grid-template-columns: 260px 1fr 52px; gap: 12px; align-items: center; }
.axis-pct { font-weight: 700; text-align: end; }
.doc-list { margin: 0; padding-inline-start: 20px; }
.doc-list li { margin: 4px 0; }

.offer { background: linear-gradient(135deg, rgba(242, 194, 27, 0.16), rgba(58, 85, 208, 0.3)); border: 1px solid var(--line-gold); border-radius: var(--radius); padding: 26px; margin-bottom: 20px; }
.offer > p { color: var(--text-soft); }
.price-card { background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.price-card.featured { border-color: var(--gold-500); }
.price { font-size: 2rem; font-weight: 800; color: var(--gold-300); }
.price-card p { color: var(--text-soft); margin: 0; }
.price-card .btn { margin-top: 12px; }

/* Login, my assessments, roadmap, admin */
.inline-form { display: inline; margin: 0; }
.nav-btn { background: none; border: 1px solid var(--line-gold); color: var(--white); font-family: inherit; font-weight: 600; font-size: .95rem; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.nav-btn:hover { background: var(--card-strong); }
.code-input { font-size: 1.6rem !important; letter-spacing: 10px; text-align: center; }
.my-card h3 { margin-top: 4px; }
.roadmap-cta { margin: 4px 0 20px; }
.tasks { margin: 0; padding-inline-start: 26px; display: grid; gap: 10px; }
.task { display: list-item; background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.task::marker { color: var(--gold-400); font-weight: 800; }
.task-main { margin-bottom: 8px; }
.task-main .tags { margin-top: 6px; }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-align: center; }
.stat b { display: block; font-size: 1.8rem; color: var(--gold-300); }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
table.data th { background: var(--blue-950); border-bottom: 2px solid var(--gold-500); font-weight: 700; white-space: nowrap; }
table.data tr:hover td { background: rgba(255, 255, 255, 0.04); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; flex: 1 1 200px; }

/* Services & requests */
.svc { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px 18px; display: flex; flex-direction: column; }
.svc-featured { background: linear-gradient(160deg, rgba(242, 194, 27, 0.12), rgba(58, 85, 208, 0.25)); border-color: var(--line-gold); }
.svc-rec { border-color: var(--gold-500); box-shadow: 0 0 0 2px rgba(242, 194, 27, 0.3); }
.svc-badge { position: absolute; top: 14px; inset-inline-end: 14px; }
.svc-icon { font-size: 2rem; line-height: 1; margin-bottom: 10px; }
.svc h3 { font-size: 1.08rem; }
.svc-desc { color: var(--text-soft); font-size: .93rem; }
.svc .check-list { flex: 1; }
.svc-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); flex-wrap: wrap; }
.svc-price { font-size: 1.25rem; font-weight: 800; color: var(--gold-300); }
.check-list { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 4px; font-size: .92rem; }
.check-list li { position: relative; padding-inline-start: 22px; }
.check-list li::before { content: '✓'; position: absolute; inset-inline-start: 0; color: var(--gold-400); font-weight: 800; }
.selected-service { display: flex; gap: 12px; align-items: center; background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.selected-service .svc-icon { margin: 0; }
.price-inline { color: var(--gold-300); font-weight: 700; }
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.done-icon { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%; background: var(--gold-500); color: var(--on-gold); display: grid; place-items: center; font-size: 2rem; font-weight: 800; }
.status-form { display: flex; gap: 6px; align-items: center; }
.status-form select { padding: 6px 8px; font-size: .85rem; width: auto; }
.st { font-size: .8rem; padding: 1px 10px; border-radius: 999px; white-space: nowrap; }
.st-new { background: rgba(248, 216, 56, 0.25); }
.st-contacted { background: rgba(58, 85, 208, 0.6); }
.st-won { background: var(--gold-500); color: var(--on-gold); }
.st-lost { background: rgba(214, 35, 42, 0.3); }
.price-input { width: 120px !important; padding: 7px 10px !important; }

/* Access limits */
.access-box { display: grid; gap: 8px; background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 12px 0 18px; }
.access-types { display: flex; flex-wrap: wrap; gap: 8px 22px; }

.delivery { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.steps-list { margin: 6px 0 14px; padding-inline-start: 22px; display: grid; gap: 4px; }
.steps-list a { color: var(--gold-300); font-weight: 700; }
.mail-form { max-width: 560px; }
.mode-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 14px; margin: 10px 0 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }

/* Footer */
.footer { border-top: 3px solid var(--gold-500); background: var(--blue-950); padding: 18px 0; font-size: .92rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer a { color: var(--white); }

/* Responsive */
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .levels { grid-template-columns: repeat(2, 1fr); }
  .levels-compact { grid-template-columns: repeat(5, 1fr); }
  .levels-compact strong { font-size: .8rem; }
  .doc-head, .result-hero { flex-direction: column; align-items: stretch; }
  .axis-row { grid-template-columns: 1fr 52px; }
  .axis-row .bar { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 520px) {
  h1, .hero h1 { font-size: 1.6rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .brand { font-size: .95rem; line-height: 1.3; }
  .brand-logo { width: 34px; height: 34px; }
  .topbar-inner { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; row-gap: 6px; }
  .nav { width: 100%; flex-wrap: wrap; gap: 4px; }
  .nav a, .nav-btn { padding: 4px 10px; font-size: .85rem; white-space: nowrap; }
  .levels-compact { gap: 4px; }
  .levels-compact .level-step { padding: 6px 2px; min-width: 0; }
  .levels-compact .level-num { width: 26px; height: 26px; font-size: .85rem; }
  .levels-compact strong { font-size: .68rem; overflow-wrap: anywhere; }
  .panel { padding: 18px; }
  .progress-box { min-width: 0; }
  .btn-lg { padding: 12px 18px; }
  .gauge { min-width: 0; }
  .save-bar { padding: 10px; }
  .save-bar .actions { flex-wrap: nowrap; gap: 8px; }
  .save-bar .btn-lg { flex: 1 1 0; padding: 10px 8px; font-size: .92rem; }
  .save-bar .note { font-size: .78rem; line-height: 1.5; }
}
.levels > * { min-width: 0; }

/* Email campaigns (admin) */
.quota-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; background: var(--card); margin: 12px 0; }
.quota-box p { margin: 8px 0 0; }
.settings-details { margin-top: 10px; }
.settings-details summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.camp-counts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 10px 0 8px; }
.camp-counts b { font-size: 1.25rem; }
.mail-preview { border: 1px dashed var(--line); border-radius: 12px; padding: 12px; margin: 10px 0 14px; overflow-x: auto; }
.camp-running { background: rgba(58, 85, 208, 0.65); }
.camp-paused { background: rgba(242, 194, 27, 0.28); }
.camp-done, .camp-rs-sent { background: rgba(11, 59, 30, 0.9); }
.camp-cancelled, .camp-rs-failed { background: rgba(214, 35, 42, 0.4); }
.camp-rs-skipped { background: rgba(255, 255, 255, 0.12); }
.wa-box { border: 1px solid var(--gold-300); border-radius: 12px; padding: 12px 16px 16px; margin: 14px 0; }
.wa-box legend { font-weight: 700; padding: 0 8px; color: var(--gold-300); }
.wa-vars { margin: 6px 0 10px; padding-inline-start: 22px; }
.wa-bubble { background: var(--gold-soft); border: 1px solid var(--line-gold); border-radius: 14px 14px 4px 14px; padding: 12px 14px; max-width: 440px; margin: 8px 0 12px; line-height: 1.7; }
dialog.modal { max-width: min(520px, calc(100vw - 32px)); width: 100%; border: 2px solid var(--gold-300); border-radius: 16px; padding: 22px; background: var(--blue-900); color: var(--white); }
dialog.modal::backdrop { background: rgba(0, 0, 0, 0.6); }
dialog.modal h3 { margin-top: 0; }
