/* =====================================================
   ASSISTANT AMINE, Design System v2
   Zone Zero Rupture / CCMQ
   Bleu du Quebec | Arabesque Accent | Premium Modern
   ===================================================== */

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

/* === VARIABLES === */
:root {
  /* Quebec Blue Palette */
  --navy: #0A1628;
  --navy-mid: #0F2B3C;
  --blue-quebec: #003DA5;
  --blue-deep: #1B4F72;
  --blue: #2980B9;
  --blue-light: #5DADE2;
  --blue-pale: #EBF5FB;
  --blue-glow: rgba(41, 128, 185, 0.15);

  /* Gold & Warm Accents */
  --gold: #C9A84C;
  --gold-warm: #D4A024;
  --gold-light: rgba(201, 168, 76, 0.12);
  --gold-glow: rgba(201, 168, 76, 0.25);

  /* Teal */
  --teal: #1ABC9C;
  --teal-dark: #16A085;

  /* Urgency */
  --urgence-faible: #27AE60;
  --urgence-modere: #F39C12;
  --urgence-eleve: #E74C3C;
  --urgence-critique: #8E44AD;

  /* Neutrals */
  --white: #FFFFFF;
  --gray-50: #F8FAFB;
  --gray-100: #F0F3F5;
  --gray-200: #E2E8ED;
  --gray-300: #CBD5DE;
  --gray-400: #9CAAB8;
  --gray-500: #7B8D9E;
  --gray-600: #5A6B7A;
  --gray-700: #3D4F5F;
  --gray-800: #2C3E50;
  --gray-900: #1A252F;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-arabic: 'Noto Sans Arabic', 'Inter', sans-serif;

  /* Sizing */
  --container-max: 1100px;
  --container-px: clamp(16px, 4vw, 48px);
  --chat-max: 720px;

  /* Effects */
  --shadow-sm: 0 1px 3px rgba(10,22,40,0.08);
  --shadow-md: 0 4px 20px rgba(10,22,40,0.10);
  --shadow-lg: 0 12px 40px rgba(10,22,40,0.14);
  --shadow-glow: 0 0 30px rgba(41,128,185,0.15);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --bg-primary: var(--navy);
}


/* === ARABESQUE SVG PATTERN (subtle, one zone) === */
.arabesque-accent {
  position: absolute;
  pointer-events: none;
  opacity: 0.04;
  z-index: 0;
}
.arabesque-accent svg {
  width: 100%;
  height: 100%;
}


/* === TYPOGRAPHY === */
body {
  font-family: var(--font-sans);
  color: var(--white);
  background: var(--navy);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h1 em { font-family: var(--font-serif); font-style: normal; color: var(--gold); }
h2 { font-size: clamp(1.3rem, 3vw, 1.8rem); }

.darija-text {
  font-family: var(--font-arabic);
  direction: rtl;
  color: var(--gold);
}


/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  border-radius: var(--radius-md);
  padding: 14px 28px;
  letter-spacing: 0.01em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue-quebec) 0%, var(--blue) 100%);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(0,61,165,0.3);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,61,165,0.4);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-warm) 100%);
  color: var(--navy);
  box-shadow: 0 4px 16px rgba(201,168,76,0.3);
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(201,168,76,0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--blue-light);
  border: 1.5px solid rgba(93,173,226,0.3);
}
.btn-ghost:hover {
  background: rgba(93,173,226,0.08);
  border-color: var(--blue-light);
}

.btn-accept {
  background: linear-gradient(135deg, var(--blue-quebec) 0%, var(--blue) 100%);
  color: var(--white);
  padding: 14px 32px;
  box-shadow: 0 4px 16px rgba(0,61,165,0.3);
}

.btn-refuse {
  background: transparent;
  color: var(--gray-400);
  border: 1.5px solid var(--gray-600);
  padding: 12px 28px;
}
.btn-refuse:hover { border-color: var(--gray-400); color: var(--gray-300); }

.btn-sm {
  font-size: 0.85rem;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
}


/* ═══════════════════════════════════════════════════════
   LANDING PAGE, Hero Section
   ═══════════════════════════════════════════════════════ */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(160deg, var(--navy) 0%, #0D2440 40%, var(--blue-quebec) 100%);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: visible;
}

