/* FORSA Platform Shared UI — Checkout / Dashboard / Admin */
:root {
  --bg: #0A0F1C;
  --bg-2: #111827;
  --card: rgba(17, 24, 39, 0.8);
  --border: rgba(148, 163, 184, 0.14);
  --text: #F8FAFC;
  --muted: #94A3B8;
  --orange: #F97316;
  --orange-hover: #FB923C;
  --orange-soft: rgba(249, 115, 22, 0.14);
  --blue: #3B82F6;
  --success: #22C55E;
  --danger: #F87171;
  --radius: 16px;
  --font: "Cairo", system-ui, sans-serif;
  --sidebar: 260px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body.app-body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; cursor: pointer; }
button, input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

.container { width: min(100% - 1.25rem, 1100px); margin-inline: auto; }
.co-wrap { width: min(100% - 1rem, 520px); }
.glass {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 1px solid transparent; border-radius: 12px; font-weight: 800;
  padding: .85rem 1.25rem; cursor: pointer; transition: .2s ease;
}
.btn-accent { background: var(--orange); color: #fff; box-shadow: 0 10px 28px rgba(249,115,22,.3); }
.btn-accent:hover { background: var(--orange-hover); transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-block { width: 100%; }
.btn-sm { padding: .5rem .9rem; font-size: .85rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.alert {
  padding: .9rem 1rem; border-radius: 12px; margin-bottom: 1rem; font-weight: 700; font-size: .92rem;
}
.alert-error { background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.35); color: #fecaca; }
.alert-success { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.35); color: #bbf7d0; }
.alert-info { background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.3); color: #bfdbfe; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: .4rem; font-weight: 700; font-size: .92rem; }
.form-control {
  width: 100%; border: 1px solid var(--border); background: rgba(255,255,255,.03);
  color: var(--text); border-radius: 12px; padding: .9rem 1rem; font-size: .95rem;
}
.form-control:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(249,115,22,.18); }

.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .65rem;
  border-radius: 999px; font-size: .78rem; font-weight: 800;
}
.badge-ok { background: rgba(34,197,94,.15); color: var(--success); }
.badge-pending { background: rgba(249,115,22,.15); color: var(--orange); }
.badge-fail { background: rgba(248,113,113,.15); color: var(--danger); }

.progress {
  height: 8px; background: rgba(255,255,255,.06); border-radius: 999px; overflow: hidden;
}
.progress > span { display: block; height: 100%; background: var(--orange); border-radius: 999px; }

/* Checkout — conversion-first, mobile above-the-fold */
.checkout-page { min-height: 100vh; padding: .5rem 0 2.5rem; }
.checkout-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .65rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border);
}
.brand-mini { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; }
.brand-mini .mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--orange); color: #fff; font-weight: 800;
}
.brand-logo-checkout {
  display: block; height: 36px; width: auto; max-width: 120px;
  object-fit: contain; border-radius: 8px;
}
.secure-label { color: var(--muted); font-weight: 700; font-size: .78rem; }

.co-mobile { max-width: 480px; margin: 0 auto; }

