/* ============================================================
   Mutasa3 — Design System (base.css)
   Philosophy: Compassionate Professionalism
   Style: Modern Minimalist with Tonal Layering
   Direction: RTL-first
   ============================================================ */

/* — Google Fonts import — */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&display=swap');

/* ============================================================
   CSS Custom Properties
   ============================================================ */
:root {
  /* —— Surface / Neutral —— */
  --surface:                  #f9faf5;
  --surface-dim:              #d9dad6;
  --surface-bright:           #f9faf5;
  --surface-container-lowest: #ffffff;
  --surface-container-low:    #f3f4ef;
  --surface-container:        #edeee9;
  --surface-container-high:   #e7e9e4;
  --surface-container-highest:#e2e3de;
  --surface-warm:             #FAF7F2;
  --surface-variant:          #e2e3de;
  --on-surface:               #1a1c19;
  --on-surface-variant:       #4a454f;
  --inverse-surface:          #2e312e;
  --inverse-on-surface:       #f0f1ec;

  /* —— Outline —— */
  --outline:                  #7c7480;
  --outline-variant:          #cdc3d0;

  /* —— Primary (Brand Purple) —— */
  --primary:                  #644587;
  --on-primary:               #ffffff;
  --primary-container:        #7d5da1;
  --on-primary-container:     #f7e8ff;
  --inverse-primary:          #dbb8ff;
  --surface-tint:             #6f5093;
  --primary-fixed:            #efdbff;
  --primary-fixed-dim:        #dbb8ff;
  --on-primary-fixed:         #29074b;
  --on-primary-fixed-variant: #573879;

  /* —— Secondary (Sage Teal) —— */
  --secondary:                #426657;
  --on-secondary:             #ffffff;
  --secondary-container:      #c1e8d6;
  --on-secondary-container:   #466a5b;
  --secondary-fixed:          #c4ebd9;
  --secondary-fixed-dim:      #a8cfbd;
  --on-secondary-fixed:       #002116;
  --on-secondary-fixed-variant:#2a4d40;

  /* —— Tertiary (Brand Pink) —— */
  --tertiary:                 #684b59;
  --on-tertiary:              #ffffff;
  --tertiary-container:       #826372;
  --on-tertiary-container:    #ffe7f0;
  --tertiary-fixed:           #ffd8e9;
  --tertiary-fixed-dim:       #e2bccd;
  --on-tertiary-fixed:        #2b1421;
  --on-tertiary-fixed-variant:#5a3f4d;

  /* —— Error —— */
  --error:                    #ba1a1a;
  --on-error:                 #ffffff;
  --error-container:          #ffdad6;
  --on-error-container:       #93000a;

  /* —— Brand accents —— */
  --brand-purple:             #7D5DA1;
  --brand-pink:               #D291BC;
  --sage-teal:                #6B9080;
  --warm-gold:                #D4AF37;

  /* —— Semantic —— */
  --success:                  #52B788;
  --warning:                  #F4A261;
  --danger:                   #E76F51;

  /* —— Typography —— */
  --font-family:              'IBM Plex Sans Arabic', sans-serif;

  /* —— Border radius —— */
  --rounded-sm:   0.25rem;
  --rounded:      0.5rem;
  --rounded-md:   0.75rem;
  --rounded-lg:   1rem;
  --rounded-xl:   1.5rem;
  --rounded-full: 9999px;

  /* —— Spacing (8px grid) —— */
  --space-xs:   4px;
  --space-sm:   12px;
  --space-base: 8px;
  --space-md:   24px;
  --space-lg:   48px;
  --space-xl:   80px;
  --gutter:     16px;
  --margin-mobile:  16px;
  --margin-desktop: 32px;

  /* —— Elevation —— */
  --shadow-1: 0px 4px 20px rgba(125, 93, 161, 0.05);
  --shadow-2: 0px 8px 32px rgba(125, 93, 161, 0.08);
  --shadow-3: 0px 16px 48px rgba(125, 93, 161, 0.12);
  --shadow-glow: 0 0 40px rgba(125, 93, 161, 0.15);
  --backdrop-blur: blur(12px);

  /* —— Gradients —— */
  --gradient-hero: linear-gradient(160deg, #f6f0ff 0%, #f9faf5 40%, #eef6f2 100%);
  --gradient-primary: linear-gradient(135deg, #7D5DA1, #D291BC);
  --gradient-sage: linear-gradient(135deg, #6B9080, #8ab89d);
  --gradient-warm: linear-gradient(135deg, #FAF7F2, #f6f0ff);
  --gradient-card-shine: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.4) 100%);

  /* —— Motion —— */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 0.2s;
  --duration-base: 0.4s;
  --duration-slow: 0.7s;

  /* —— Input —— */
  --input-bg: #F0F2F5;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  direction: rtl;
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--on-surface);
  background-color: var(--surface);
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out-expo);
}
a:hover { color: var(--primary-container); }

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

