/* AdvDesk — design system v2 (light + dark) */

:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 14px rgba(0,0,0,.10);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.18);
  --transition: 180ms cubic-bezier(.4,0,.2,1);
}

/* ---- DARK THEME ---- */
:root, [data-theme="dark"] {
  --bg:           #0a0c10;
  --bg-elev:      #0f1218;
  --surface:      #161a22;
  --surface-2:    #1d222c;
  --border:       #232936;
  --border-soft:  #1c212b;
  --text:         #e8eaf0;
  --text-muted:   #8a93a6;
  --text-dim:     #5a6275;
  --accent:       #4c8dff;
  --accent-hover: #6aa1ff;
  --accent-soft:  rgba(76,141,255,.12);
  --success:      #4ade80;
  --warning:      #fbbf24;
  --danger:       #f87171;
  --code-bg:      #0d1017;
  --gradient-1:   radial-gradient(1200px 600px at 80% -100px, rgba(76,141,255,.18), transparent 60%);
  --gradient-2:   radial-gradient(800px 400px at -10% 30%, rgba(155,90,255,.10), transparent 60%);
  --hero-art-bg:  linear-gradient(160deg, #0e1118 0%, #161b25 100%);
}

/* ---- LIGHT THEME ---- */
[data-theme="light"] {
  --bg:           #fbfbfd;
  --bg-elev:      #ffffff;
  --surface:      #ffffff;
  --surface-2:    #f4f6fa;
  --border:       #e3e7ee;
  --border-soft:  #ecf0f5;
  --text:         #0e1118;
  --text-muted:   #5e6878;
  --text-dim:     #8b94a4;
  --accent:       #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft:  rgba(37,99,235,.10);
  --success:      #16a34a;
  --warning:      #d97706;
  --danger:       #dc2626;
  --code-bg:      #0e1118;
  --gradient-1:   radial-gradient(1200px 600px at 80% -100px, rgba(37,99,235,.10), transparent 60%);
  --gradient-2:   radial-gradient(800px 400px at -10% 30%, rgba(155,90,255,.06), transparent 60%);
  --hero-art-bg:  linear-gradient(160deg, #f4f6fa 0%, #e9eef7 100%);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--transition), color var(--transition);
}

body {
  background:
    var(--gradient-1),
    var(--gradient-2),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.02em; margin: 0 0 .5em; line-height: 1.15; }
h1 { font-size: clamp(2rem, 4vw + 1rem, 3.4rem); }
h2 { font-size: clamp(1.6rem, 2vw + 1rem, 2.2rem); margin-bottom: 1em; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }
.muted { color: var(--text-muted); }
.muted-ar { color: var(--text-muted); font-size: .9rem; }
.small { font-size: .85rem; }
.center { text-align: center; }

/* ---- NAV ---- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 700; font-size: 1.05rem;
}
.brand img { display:block; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  color: var(--text-muted); padding: 8px 14px; border-radius: 8px;
  font-weight: 500; font-size: .92rem;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }

/* theme toggle */
.theme-toggle {
  margin-left: 6px;
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-muted); border-radius: 10px; cursor: pointer;
  transition: all var(--transition);
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }
.t-icon { display: none; }
[data-theme="dark"] .t-sun { display: block; }
[data-theme="light"] .t-moon { display: block; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  font-weight: 600; font-size: .92rem; line-height: 1;
  border: 1px solid transparent; border-radius: 10px;
  cursor: pointer; transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn-primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 35%, transparent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; transform: translateY(-1px); }
.btn-secondary {
  background: var(--surface-2); color: var(--text); border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface); border-color: var(--accent); color: var(--text); }
