/* ==========================================================================
   Darb (درب) - Modern SaaS Design System Tokens & Global Base
   ========================================================================== */

:root {
  --bg: #FFFFFF;
  --bg-soft: #F8F9FA;
  --app-bg: #F3F4F8;
  --surface: #FFFFFF;
  --surface-hover: #F8F9FC;
  --ink: #14122B;
  --text: #454360;
  --muted: #8582A0;
  --line: #E6E4EF;
  --line-soft: #F0EFF6;

  /* Primary Brand (Darb SaaS Indigo) */
  --primary: #2B2A6E;
  --primary-600: #1F1E56;
  --primary-50: #ECEBF7;
  --primary-rgb: 43, 42, 110;

  /* Accent Butter (Highlights & Badges) */
  --butter: #F5C84C;
  --butter-hover: #E8B936;
  --butter-light: #FEF8E3;
  --butter-rgb: 245, 200, 76;

  /* States */
  --ok: #2F8F5B;
  --ok-light: #EBF7F0;
  --warn: #B7791F;
  --warn-light: #FEF7EA;
  --error: #C9423A;
  --error-light: #FCEEED;
  --info: #3B6FD8;
  --info-light: #EDF3FC;

  /* Dynamic Tenant Brand (Overridden per teacher) */
  --brand: var(--primary);
  --brand-light: var(--primary-50);
  --brand-hover: var(--primary-600);

  /* Typography */
  --font-heading: 'Alexandria', system-ui, -apple-system, sans-serif;
  --font-body: 'Noto Sans Arabic', system-ui, -apple-system, sans-serif;

  /* Layout & Spacing */
  --container-max: 1240px;
  --header-height: 76px;
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-btn: 12px;
  --radius-input: 12px;
  --radius-card: 16px;
  --radius-modal: 20px;
  --radius-full: 9999px;

  /* Elevation (Soft shadows) */
  --shadow-sm: 0 2px 8px rgba(20, 18, 43, 0.04);
  --shadow-md: 0 8px 24px rgba(20, 18, 43, 0.06);
  --shadow-lg: 0 16px 40px rgba(20, 18, 43, 0.09);
  --shadow-butter: 0 8px 20px rgba(245, 200, 76, 0.3);

  /* Transitions */
  --tr-fast: 0.15s ease;
  --tr-base: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--text);
  overflow-x: hidden !important;
  max-width: 100vw !important;
  position: relative;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

p {
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--tr-fast);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.section {
  padding-top: 64px;
  padding-bottom: 64px;
}

.section-soft {
  background-color: var(--bg-soft);
}

.section-title-wrap {
  text-align: center;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 48px;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-50);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.875rem;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  border: 1px solid var(--line);
}

.section-title {
  font-size: 2.25rem;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: var(--radius-btn);
  transition: all var(--tr-base);
  text-align: center;
  white-space: nowrap;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
  border-radius: 10px;
}

.btn-lg {
  padding: 15px 32px;
  font-size: 1.05rem;
  border-radius: 14px;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--primary-600);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(43, 42, 110, 0.25);
}

.btn-butter {
  background: var(--butter);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.btn-butter:hover {
  background: var(--butter-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-butter);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--line);
}
.btn-outline:hover {
  background: var(--primary-50);
  border-color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
}
.btn-ghost:hover {
  background: var(--bg-soft);
  color: var(--ink);
}

/* Header & Navigation */
.header-wrap {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
}

.header-brand .brand-badge {
  font-size: 0.75rem;
  background: var(--butter);
  color: var(--ink);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: all var(--tr-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--primary-50);
}

.nav-item-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--tr-base);
  z-index: 1100;
}

.nav-item-dropdown:hover .dropdown-menu,
.nav-item-dropdown:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: var(--text);
  transition: background var(--tr-fast);
}

.dropdown-item:hover {
  background: var(--primary-50);
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--ink);
  align-items: center;
  justify-content: center;
}