/* Maghreb zellige pattern, right side */
.hero::before {
  content: '';
  position: absolute;
  right: -5%;
  top: 0;
  width: 55%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3C!-- 8-pointed star (khatam) --%3E%3Cpolygon points='50,5 61,35 95,35 68,55 79,85 50,68 21,85 32,55 5,35 39,35' fill='none' stroke='%23C9A84C' stroke-width='0.4'/%3E%3C!-- Inner octagon --%3E%3Cpolygon points='50,20 65,30 70,50 65,70 50,80 35,70 30,50 35,30' fill='none' stroke='%23C9A84C' stroke-width='0.3'/%3E%3C!-- Central circle --%3E%3Ccircle cx='50' cy='50' r='10' fill='none' stroke='%23C9A84C' stroke-width='0.25'/%3E%3C!-- Corner arcs --%3E%3Cpath d='M0,0 Q25,12 50,0' fill='none' stroke='%23C9A84C' stroke-width='0.2'/%3E%3Cpath d='M50,0 Q75,12 100,0' fill='none' stroke='%23C9A84C' stroke-width='0.2'/%3E%3Cpath d='M0,100 Q25,88 50,100' fill='none' stroke='%23C9A84C' stroke-width='0.2'/%3E%3Cpath d='M50,100 Q75,88 100,100' fill='none' stroke='%23C9A84C' stroke-width='0.2'/%3E%3C/svg%3E");
  background-size: 100px 100px;
  opacity: 0.045;
  pointer-events: none;
  z-index: 0;
  mask-image: linear-gradient(to left, rgba(0,0,0,0.7) 0%, transparent 75%);
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,0.7) 0%, transparent 75%);
}

/* Subtle glow circle */
.hero-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,61,165,0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero-glow-1 { top: -10%; right: 10%; }
.hero-glow-2 { bottom: -15%; left: -10%; opacity: 0.6; }

/* Logo area, top of page */
.hero-logo-bar {
  position: relative;
  z-index: 2;
  padding: 24px var(--container-px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-logo-bar img {
  height: 160px;
  object-fit: contain;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.35));
}

/* Main hero layout, Amine left, text right */
.hero-main {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: clamp(24px, 5vw, 60px);
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-px);
  width: 100%;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero-text h1 {
  margin-bottom: 20px;
  font-size: clamp(2rem, 4.5vw, 3rem);
}

.hero-subtitle {
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  color: rgba(255,255,255,0.8);
  line-height: 1.7;
  margin-bottom: 10px;
  max-width: 520px;
}

.hero-darija {
  display: block;
  font-family: var(--font-arabic);
  direction: rtl;
  color: var(--gold);
  font-size: 0.9em;
  margin-top: 10px;
  opacity: 0.9;
}

/* Promise cards */
.hero-promises {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 28px 0 32px;
}

.promise-card {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: all var(--transition);
}
.promise-card:hover {
  background: rgba(255,255,255,0.09);
  transform: translateY(-2px);
}

.promise-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(93,173,226,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  color: var(--blue-light);
}

.promise-card h3 {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--white);
}

.promise-card p {
  font-size: 0.72rem;
  color: var(--gray-400);
  line-height: 1.4;
}

/* CTA */
.hero-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.hero-cta .btn-primary {
  font-size: 1.05rem;
  padding: 16px 40px;
  border-radius: var(--radius-lg);
}

.hero-legal {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--gold);
  padding: 8px 20px;
  border: 1.5px solid rgba(201,168,76,0.35);
  border-radius: var(--radius-sm);
  background: rgba(201,168,76,0.08);
  letter-spacing: 0.02em;
}