.btn-ghost {
  background: transparent; color: var(--text-muted); border-color: transparent;
}
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-lg { padding: 13px 24px; font-size: 1rem; border-radius: 12px; }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---- HERO ---- */
.hero {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 56px; align-items: center;
  max-width: 1200px; margin: 0 auto;
  padding: 80px 28px 80px;
}
.hero-inner h1 { letter-spacing: -.03em; }
.hero-ar { color: var(--text-muted); font-size: 1.05rem; margin-top: -10px; margin-bottom: 22px; }
.lead { font-size: 1.12rem; color: var(--text-muted); max-width: 540px; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.cta-sub { color: var(--text-dim); margin-top: 14px; font-size: .9rem; }

.hero-art {
  border-radius: var(--radius-lg);
  background: var(--hero-art-bg);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.terminal {
  background: var(--code-bg);
  border-radius: 10px;
  border: 1px solid #222a3a;
  overflow: hidden;
  font-family: var(--font-mono); font-size: .82rem;
}
.t-bar {
  display: flex; gap: 6px; padding: 10px 14px;
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid #222a3a;
}
.t-bar span {
  width: 11px; height: 11px; border-radius: 50%;
  background: #ff5f56;
}
.t-bar span:nth-child(2) { background: #ffbd2e; }
.t-bar span:nth-child(3) { background: #27c93f; }
.t-body {
  margin: 0; padding: 18px;
  color: #b6c2d4; line-height: 1.55;
  white-space: pre; overflow-x: auto;
}
.t-body b { color: var(--accent); font-weight: 600; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 60px 22px 40px; gap: 36px; }
}

/* ---- FEATURES ---- */
.features {
  max-width: 1200px; margin: 0 auto; padding: 60px 28px;
  text-align: center;
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 28px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  text-align: left;
  transition: all var(--transition);
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.card .icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 1.4rem; margin-bottom: 14px;
}
.card h3 { color: var(--text); margin-bottom: 6px; }
.card p { color: var(--text-muted); font-size: .92rem; margin: 0; }

/* ---- PRICING ---- */
.pricing {
  max-width: 1280px; margin: 0 auto; padding: 60px 28px 40px;
  text-align: center;
}
.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px; margin-top: 12px;
  align-items: stretch;
}
.plans-grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1180px) { .plans-grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .plans-grid-5 { grid-template-columns: 1fr; } }

.plan {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  text-align: left;
  position: relative;
  display: flex; flex-direction: column;
  transition: all var(--transition);
}
.plan:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.plan-featured {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft), var(--surface) 35%);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-md);
}
.plan-current { border-color: var(--success); }
.badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff;
  padding: 4px 12px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase;
}
.badge-current { background: var(--success); }
.plan h3 { font-size: 1.3rem; }
.plan-tag { color: var(--text-muted); font-size: .85rem; margin: -4px 0 14px; }
.price {
  font-size: 2rem; font-weight: 700; color: var(--text); margin-top: 4px;
  letter-spacing: -.02em;
}
.price .pmo { font-size: .85rem; font-weight: 500; color: var(--text-muted); }
.price-egp { color: var(--text-dim); font-size: .82rem; margin-bottom: 14px; min-height: 1em; }
.plan ul {
  list-style: none; padding: 0; margin: 8px 0 22px;
  flex: 1;
}
.plan ul li {
  padding: 6px 0 6px 22px;
  position: relative;
  color: var(--text-muted); font-size: .9rem;
  border-bottom: 1px solid var(--border-soft);
}
.plan ul li:last-child { border-bottom: none; }
.plan ul li::before {
  content: "✓";
  position: absolute; left: 0; top: 6px;
  color: var(--success); font-weight: 700;
}

/* ---- CTA BOTTOM ---- */
.cta-bottom {
  text-align: center; padding: 70px 28px 90px;
  max-width: 760px; margin: 0 auto;
}
.cta-bottom h2 { letter-spacing: -.02em; }

/* ---- DASHBOARD / FORMS ---- */
.dash, .form-card {
  max-width: 1200px; margin: 40px auto; padding: 0 28px;
}
.form-card {
  max-width: 440px;
}
.form-card .card-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
}
.form-card h1 { font-size: 1.5rem; margin-bottom: 6px; }
.form-card p.muted { margin-bottom: 22px; }
label { display: block; font-size: .82rem; color: var(--text-muted); margin: 12px 0 6px; font-weight: 500; }
input[type="email"], input[type="password"], input[type="text"] {
  width: 100%; padding: 11px 14px;
  background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  font-size: .95rem; font-family: inherit;
  transition: border var(--transition), box-shadow var(--transition);
}
input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.error {
  color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent);
  padding: 10px 14px; border-radius: 8px; font-size: .9rem; margin: 12px 0;
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
}

.dash-head { margin-bottom: 28px; }
.dash-head h1 { margin-bottom: 4px; }
.creds {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
  margin: 18px 0;
}
.cred-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border-soft);
}
.cred-row:last-child { border-bottom: none; }
.cred-label { color: var(--text-muted); font-size: .85rem; }
.cred-value {
  font-family: var(--font-mono); font-size: 1.05rem; color: var(--text);
  letter-spacing: .04em; user-select: all;
}

/* ---- FOOTER ---- */
.footer {
  margin-top: 60px;
  padding: 40px 28px 24px;
  background: var(--surface);
  border-top: 1px solid var(--border-soft);
}
.footer-row {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px;
}
@media (max-width: 760px) { .footer-row { grid-template-columns: 1fr 1fr; } }
.footer-col h4 { font-size: .85rem; color: var(--text); margin-bottom: 12px; text-transform: uppercase; letter-spacing: .08em; }
.footer-col a, .footer-col span { display: block; padding: 4px 0; color: var(--text-muted); font-size: .9rem; }
.footer-col a:hover { color: var(--accent); }
.footer-brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text); font-weight: 700; margin-bottom: 8px;
}
.footer-bottom {
  max-width: 1200px; margin: 28px auto 0; padding-top: 18px;
  border-top: 1px solid var(--border-soft);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

/* ---------- language toggle (added 2026-04-30) ---------- */
.lang-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 10px; border-radius: 8px;
  font-size: .85rem; font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.lang-toggle:hover { background: var(--surface-2); color: var(--text); }
.lang-toggle .lang-active { color: var(--accent); font-weight: 600; }
.lang-toggle .lang-sep { color: var(--text-dim); }
.muted-link { color: var(--text-muted); text-decoration: underline; text-underline-offset: 3px; }
.muted-link:hover { color: var(--accent); }

/* RTL polish: keep nav layout pleasant in Arabic */
html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] .nav-links { flex-direction: row-reverse; }