/* Mobile Drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 43, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1200;
  opacity: 0;
  visibility: hidden;
  transition: all var(--tr-base);
}

.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  width: 320px;
  max-width: 85vw;
  background: #FFFFFF;
  z-index: 1201;
  padding: 24px;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform var(--tr-base), visibility var(--tr-base);
  box-shadow: -8px 0 32px rgba(20, 18, 43, 0.15);
}

.mobile-drawer.open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

/* Marketing Hero (Section 5.3) */
.hero-wrap {
  padding-top: 48px;
  padding-bottom: 64px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-50);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 20px;
  border: 1px solid var(--line);
}

.hero-title {
  font-size: 2.85rem;
  line-height: 1.22;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.hero-title .underline-doodle {
  position: relative;
  display: inline-block;
  color: var(--primary);
}

.hero-title .underline-doodle::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  height: 8px;
  background: var(--butter);
  border-radius: 4px;
  z-index: -1;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.hero-checks {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: var(--muted);
}

.hero-check-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-check-item i {
  color: var(--ok);
  width: 16px;
  height: 16px;
}

/* Composed Product Mock (Desktop Dashboard + Overlapping Phone Watermark) */
.hero-visual-composed {
  position: relative;
  width: 100%;
}

.mock-window-desktop {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  width: 100%;
}

.mock-window-header {
  height: 38px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 8px;
}

.mock-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #DDDCE8;
}

.mock-desktop-body {
  padding: 18px;
  background: var(--app-bg);
}

.mock-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.mock-stat-card {
  background: #FFFFFF;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.mock-stat-card h4 {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.mock-stat-card span {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}

.mock-risk-card {
  background: #FFFFFF;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.mock-risk-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.mock-risk-header h5 {
  font-size: 0.85rem;
  color: var(--error);
  display: flex;
  align-items: center;
  gap: 6px;
}

.mock-risk-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 0.8rem;
}

.mock-phone-overlap {
  position: absolute;
  bottom: -24px;
  left: -20px;
  width: 240px;
  background: #14122B;
  border: 3px solid #36344E;
  border-radius: 24px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  color: #FFFFFF;
  padding: 12px;
}

.mock-phone-screen {
  background: #1E1C38;
  border-radius: 16px;
  padding: 12px;
  position: relative;
  overflow: hidden;
  height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.moving-watermark-demo {
  position: absolute;
  top: 35%;
  right: 20%;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 700;
  pointer-events: none;
  background: rgba(0,0,0,0.25);
  padding: 2px 6px;
  border-radius: 4px;
  animation: watermarkDrift 6s infinite alternate ease-in-out;
}

@keyframes watermarkDrift {
  0% { transform: translate(0, 0); }
  50% { transform: translate(-25px, 20px); }
  100% { transform: translate(20px, -15px); }
}

/* Feature Rows (5 alternating rows) */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  margin-bottom: 80px;
}

.feature-row:last-child {
  margin-bottom: 0;
}

.feature-row.reverse {
  direction: ltr;
}

.feature-row.reverse > * {
  direction: rtl;
}

.feature-mock-card {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.feature-bullet-list {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feature-bullet {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.feature-bullet-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary-50);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Footer */
.footer {
  background: var(--ink);
  color: #C6C4DA;
  padding-top: 64px;
  padding-bottom: 32px;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 14px;
}

.footer-desc {
  font-size: 0.95rem;
  color: #9D9AB8;
  line-height: 1.7;
  max-width: 340px;
  margin-bottom: 20px;
}

.footer-col h4 {
  color: #FFFFFF;
  font-size: 1rem;
  margin-bottom: 18px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.92rem;
}

.footer-links a:hover {
  color: var(--butter);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #8380A0;
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 1400;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #FFFFFF;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 12px 18px;
  border-radius: var(--radius-btn);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  opacity: 0;
  transform: translateY(10px);
  transition: all var(--tr-base);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .feature-row, .feature-row.reverse {
    grid-template-columns: 1fr;
    gap: 32px;
    direction: rtl;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .header-nav {
    display: none;
  }
  .mobile-menu-btn {
    display: flex;
  }
  .hero-title {
    font-size: 2.1rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