/* Amine photo, right column */
.hero-avatar-col {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-avatar-col img {
  height: clamp(400px, 55vh, 620px);
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 20px 60px rgba(0,0,0,0.4));
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* Trust bar */
.trust-banner {
  position: relative;
  z-index: 2;
  padding: 16px var(--container-px) 20px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.trust-text {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-bottom: 10px;
}

.trust-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.trust-inner img {
  height: 28px;
  opacity: 0.5;
  filter: grayscale(0.5);
  transition: all var(--transition);
}
.trust-inner img:hover {
  opacity: 0.8;
  filter: grayscale(0);
}


/* ═══════════════════════════════════════════════════════
   CONSENT MODAL
   ═══════════════════════════════════════════════════════ */

.consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10,22,40,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
}
.consent-overlay.active {
  opacity: 1;
  visibility: visible;
}

.consent-card {
  background: linear-gradient(165deg, #0F2B3C 0%, #0A1628 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 44px);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.4s ease;
}
.consent-overlay.active .consent-card {
  transform: translateY(0);
}

.consent-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(0,61,165,0.2) 0%, rgba(41,128,185,0.15) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.consent-card h2 {
  font-size: 1.3rem;
  margin-bottom: 14px;
  color: var(--white);
}

.consent-card > p {
  font-size: 0.9rem;
  color: var(--gray-400);
  line-height: 1.6;
  margin-bottom: 14px;
}

.consent-points {
  list-style: none;
  padding: 0;
  margin-bottom: 18px;
}

.consent-points li {
  position: relative;
  padding: 8px 0 8px 28px;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.5;
}

.consent-points li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 8px;
  color: var(--teal);
  font-weight: 700;
  font-size: 0.9rem;
}

.consent-points li strong {
  color: var(--white);
}

.consent-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}


/* ═══════════════════════════════════════════════════════
   CHAT PAGE
   ═══════════════════════════════════════════════════════ */

.chat-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: linear-gradient(180deg, var(--navy) 0%, #0D2440 100%);
  position: relative;
  overflow: hidden;
}

/* Maghreb zellige pattern on chat, very subtle */
.chat-page::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 35%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cpolygon points='50,5 61,35 95,35 68,55 79,85 50,68 21,85 32,55 5,35 39,35' fill='none' stroke='%23C9A84C' stroke-width='0.4'/%3E%3Cpolygon points='50,20 65,30 70,50 65,70 50,80 35,70 30,50 35,30' fill='none' stroke='%23C9A84C' stroke-width='0.3'/%3E%3Ccircle cx='50' cy='50' r='10' fill='none' stroke='%23C9A84C' stroke-width='0.25'/%3E%3C/svg%3E");
  background-size: 100px 100px;
  opacity: 0.025;
  pointer-events: none;
  z-index: 0;
  mask-image: linear-gradient(to left, rgba(0,0,0,0.4) 0%, transparent 70%);
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,0.4) 0%, transparent 70%);
}

/* Chat Header, compact, no white BG */
.chat-header {
  position: relative;
  z-index: 10;
  padding: 14px var(--container-px);
  background: rgba(10,22,40,0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.chat-header-inner {
  max-width: var(--chat-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--gray-400);
  text-decoration: none;
  transition: all var(--transition);
}
.chat-back-btn:hover { background: rgba(255,255,255,0.06); }
.chat-back-btn svg { stroke: var(--gray-400); }

.chat-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--gold);
  flex-shrink: 0;
}
.chat-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-header-info {
  flex: 1;
  min-width: 0;
}
.chat-header-info h1 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.2;
}
.chat-header-status {
  font-size: 0.72rem;
  color: var(--teal);
  display: flex;
  align-items: center;
  gap: 5px;
}
.chat-header-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
}

.chat-header-logos {
  margin-left: auto;
}
.chat-header-logos img {
  height: 28px;
  opacity: 0.6;
}

.chat-header-menu {
  background: none;
  border: none;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  cursor: pointer;
  color: var(--gray-400);
  transition: all var(--transition);
}
.chat-header-menu:hover { background: rgba(255,255,255,0.06); }

/* Progress Bar */
.chat-progress {
  position: relative;
  z-index: 5;
  height: 3px;
  background: rgba(255,255,255,0.04);
}
.chat-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-quebec), var(--blue-light));
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0 2px 2px 0;
}