/* Order summary — must be readable in first viewport */
.co-summary {
  padding: 1rem 1rem 1.05rem;
  margin-bottom: .75rem;
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(249,115,22,.16), rgba(17,24,39,.9) 55%);
  border: 1px solid rgba(249,115,22,.35);
}
.co-kicker {
  font-size: .72rem; font-weight: 800; letter-spacing: .04em;
  color: var(--orange); text-transform: uppercase; margin-bottom: .25rem;
}
.co-product-name {
  font-size: 1.35rem; font-weight: 900; line-height: 1.25; margin-bottom: .55rem;
}
.co-price-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: .75rem;
  margin-bottom: .75rem; flex-wrap: wrap;
}
.co-price-big {
  font-size: 2rem; font-weight: 900; color: var(--orange); line-height: 1;
}
.co-price-big span { font-size: 1rem; font-weight: 800; }
.co-price-once {
  font-size: .75rem; font-weight: 800; color: var(--muted);
  background: rgba(255,255,255,.06); padding: .3rem .6rem; border-radius: 999px;
}
.co-gets { display: grid; gap: .4rem; margin-bottom: .7rem; }
.co-gets li {
  display: flex; align-items: flex-start; gap: .5rem;
  font-size: .88rem; font-weight: 600; color: #e2e8f0; line-height: 1.45;
}
.co-gets i {
  color: var(--success); margin-top: .2rem; flex-shrink: 0; font-size: .85rem;
}
.co-next-hint {
  font-size: .82rem; color: var(--muted); line-height: 1.5; margin-bottom: .65rem;
}
.co-jump {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; min-height: 46px; border-radius: 12px;
  background: var(--orange); color: #fff; font-weight: 800; font-size: .98rem;
  box-shadow: 0 8px 22px rgba(249,115,22,.28);
}
.co-jump:active { transform: scale(.98); }

.co-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 1rem .95rem; margin-bottom: .75rem;
  scroll-margin-top: .75rem;
}
.co-card-pay {
  border-color: rgba(249,115,22,.4);
  box-shadow: 0 0 0 1px rgba(249,115,22,.08);
}
.co-card-lead {
  color: var(--muted); font-size: .82rem; margin: -.35rem 0 .85rem; line-height: 1.45;
}
.co-step {
  display: flex; align-items: center; gap: .55rem;
  font-size: 1.02rem; font-weight: 800; margin-bottom: .85rem;
}
.co-step span {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--orange); color: #fff; font-size: .8rem; flex-shrink: 0;
}
.co-form .form-group { margin-bottom: .75rem; }
.co-form .form-group.co-last { margin-bottom: 0; }
.co-form .form-group label { font-size: .88rem; margin-bottom: .35rem; }
.co-form .form-control {
  padding: .9rem .95rem; font-size: 1.02rem; border-radius: 12px;
  min-height: 50px;
}

.co-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .85rem;
}
.co-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem;
  padding: .8rem .45rem; border-radius: 14px; border: 1px solid var(--border);
  background: rgba(255,255,255,.03); font-weight: 800; cursor: pointer; text-align: center;
  min-height: 68px; user-select: none; font-size: .92rem;
}
.co-tab input { position: absolute; opacity: 0; pointer-events: none; }
.co-tab i { color: var(--muted); font-size: 1.1rem; }
.co-tab.active {
  border-color: var(--orange); background: var(--orange-soft); color: var(--text);
}
.co-tab.active i { color: var(--orange); }