ul, ol { list-style: none; }

/* ============================================================
   Typography
   ============================================================ */
.display-lg {
  font-size: 40px;
  font-weight: 700;
  line-height: 56px;
}
.headline-lg {
  font-size: 32px;
  font-weight: 600;
  line-height: 44px;
}
.headline-md {
  font-size: 24px;
  font-weight: 600;
  line-height: 34px;
}
.headline-sm {
  font-size: 20px;
  font-weight: 500;
  line-height: 28px;
}
.body-lg {
  font-size: 18px;
  font-weight: 400;
  line-height: 30px;
}
.body-md {
  font-size: 16px;
  font-weight: 400;
  line-height: 26px;
}
.label-md {
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: 0.02em;
}
.caption {
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
}

@media (max-width: 768px) {
  .headline-lg {
    font-size: 28px;
    line-height: 38px;
  }
}

/* ============================================================
   Layout
   ============================================================ */
.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding-inline: var(--margin-desktop);
}

@media (max-width: 768px) {
  .container { padding-inline: var(--margin-mobile); }
}

.page-content {
  min-height: calc(100vh - 140px);
  padding-top: var(--space-lg);
  padding-bottom: var(--space-xl);
}

/* Grid helpers */
.grid { display: grid; gap: var(--gutter); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.flex-col    { display: flex; flex-direction: column; }
.gap-xs      { gap: var(--space-xs); }
.gap-sm      { gap: var(--space-sm); }
.gap-md      { gap: var(--space-md); }
.gap-lg      { gap: var(--space-lg); }

/* ============================================================
   Components — Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-base);
  padding: 12px 24px;
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  border: none;
  border-radius: var(--rounded-lg);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out-expo);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,0.2), transparent);
  opacity: 0;
  transition: opacity var(--duration-fast);
}
.btn:hover::after { opacity: 1; }
.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(125, 93, 161, 0.2);
}
.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(210, 145, 188, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}
.btn-secondary:hover {
  background: #aedbc8;
}

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

.btn-ghost {
  background: transparent;
  color: var(--on-surface-variant);
}
.btn-ghost:hover {
  background: var(--surface-container);
}

.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-lg { padding: 16px 32px; font-size: 18px; }
.btn-block { width: 100%; }
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--rounded-full);
}

/* ============================================================
   Components — Cards
   ============================================================ */
.card {
  background: var(--surface-container-lowest);
  border-radius: var(--rounded-lg);
  box-shadow: var(--shadow-1);
  padding: var(--space-md);
  transition: all var(--duration-base) var(--ease-out-expo);
  border: 1px solid rgba(0,0,0,0.03);
}
.card:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}
.card-flat {
  background: var(--surface-container-low);
  border-radius: var(--rounded);
  padding: var(--space-md);
}

/* ============================================================
   Components — Form Inputs
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-base);
}

.form-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface-variant);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.5;
  color: var(--on-surface);
  background: var(--input-bg);
  border: 2px solid transparent;
  border-radius: var(--rounded);
  transition: all 0.2s;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(100, 69, 135, 0.12);
  background: var(--surface-container-lowest);
}
.form-input::placeholder {
  color: var(--outline);
}
.form-input.error {
  border-color: var(--danger);
}

.form-hint {
  font-size: 12px;
  color: var(--outline);
}
.form-error {
  font-size: 12px;
  color: var(--danger);
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='%237c7480'%3E%3Cpath d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 16px center;
  padding-left: 40px;
}

/* Checkbox / Radio */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  cursor: pointer;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  margin-top: 3px;
  flex-shrink: 0;
}