/* ─── Messages Area ─── */
.chat-messages {
  position: relative;
  z-index: 2;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px var(--container-px) 80px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.chat-messages-inner {
  max-width: var(--chat-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Custom scrollbar */
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }


/* ─── Message Bubbles ─── */
.message {
  display: flex;
  gap: 10px;
  max-width: 85%;
  animation: msgIn 0.4s ease;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-bot { align-self: flex-start; }
.message-user { align-self: flex-end; flex-direction: row-reverse; }
.message-narjiss { align-self: flex-end; flex-direction: row-reverse; }

.message-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.1);
}
.message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-bot .message-avatar { border-color: rgba(93,173,226,0.3); }
.message-narjiss .message-avatar { border-color: var(--gold-glow); }

.message-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message-sender {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gray-400);
  padding-left: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.message-narjiss .message-sender { color: var(--gold); }

.message-bubble {
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 14px 18px;
  border-radius: 18px 18px 18px 4px;
  font-size: 0.92rem;
  line-height: 1.65;
  color: rgba(255,255,255,0.92);
}

.message-user .message-bubble {
  background: linear-gradient(135deg, var(--blue-quebec) 0%, var(--blue) 100%);
  border: none;
  border-radius: 18px 18px 4px 18px;
  color: var(--white);
}

.message-narjiss .message-bubble {
  background: rgba(201,168,76,0.08);
  border-color: rgba(201,168,76,0.15);
  border-radius: 18px 18px 4px 18px;
}

.message-narjiss .message-sender {
  color: var(--gold);
  text-align: right;
  padding-left: 0;
  padding-right: 4px;
}

.message-darija {
  display: none;
  font-family: var(--font-arabic);
  direction: rtl;
  color: var(--gold);
  font-size: 0.85em;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(201,168,76,0.15);
  line-height: 1.7;
}


/* ─── Options ─── */
.options-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 85%;
  align-self: flex-start;
  margin-left: 48px;
  animation: msgIn 0.4s ease;
}

.option-btn {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(93,173,226,0.2);
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.4;
}
.option-btn:hover {
  background: rgba(0,61,165,0.15);
  border-color: var(--blue);
  transform: translateX(4px);
}
.option-btn:active {
  transform: translateX(2px) scale(0.99);
}

.option-escape {
  border-color: rgba(255,255,255,0.08);
  color: var(--gray-400);
  font-weight: 400;
}
.option-escape:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.15);
  color: var(--gray-300);
}

.option-label-fr { display: block; }
.option-label-darija {
  display: none;
  font-family: var(--font-arabic);
  direction: rtl;
  color: var(--gold);
  font-size: 0.82em;
  opacity: 0.8;
}


/* ─── Multi-Select ─── */
.multiselect-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 85%;
  align-self: flex-start;
  margin-left: 48px;
  animation: msgIn 0.4s ease;
}

.option-btn.option-multiselect {
  position: relative;
  padding-right: 42px;
  border-color: rgba(93,173,226,0.15);
  background: rgba(255,255,255,0.04);
}

.option-btn.option-multiselect:hover {
  background: rgba(0,61,165,0.1);
  border-color: rgba(93,173,226,0.3);
}

.option-btn.option-multiselect.selected {
  background: rgba(0,61,165,0.18);
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue), 0 2px 8px rgba(0,61,165,0.2);
}

.option-btn.option-multiselect.selected .multiselect-check {
  opacity: 1;
  transform: scale(1);
  background: var(--blue);
}

.option-btn.option-multiselect.already-selected {
  opacity: 0.45;
  border-color: rgba(255,255,255,0.06);
  cursor: default;
  pointer-events: none;
}

.option-btn.option-multiselect.already-selected .multiselect-check {
  opacity: 0.6;
  transform: scale(1);
  background: var(--gray-600);
}

.multiselect-check {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%) scale(0.8);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: all 0.25s ease;
}

.multiselect-check svg {
  stroke: var(--white);
}

.multiselect-continue {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 24px;
  margin-top: 4px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(93,173,226,0.15);
  border-radius: var(--radius-md);
  color: var(--gray-500);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.multiselect-continue:disabled {
  opacity: 0.5;
  cursor: default;
}

.multiselect-continue.active {
  background: linear-gradient(135deg, var(--blue-quebec) 0%, var(--blue) 100%);
  border-color: transparent;
  color: var(--white);
  box-shadow: 0 4px 16px rgba(0,61,165,0.3);
  opacity: 1;
}

.multiselect-continue.active:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,61,165,0.4);
}

.multiselect-continue-text {
  font-weight: 600;
}

.multiselect-count {
  font-size: 0.78rem;
  font-weight: 400;
  opacity: 0.7;
}