.co-pay-box {
  padding: .9rem; border-radius: 14px;
  border: 1px solid rgba(249,115,22,.35); background: rgba(249,115,22,.08);
}
.co-pay-box[hidden] { display: none !important; }
.co-pay-title { font-weight: 800; margin-bottom: .65rem; font-size: .92rem; text-align: center; }
.co-wallet-block { display: grid; gap: .55rem; }
.co-wallet-num {
  display: block; text-align: center; font-size: 1.65rem; font-weight: 900;
  letter-spacing: .08em; direction: ltr; unicode-bidi: isolate;
  padding: .5rem; background: rgba(0,0,0,.28); border-radius: 12px;
}
.co-copy-btn {
  display: flex; align-items: center; justify-content: center; gap: .45rem;
  width: 100%; min-height: 50px; border: 0; border-radius: 12px;
  background: var(--orange); color: #fff; font-weight: 800; font-size: 1rem;
  font-family: inherit; cursor: pointer;
}
.co-copy-btn.copied { background: #16a34a; }
.co-instapay-btn {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  width: 100%; min-height: 50px; padding: .85rem; border-radius: 12px;
  background: linear-gradient(135deg, #5B2CFF, #7C3AED); color: #fff;
  font-weight: 800; font-size: 1.02rem; text-decoration: none;
}
.co-hint { margin-top: .55rem; color: var(--muted); font-size: .78rem; text-align: center; line-height: 1.4; }

.co-file {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
  min-height: 88px; padding: .9rem; border-radius: 14px; cursor: pointer;
  border: 1.5px dashed rgba(148,163,184,.35); background: rgba(255,255,255,.02);
  color: var(--muted); font-weight: 700; text-align: center; font-size: .9rem;
}
.co-file i { font-size: 1.3rem; color: var(--orange); }
.co-file.has-file {
  border-color: rgba(34,197,94,.5); background: rgba(34,197,94,.08); color: #bbf7d0;
}
.co-file-input {
  position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden;
}

.co-submit-wrap {
  position: sticky; bottom: 0; padding: .55rem 0 calc(.65rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent, var(--bg) 22%);
  margin-top: .15rem; z-index: 5;
}
.co-submit-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .45rem; padding: 0 .15rem;
  font-size: .88rem; color: var(--muted); font-weight: 700;
}
.co-submit-meta strong { color: var(--orange); font-size: 1.15rem; font-weight: 900; }
.co-submit { min-height: 54px; font-size: 1.05rem; border-radius: 14px; }
.co-foot { text-align: center; color: var(--muted); font-size: .78rem; margin-top: .5rem; line-height: 1.4; }

@media (min-width: 768px) {
  .checkout-page { padding: 1.25rem 0 3rem; }
  .brand-logo-checkout { height: 48px; max-width: 150px; }
  .co-mobile { max-width: 520px; }
  .co-product-name { font-size: 1.55rem; }
  .co-price-big { font-size: 2.25rem; }
  .co-submit-wrap { position: static; background: none; padding: .5rem 0 0; }
  .co-jump { width: auto; padding: 0 1.5rem; }
}

/* legacy price-bar (unused but safe) */
.co-price-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem 1rem; margin-bottom: .85rem; border-radius: 14px;
  background: rgba(249,115,22,.1); border: 1px solid rgba(249,115,22,.3);
}
.co-price-label { display: block; color: var(--muted); font-size: .8rem; font-weight: 700; }
.co-price-value { display: block; font-size: 1.45rem; font-weight: 900; color: var(--orange); line-height: 1.2; }
.co-price-note {
  font-size: .75rem; font-weight: 800; color: var(--orange);
  background: rgba(249,115,22,.15); padding: .35rem .65rem; border-radius: 999px; white-space: nowrap;
}

.success-wrap, .state-wrap {
  max-width: 560px; margin: 2rem auto; text-align: center; padding: 1.5rem 1.15rem;
}
.success-wrap img, .state-wrap img { width: 140px; margin: 0 auto 1rem; }
.order-meta { text-align: right; margin: 1.25rem 0; padding: 1rem; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--border); }
.order-meta div { display: flex; justify-content: space-between; margin-bottom: .45rem; color: var(--muted); }
.order-meta strong { color: var(--text); }

/* App shell */
.app-shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  background: #070B14; border-left: 1px solid var(--border); padding: 1.25rem 1rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand-mini { margin-bottom: 1.5rem; padding: 0 .5rem; }
.side-nav a {
  display: flex; align-items: center; gap: .7rem; padding: .75rem .85rem; border-radius: 12px;
  color: var(--muted); font-weight: 700; margin-bottom: .25rem;
}
.side-nav a:hover, .side-nav a.active { background: var(--orange-soft); color: var(--text); }
.side-nav a i { width: 18px; text-align: center; color: var(--orange); }
.side-footer { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }

.app-main { padding: 1.25rem 1.5rem 2.5rem; }
.app-top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.5rem;
}
.app-top h1 { font-size: 1.45rem; }
.app-top p { color: var(--muted); font-size: .92rem; }
.top-actions { display: flex; align-items: center; gap: .75rem; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--orange-soft);
  color: var(--orange); display: grid; place-items: center; font-weight: 800;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: transparent; color: var(--text); display: grid; place-items: center; cursor: pointer;
}