/* ============================================================
   Components — Chips / Badges
   ============================================================ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--rounded-full);
  white-space: nowrap;
}
.chip-success {
  background: #dff5eb;
  color: #1b6d44;
}
.chip-warning {
  background: #fef0df;
  color: #8a5a1e;
}
.chip-danger {
  background: #fde5e0;
  color: #923123;
}
.chip-neutral {
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
}
.chip-primary {
  background: var(--primary-fixed);
  color: var(--on-primary-fixed);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--rounded-full);
  background: var(--danger);
  color: #fff;
}

/* ============================================================
   Components — Navigation
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding: var(--space-sm) 0;
  transition: all var(--duration-base) var(--ease-out-expo);
}
.navbar-scrolled {
  padding: 6px 0;
  box-shadow: 0 1px 16px rgba(0,0,0,0.06);
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar-logo img {
  height: 80px;
}
.navbar-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.navbar-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface-variant);
  transition: color 0.2s;
}
.navbar-links a:hover,
.navbar-links a.active {
  color: var(--primary);
}

/* Mobile bottom nav */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--surface-container-lowest);
  border-top: 1px solid var(--surface-container-high);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom, 0px));
}
.bottom-nav ul {
  display: flex;
  justify-content: space-around;
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 500;
  color: var(--on-surface-variant);
  padding: 4px 12px;
}
.bottom-nav a.active {
  color: var(--primary);
}
.bottom-nav .nav-icon {
  width: 24px;
  height: 24px;
}

@media (max-width: 768px) {
  .bottom-nav { display: block; }
  .navbar-links .nav-desktop-only { display: none; }
  .navbar-links { gap: var(--space-sm); }
  .navbar-logo img { height: 62px; }
  .navbar { padding: 8px 0; }
  .page-content { padding-bottom: calc(var(--space-xl) + 60px); }
  .container { padding: 0 var(--space-sm); }
  .grid.grid-3, .grid.grid-2 { grid-template-columns: 1fr; }

  /* Navbars that have a bottom-nav on mobile — hide text links, show only logo + compact icon */
  .navbar-has-bottom .navbar-links { display: none; }
  .navbar-has-bottom .navbar-mobile-end { display: flex; }
}

/* Mobile-end icons (logout/menu) shown only on mobile for navbars with bottom-nav */
.navbar-mobile-end {
  display: none;
  align-items: center;
  gap: var(--space-sm);
}

/* Hamburger menu for roles without bottom-nav (e.g. analyst) */
.hamburger-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--rounded);
  color: var(--on-surface-variant);
  display: none;
  transition: background .15s;
}
.hamburger-btn:hover { background: var(--surface-container); }
@media (max-width: 768px) {
  .navbar-hamburger .hamburger-btn { display: flex; align-items: center; }
  .navbar-hamburger .navbar-links {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--surface-container-high);
    padding: var(--space-sm) var(--margin-mobile);
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    z-index: 200;
  }
  .navbar-hamburger .navbar-links.open { display: flex; }
  .navbar-hamburger .navbar-links a {
    padding: 12px var(--space-sm);
    border-radius: var(--rounded);
    font-size: 15px;
    border-bottom: 1px solid var(--surface-container-low);
  }
  .navbar-hamburger .navbar-links a:last-child { border-bottom: none; }
  .navbar-hamburger { position: relative; }
}

/* ============================================================
   Components — Tabs
   ============================================================ */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--surface-container-high);
}
.tab {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface-variant);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.2s;
}
.tab:hover { color: var(--primary); }
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ============================================================
   Components — Modal / Overlay
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: var(--backdrop-blur);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--margin-mobile);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal {
  background: var(--surface-container-lowest);
  border-radius: var(--rounded-lg);
  box-shadow: var(--shadow-2);
  padding: var(--space-md);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

/* ============================================================
   Components — Empty State
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  color: var(--on-surface-variant);
}
.empty-state-icon {
  width: 80px;
  height: 80px;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}
.empty-state p {
  max-width: 320px;
  margin-top: var(--space-sm);
}

/* ============================================================
   Components — Progress
   ============================================================ */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--surface-container-high);
  border-radius: var(--rounded-full);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--sage-teal);
  border-radius: var(--rounded-full);
  transition: width 0.4s ease;
}

.steps-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.step-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--rounded-full);
  background: var(--surface-container-high);
  transition: background 0.2s;
}
.step-dot.active { background: var(--primary); }
.step-dot.done   { background: var(--success); }

/* ============================================================
   Components — Timer
   ============================================================ */