.multiselect-separator {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 6px 0;
}


/* ─── Typing Indicator ─── */
.typing-indicator {
  display: flex;
  gap: 10px;
  align-items: center;
  align-self: flex-start;
  animation: msgIn 0.3s ease;
}

.typing-dots {
  display: flex;
  gap: 4px;
  padding: 14px 18px;
  background: rgba(255,255,255,0.05);
  border-radius: 18px 18px 18px 4px;
  border: 1px solid rgba(255,255,255,0.05);
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue-light);
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}


/* ─── Chat Footer ─── */
.chat-footer {
  position: relative;
  z-index: 10;
  padding: 12px var(--container-px) calc(12px + env(safe-area-inset-bottom));
  background: rgba(10,22,40,0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.05);
}

.chat-footer-inner {
  max-width: var(--chat-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-footer-logo {
  height: 28px;
  object-fit: contain;
  opacity: 0.5;
  filter: brightness(1.5);
  flex-shrink: 0;
}

.emergency-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(231,76,60,0.1);
  border: 1px solid rgba(231,76,60,0.25);
  color: #E74C3C;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.emergency-btn:hover {
  background: rgba(231,76,60,0.18);
  border-color: #E74C3C;
}

.chat-footer-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--gray-400);
  transition: all var(--transition);
}
.chat-footer-menu:hover { background: rgba(255,255,255,0.1); color: var(--white); }

.darija-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.2);
  color: var(--gold);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-arabic);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
}
.darija-toggle:hover { background: rgba(201,168,76,0.15); }
.darija-toggle.active {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}


/* ─── Menu Dropdown ─── */
.chat-dropdown {
  position: fixed;
  bottom: 70px;
  right: 16px;
  z-index: 50;
  background: #0F2B3C;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.95);
  transition: all 0.2s ease;
}
.chat-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 18px;
  background: none;
  border: none;
  color: var(--gray-300);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition);
}
.dropdown-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--white);
}
.dropdown-item + .dropdown-item {
  border-top: 1px solid rgba(255,255,255,0.05);
}


/* ═══════════════════════════════════════════════════════
   PLAN DISPLAY
   ═══════════════════════════════════════════════════════ */

.plan-container {
  animation: msgIn 0.5s ease;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Urgency Header */
.plan-urgency-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border-radius: var(--radius-md);
  color: var(--white);
}
.plan-urgency-icon { font-size: 1.5rem; }
.plan-urgency-info { display: flex; flex-direction: column; gap: 2px; }
.plan-urgency-label { font-size: 1.05rem; font-weight: 700; }
.plan-urgency-darija {
  font-family: var(--font-arabic);
  direction: rtl;
  font-size: 0.85rem;
  opacity: 0.9;
}

/* Summary */
.plan-summary {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  padding: 18px 22px;
}
.plan-summary h3 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  margin-bottom: 6px;
}
.plan-summary p {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.5;
}

/* N1/N2/N3 Levels */
.plan-levels {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-level {
  display: flex;
  gap: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.plan-level-badge {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue-quebec) 0%, var(--blue) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--white);
}

.plan-level-badge-n2 {
  background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 100%);
}

.plan-level-badge-n3 {
  background: linear-gradient(135deg, var(--gold-warm) 0%, var(--gold) 100%);
  color: var(--navy);
}

.plan-level-content h4 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--blue-light);
  margin-bottom: 4px;
}

.plan-level-content p {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.55;
}

/* Pedagogical */
.plan-pedagogical {
  background: rgba(93,173,226,0.06);
  border: 1px solid rgba(93,173,226,0.12);
  border-radius: var(--radius-md);
  padding: 18px 22px;
}
.plan-pedagogical h4 {
  font-size: 0.85rem;
  color: var(--blue-light);
  margin-bottom: 8px;
}
.plan-pedagogical p {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.78);
  line-height: 1.6;
}
.plan-pedagogical-darija {
  font-family: var(--font-arabic);
  direction: rtl;
  color: var(--gold) !important;
  margin-top: 10px;
  font-size: 0.85rem !important;
}

/* Resources */
.plan-resources {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan-resources h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  margin-bottom: 4px;
}