.hero-dash {
  display: grid; grid-template-columns: 1.3fr .7fr; gap: 1rem; align-items: center;
  padding: 1.5rem; margin-bottom: 1.25rem;
  background: linear-gradient(135deg, rgba(249,115,22,.16), rgba(17,24,39,.9));
  border: 1px solid rgba(249,115,22,.28); border-radius: var(--radius);
}
.hero-dash h2 { font-size: 1.6rem; margin-bottom: .5rem; }
.hero-dash p { color: var(--muted); margin-bottom: 1rem; }
.hero-dash img { width: 160px; margin-inline: auto; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.stat-card, .panel, .tool-card, .course-card, .order-card, .resource-card {
  padding: 1.15rem; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border);
}
.stat-card span { color: var(--muted); font-size: .85rem; font-weight: 700; }
.stat-card strong { display: block; font-size: 1.5rem; margin-top: .35rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.tools-grid, .courses-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.tool-card h3, .course-card h3 { font-size: 1.05rem; margin: .6rem 0 .35rem; }
.tool-card p, .course-card p, .resource-card p { color: var(--muted); font-size: .9rem; }
.tool-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--orange-soft); color: var(--orange);
}
.cat-chip {
  display: inline-block; margin-top: .5rem; font-size: .75rem; font-weight: 800;
  color: var(--orange); text-transform: uppercase; letter-spacing: .04em;
}

.empty {
  text-align: center; padding: 2.5rem 1rem; border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty img { width: 140px; margin: 0 auto 1rem; }

.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: .8rem .6rem; border-bottom: 1px solid var(--border); text-align: right; }
.table th { color: var(--muted); font-weight: 700; }

.funnel { display: grid; gap: .65rem; }
.funnel-row {
  display: grid; grid-template-columns: 140px 1fr 60px; gap: .75rem; align-items: center;
}
.funnel-bar { height: 12px; background: rgba(255,255,255,.06); border-radius: 999px; overflow: hidden; }
.funnel-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--blue)); }

.mobile-nav {
  display: none; position: fixed; bottom: 0; inset-inline: 0; z-index: 50;
  background: rgba(7,11,20,.96); border-top: 1px solid var(--border);
  padding: .55rem .75rem; justify-content: space-around;
}
.mobile-nav a { color: var(--muted); font-size: .72rem; font-weight: 700; text-align: center; }
.mobile-nav a i { display: block; font-size: 1.05rem; margin-bottom: .15rem; color: var(--orange); }
.mobile-nav a.active { color: var(--text); }

.onboard-steps { display: grid; gap: 1rem; max-width: 640px; margin: 0 auto; }
.onboard-option {
  padding: 1rem; border: 1px solid var(--border); border-radius: 12px; cursor: pointer;
  background: rgba(255,255,255,.02);
}
.onboard-option:has(input:checked) { border-color: var(--orange); background: var(--orange-soft); }

.menu-toggle { display: none; }

@media (max-width: 1024px) {
  .checkout-grid, .hero-dash, .grid-2, .stats-grid, .tools-grid, .courses-grid, .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .sidebar.open { display: block; position: fixed; inset: 0 auto 0 0; width: min(84vw, 280px); z-index: 60; }
  .mobile-nav { display: flex; }
  .app-main { padding-bottom: 5rem; }
  .menu-toggle { display: inline-grid; }
  .checkout-grid, .hero-dash, .grid-2, .tools-grid, .courses-grid, .grid-3, .stats-grid, .trust-row {
    grid-template-columns: 1fr;
  }
  .secure-label { display: none; }
  .checkout-top { margin-bottom: .75rem; }
  .funnel-row { grid-template-columns: 1fr; }
}