.session-timer {
  display: inline-flex;
  align-items: center;
  gap: var(--space-base);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--rounded);
  background: var(--surface-container-low);
  color: var(--on-surface);
}
.session-timer.warning {
  animation: timer-pulse 2s ease-in-out infinite;
}
@keyframes timer-pulse {
  0%, 100% { background: var(--surface-container-low); }
  50%      { background: #fef0df; }
}

/* ============================================================
   Components — Rating Stars
   ============================================================ */
.star-rating {
  display: flex;
  gap: 4px;
  direction: ltr;
}
.star-rating .star {
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: var(--surface-container-high);
  transition: color 0.15s;
}
.star-rating .star.filled { color: var(--warm-gold); }
.star-rating .star:hover  { color: var(--warm-gold); }

/* ============================================================
   Components — Consultation Card (left-border → right for RTL)
   ============================================================ */
.consultation-card {
  background: var(--surface-container-lowest);
  border-radius: var(--rounded);
  box-shadow: var(--shadow-1);
  padding: var(--space-md);
  border-right: 4px solid var(--sage-teal);
  transition: box-shadow 0.2s;
}
.consultation-card:hover {
  box-shadow: var(--shadow-2);
}

/* ============================================================
   Components — Alert / Banner
   ============================================================ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--gutter);
  border-radius: var(--rounded);
  font-size: 14px;
}
.alert-info {
  background: var(--primary-fixed);
  color: var(--on-primary-fixed);
}
.alert-success {
  background: #dff5eb;
  color: #1b6d44;
}
.alert-warning {
  background: #fef0df;
  color: #8a5a1e;
}
.alert-error, .alert-danger {
  background: var(--error-container);
  color: var(--on-error-container);
}

.flash-messages-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 90%;
  max-width: 480px;
}
.flash-message {
  box-shadow: var(--shadow-2);
  animation: flash-in 0.25s var(--ease-out-expo, ease-out);
}
@keyframes flash-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Components — Avatar
   ============================================================ */
.avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--rounded-full);
  background: var(--primary-fixed);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
  flex-shrink: 0;
}
.avatar-sm { width: 36px; height: 36px; font-size: 14px; }
.avatar-lg { width: 64px; height: 64px; font-size: 24px; }

/* ============================================================
   Components — Skeleton Loading
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--surface-container-high) 25%, var(--surface-container) 50%, var(--surface-container-high) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--rounded-sm);
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   Utilities
   ============================================================ */
.text-center   { text-align: center; }
.text-start    { text-align: start; }
.text-muted    { color: var(--on-surface-variant); }
.text-primary  { color: var(--primary); }
.text-success  { color: var(--success); }
.text-danger   { color: var(--danger); }
.text-warning  { color: var(--warning); }

.mt-xs  { margin-top: var(--space-xs); }
.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }

.w-full { width: 100%; }
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ============================================================
   Page-level wrappers
   ============================================================ */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--margin-mobile);
}
.auth-card {
  background: var(--surface-container-lowest);
  border-radius: var(--rounded-lg);
  box-shadow: var(--shadow-2);
  padding: var(--space-lg) var(--space-md);
  width: 100%;
  max-width: 440px;
  text-align: center;
}

/* Footer */
.site-footer {
  background: linear-gradient(180deg, #1a1625 0%, #0f0b18 100%);
  color: rgba(255, 255, 255, 0.9);
  padding: 0;
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-purple), var(--sage-teal), var(--brand-pink));
}
.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--space-lg);
  padding: var(--space-xl) 0 var(--space-lg);
}
.footer-brand {
  padding-left: var(--space-md);
}
.footer-logo {
  height: 72px;
  margin-bottom: var(--space-sm);
}
.footer-tagline {
  font-size: 14px;
  line-height: 1.7;
  opacity: 0.65;
  margin-bottom: var(--space-md);
  max-width: 280px;
}
.footer-trust-badges {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.footer-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: var(--rounded-full);
  background: rgba(125, 93, 161, 0.15);
  border: 1px solid rgba(125, 93, 161, 0.2);
  color: rgba(255, 255, 255, 0.8);
}
.footer-badge svg {
  opacity: 0.7;
}
.footer-heading {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: #fff;
  position: relative;
}
.footer-heading::after {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--brand-purple);
  margin-top: 8px;
  border-radius: 2px;
}
.footer-links-group {
  display: flex;
  flex-direction: column;
}
.footer-links-group a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  padding: 6px 0;
  transition: color 0.2s, padding-right 0.2s;
}
.footer-links-group a:hover {
  color: #fff;
  padding-right: 6px;
}
.footer-contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-contact-item svg {
  opacity: 0.5;
  flex-shrink: 0;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  opacity: 0.5;
}
.footer-built {
  font-size: 12px;
}
.site-footer a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
}
.site-footer a:hover {
  color: #fff;
  opacity: 1;
}