.resource-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.resource-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--white);
  flex: 1 0 auto;
}

.resource-phone {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue-light);
  text-decoration: none;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(93,173,226,0.1);
  transition: all var(--transition);
}
.resource-phone:hover { background: rgba(93,173,226,0.2); }

.resource-link {
  font-size: 0.8rem;
  color: var(--teal);
  text-decoration: none;
}
.resource-link:hover { text-decoration: underline; }

.resource-desc {
  width: 100%;
  font-size: 0.78rem;
  color: var(--gray-500);
  line-height: 1.4;
}

/* ZZR Block */
.plan-zzr {
  display: flex;
  gap: 16px;
  align-items: center;
  background: linear-gradient(135deg, rgba(0,61,165,0.12) 0%, rgba(41,128,185,0.08) 100%);
  border: 1px solid rgba(0,61,165,0.2);
  border-radius: var(--radius-md);
  padding: 18px 22px;
}

.plan-zzr-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

.plan-zzr-content {
  flex: 1;
}
.plan-zzr-content h4 {
  font-size: 0.9rem;
  color: var(--white);
  margin-bottom: 4px;
}
.plan-zzr-content p {
  font-size: 0.82rem;
  color: var(--gray-400);
  line-height: 1.5;
  margin-bottom: 10px;
}

/* Narjiss Block in Plan */
.plan-narjiss {
  display: flex;
  gap: 14px;
  background: rgba(201,168,76,0.06);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: var(--radius-md);
  padding: 16px 20px;
}

.plan-narjiss-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid rgba(201,168,76,0.3);
}
.plan-narjiss-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.plan-narjiss-content {
  flex: 1;
}
.plan-narjiss-name {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.plan-narjiss-content p {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.78);
  line-height: 1.55;
}
.plan-narjiss-darija {
  font-family: var(--font-arabic) !important;
  direction: rtl;
  color: var(--gold) !important;
  font-size: 0.84rem !important;
  margin-top: 8px;
}

/* Plan Actions */
.plan-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}


/* ═══════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   ═══════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 900px) {
  .hero-main {
    flex-direction: column;
    text-align: center;
    padding-top: 20px;
  }

  .hero-text { order: 2; }
  .hero-avatar-col { order: 1; }

  .hero-avatar-col img {
    height: clamp(200px, 35vh, 320px);
  }

  .hero-subtitle { max-width: 100%; }

  .hero-cta {
    align-items: center;
  }

  .hero-promises {
    grid-template-columns: 1fr 1fr;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Mobile */
@media (max-width: 600px) {
  :root {
    --container-px: 16px;
  }

  .hero-logo-bar img { height: 110px; }

  .hero-main { padding-top: 10px; gap: 16px; }

  .hero-text h1 { font-size: 1.7rem; }

  .hero-avatar-col img {
    height: clamp(180px, 30vh, 260px);
  }

  .hero-promises {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .promise-card { padding: 12px; }
  .promise-icon { width: 30px; height: 30px; margin-bottom: 8px; }
  .promise-icon svg { width: 18px; height: 18px; }
  .promise-card h3 { font-size: 0.76rem; }
  .promise-card p { font-size: 0.68rem; }

  .hero-cta .btn-primary {
    width: 100%;
    font-size: 0.95rem;
    padding: 14px 32px;
  }

  .trust-banner { padding: 12px 16px 16px; }
  .trust-inner img { height: 22px; }

  /* Chat mobile */
  .message { max-width: 92%; }
  .options-container { max-width: 92%; margin-left: 0; }
  .multiselect-container { max-width: 92%; margin-left: 0; }

  .chat-header-logos { display: none; }

  .emergency-btn { font-size: 0.72rem; padding: 6px 10px; }
  .darija-toggle { padding: 6px 12px; font-size: 0.8rem; }

  .plan-level { flex-direction: column; gap: 10px; }
  .plan-level-badge { width: 32px; height: 32px; font-size: 0.72rem; }

  .plan-zzr { flex-direction: column; text-align: center; }
  .plan-narjiss { flex-direction: column; }
}

/* Very small */
@media (max-width: 380px) {
  .hero-promises { grid-template-columns: 1fr; }
  .hero-text h1 { font-size: 1.5rem; }
}