@media (max-width: 768px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    padding: var(--space-lg) 0;
  }
  .footer-brand {
    grid-column: 1 / -1;
    padding-left: 0;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }
}

/* ============================================================
   Scroll-Reveal Animations
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity var(--duration-slow) var(--ease-out-expo),
              transform var(--duration-slow) var(--ease-out-expo);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.reveal-item {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-base) var(--ease-out-expo),
              transform var(--duration-base) var(--ease-out-expo);
}
.reveal-item.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Reveal variants */
.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity var(--duration-slow) var(--ease-out-expo),
              transform var(--duration-slow) var(--ease-out-expo);
}
.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1);
}
.reveal-left {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity var(--duration-slow) var(--ease-out-expo),
              transform var(--duration-slow) var(--ease-out-expo);
}
.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}
.reveal-right {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity var(--duration-slow) var(--ease-out-expo),
              transform var(--duration-slow) var(--ease-out-expo);
}
.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

/* ============================================================
   Gradient Text
   ============================================================ */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   Floating / Decorative Elements
   ============================================================ */
.float-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}
.float-orb-purple {
  background: var(--brand-purple);
}
.float-orb-pink {
  background: var(--brand-pink);
}
.float-orb-sage {
  background: var(--sage-teal);
}

@keyframes float-gentle {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50%      { transform: translateY(-20px) rotate(2deg); }
}
@keyframes float-reverse {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50%      { transform: translateY(16px) rotate(-2deg); }
}
.animate-float {
  animation: float-gentle 6s ease-in-out infinite;
}
.animate-float-reverse {
  animation: float-reverse 7s ease-in-out infinite;
}

/* ============================================================
   Glass Card
   ============================================================ */
.glass-card {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--rounded-xl);
  box-shadow: var(--shadow-2);
}

/* ============================================================
   Gradient Border Card
   ============================================================ */
.gradient-border {
  position: relative;
  border-radius: var(--rounded-xl);
  padding: 2px;
  background: var(--gradient-primary);
}
.gradient-border-inner {
  background: var(--surface-container-lowest);
  border-radius: calc(var(--rounded-xl) - 2px);
  padding: var(--space-md);
}

/* ============================================================
   Tilt Card
   ============================================================ */
.tilt-card {
  transition: transform var(--duration-fast) var(--ease-out-expo);
  will-change: transform;
}

/* ============================================================
   Magnetic Button
   ============================================================ */
.btn-magnetic {
  transition: transform var(--duration-fast) var(--ease-spring);
  will-change: transform;
}

/* ============================================================
   Shimmer Accent
   ============================================================ */
@keyframes shimmer-move {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.shimmer-accent {
  background-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.4) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer-move 3s ease-in-out infinite;
}

/* ============================================================
   Modern Form Focus Glow
   ============================================================ */
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(125, 93, 161, 0.12),
              0 4px 16px rgba(125, 93, 161, 0.08);
  background: var(--surface-container-lowest);
}

/* ============================================================
   Tab Indicator (animated underline)
   ============================================================ */
.tabs {
  position: relative;
}
.tab-indicator {
  position: absolute;
  bottom: 0;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: all var(--duration-base) var(--ease-out-expo);
}

/* ============================================================
   Pulse Badge
   ============================================================ */
.badge-pulse {
  position: relative;
}
.badge-pulse::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  background: var(--danger);
  opacity: 0.4;
  animation: badge-ping 1.5s ease-in-out infinite;
}
@keyframes badge-ping {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50%      { transform: scale(1.5); opacity: 0; }
}

/* ============================================================
   Modern Divider
   ============================================================ */
.divider-gradient {
  height: 1px;
  background: linear-gradient(to left, transparent, var(--outline-variant), transparent);
  border: none;
  margin: var(--space-md) 0;
}

/* ============================================================
   Icon Circle (modern)
   ============================================================ */
.icon-circle {
  width: 56px;
  height: 56px;
  border-radius: var(--rounded-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--duration-base) var(--ease-out-expo);
}
.icon-circle:hover {
  transform: scale(1.08);
}

/* ============================================================
   Scrollbar (subtle)
   ============================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--outline-variant);
  border-radius: 3px;
}

/* ============================================================
   Prefers-reduced-motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .reveal-item, .reveal-scale, .reveal-left, .reveal-right {
    opacity: 1;
    transform: none;
  }
}
