/* ═══════════════════════════════════════════════════════════
   MAALEM — Site vitrine
   Identité : Billet 200 DH + zellige + esprit Safi
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Inter:wght@300;400;500;600;700;800&family=Amiri:wght@400;700&display=swap');

:root {
  /* Palette officielle Maalem (depuis SplashScreen.tsx) */
  --green: #1B6B3A;
  --green-light: #2D8A4E;
  --green-dark: #124D2B;
  --gold: #C5973A;
  --gold-light: #E0B55A;
  --gold-soft: rgba(197, 151, 58, 0.15);
  --ivory: #F5F0E8;
  --ivory-dark: #E8E0CC;
  --white: #FFFFFF;
  --text: #1A3A2A;
  --text-soft: #6A7A6A;
  --brown: #7A4A10;
  --brown-dark: #3D1F06;

  /* Typo */
  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-arabic: 'Amiri', 'Noto Sans Arabic', 'Tahoma', serif;

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(26, 58, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(26, 58, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(26, 58, 42, 0.12);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--ivory);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Arabic text — utilise Amiri quand le body est en arabe */
body[data-lang="ar"] main,
body[data-lang="ar"] footer {
  font-family: var(--font-arabic);
}

/* ─── HEADER (toujours LTR, même en arabe) ──────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(245, 240, 232, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ivory-dark);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  direction: ltr;  /* IMPORTANT : header toujours LTR */
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
}

.logo-svg {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 1px;
  color: var(--green);
}

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

.nav a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.3px;
  transition: color 0.2s;
  position: relative;
}

.nav a:hover { color: var(--green); }

.nav a.cta {
  background: var(--green);
  color: var(--white);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  transition: all 0.3s;
}

.nav a.cta:hover {
  background: var(--green-dark);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Lang switcher */
.lang-switch {
  display: flex;
  background: var(--ivory-dark);
  padding: 3px;
  border-radius: 999px;
  border: 1px solid rgba(197, 151, 58, 0.3);
}

.lang-btn {
  background: transparent;
  border: none;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}

.lang-btn.active {
  background: var(--green);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

/* Mobile menu */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: all 0.3s;
}

/* ─── HERO ─────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 90vh;
  background: var(--green);
  color: var(--ivory);
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 80px 32px;
}

/* Zellige top decoration */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    var(--gold) 0,
    var(--gold) 24px,
    transparent 24px,
    transparent 48px
  );
  opacity: 0.7;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    var(--gold) 0,
    var(--gold) 24px,
    transparent 24px,
    transparent 48px
  );
  opacity: 0.7;
}

/* Diagonales décoratives style billet */
.hero-deco-1, .hero-deco-2 {
  position: absolute;
  width: 250px;
  height: 500px;
  background: rgba(197, 151, 58, 0.06);
  pointer-events: none;
}

.hero-deco-1 {
  top: -120px;
  left: -80px;
  transform: rotate(25deg);
}

.hero-deco-2 {
  bottom: -120px;
  right: -80px;
  transform: rotate(25deg);
}

/* Ligne or horizontale */
.hero-goldline {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gold);
  opacity: 0.25;
  transform: scaleX(0);
  animation: lineGrow 0.8s ease-out 0.3s forwards;
  transform-origin: left;
}

@keyframes lineGrow {
  to { transform: scaleX(1); }
}

/* Outils flottants */
.floating-tool {
  position: absolute;
  font-size: 28px;
  opacity: 0.18;
  pointer-events: none;
  animation: floatTool 4s ease-in-out infinite;
}

@keyframes floatTool {
  0%, 100% { transform: translateY(0) rotate(-8deg); opacity: 0.15; }
  50% { transform: translateY(-16px) rotate(8deg); opacity: 0.28; }
}

.hero-container {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

/* Logo encadré */
.hero-logo {
  width: 130px;
  height: 130px;
  margin: 0 auto 32px;
  border: 2px solid var(--gold);
  border-radius: 28px;
  padding: 6px;
  background: rgba(197, 151, 58, 0.15);
  opacity: 0;
  transform: scale(0.85);
  animation: heroLogo 0.8s ease-out 0.2s forwards;
}

.hero-logo-inner {
  width: 100%;
  height: 100%;
  border-radius: 22px;
  overflow: hidden;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-logo-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes heroLogo {
  to { opacity: 1; transform: scale(1); }
}

/* Nom de l'app */
.hero-name-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 4px;
  opacity: 0;
  transform: translateY(12px);
  animation: heroText 0.6s ease-out 0.5s forwards;
}

.hero-name-line .side {
  height: 1px;
  background: var(--gold);
  opacity: 0.5;
  width: 50px;
}

.hero-name-ar {
  font-family: var(--font-arabic);
  font-size: 44px;
  font-weight: 800;
  color: var(--ivory);
  letter-spacing: 3px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.hero-name-latin {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 8px;
  margin-bottom: 24px;
  opacity: 0;
  animation: heroText 0.6s ease-out 0.6s forwards;
}

@keyframes heroText {
  to { opacity: 1; transform: translateY(0); }
}

.hero-tagline {
  font-family: var(--font-display);
  font-size: 24px;
  font-style: italic;
  color: rgba(245, 240, 232, 0.85);
  line-height: 1.4;
  margin-bottom: 28px;
  opacity: 0;
  animation: heroText 0.6s ease-out 0.8s forwards;
}

/* Pills */
.hero-pills {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 40px;
  opacity: 0;
  animation: heroText 0.6s ease-out 1s forwards;
}

.pill {
  border: 1px solid rgba(197, 151, 58, 0.4);
  background: rgba(197, 151, 58, 0.1);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--gold-light);
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Bouton CTA */
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--gold);
  color: var(--green-dark);
  padding: 16px 32px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: all 0.3s;
  box-shadow: 0 8px 24px rgba(197, 151, 58, 0.3);
  opacity: 0;
  animation: heroText 0.6s ease-out 1.2s forwards;
}

.hero-cta:hover {
  background: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(197, 151, 58, 0.4);
}

.hero-cta-icon {
  width: 22px;
  height: 22px;
}

/* ─── SECTIONS ──────────────────────────────────────── */
.section {
  padding: 100px 32px;
  position: relative;
}

.section-container {
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 600;
  text-align: center;
  color: var(--green-dark);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-soft);
  font-size: 17px;
  max-width: 600px;
  margin: 0 auto 64px;
}

/* Divider style billet — point central */
.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 0 auto 48px;
  color: var(--gold);
}

.section-divider .line {
  height: 1px;
  width: 60px;
  background: linear-gradient(to right, transparent, var(--gold));
}

.section-divider .line:last-child {
  background: linear-gradient(to left, transparent, var(--gold));
}

.section-divider .star {
  font-size: 14px;
}

/* Cards grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  margin-top: 48px;
}

.card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 36px 28px;
  border: 1px solid var(--ivory-dark);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--gold));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold);
}

.card:hover::before {
  transform: scaleX(1);
}

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: linear-gradient(135deg, var(--green), var(--green-light));
  color: var(--white);
  margin-bottom: 20px;
}

.card-icon.gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
}

.card h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.card p {
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.6;
}

/* Coming Soon section */
.coming-soon {
  background: linear-gradient(135deg, var(--ivory) 0%, var(--ivory-dark) 100%);
  border-radius: var(--radius-lg);
  padding: 64px 40px;
  text-align: center;
  margin: 60px auto;
  max-width: 900px;
  border: 1px dashed var(--gold);
  position: relative;
}

.coming-soon::before {
  content: '✦';
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ivory);
  color: var(--gold);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border: 1px solid var(--gold);
}

.coming-soon-badge {
  display: inline-block;
  background: var(--gold-soft);
  color: var(--brown);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.coming-soon h2 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 12px;
}

.coming-soon p {
  color: var(--text-soft);
  font-size: 16px;
  max-width: 500px;
  margin: 0 auto;
}

/* CTA Final */
.cta-section {
  background: var(--green-dark);
  color: var(--ivory);
  padding: 100px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section::before,
.cta-section::after {
  content: '';
  position: absolute;
  height: 6px;
  left: 0;
  right: 0;
  background: repeating-linear-gradient(
    90deg,
    var(--gold) 0,
    var(--gold) 24px,
    transparent 24px,
    transparent 48px
  );
  opacity: 0.6;
}

.cta-section::before { top: 0; }
.cta-section::after { bottom: 0; }

.cta-section h2 {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--ivory);
}

.cta-section p {
  font-size: 17px;
  opacity: 0.8;
  margin-bottom: 36px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.store-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--ivory);
  color: var(--green-dark);
  padding: 14px 28px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s;
  border: 1px solid var(--gold);
}

.store-btn:hover {
  background: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.store-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.store-btn-icon {
  font-size: 28px;
}

.store-btn-text small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.7;
  letter-spacing: 0.3px;
}

.store-btn-text strong {
  font-size: 16px;
  font-weight: 700;
}

/* ─── FOOTER (toujours LTR) ─────────────────────────── */
.footer {
  background: var(--brown-dark);
  color: rgba(245, 240, 232, 0.7);
  padding: 60px 32px 30px;
  direction: ltr;  /* Footer toujours LTR */
}

.footer-container {
  max-width: 1100px;
  margin: 0 auto;
}

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

.footer-brand {
  max-width: 320px;
}

.footer-brand .logo-text {
  color: var(--gold);
}

.footer-brand p {
  font-size: 14px;
  line-height: 1.6;
  margin-top: 16px;
  color: rgba(245, 240, 232, 0.6);
}

.footer-col h4 {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 17px;
  margin-bottom: 16px;
  font-weight: 600;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 8px;
}

.footer-col a {
  color: rgba(245, 240, 232, 0.65);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--gold-light); }

.footer-bottom {
  padding-top: 28px;
  border-top: 1px solid rgba(245, 240, 232, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: rgba(245, 240, 232, 0.5);
  flex-wrap: wrap;
  gap: 12px;
}

/* ─── PAGES INTERNES (privacy, etc.) ────────────────── */
.page-header {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-light) 100%);
  color: var(--ivory);
  padding: 80px 32px 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before,
.page-header::after {
  content: '';
  position: absolute;
  height: 6px;
  left: 0;
  right: 0;
  background: repeating-linear-gradient(
    90deg, var(--gold) 0, var(--gold) 24px,
    transparent 24px, transparent 48px
  );
  opacity: 0.7;
}

.page-header::before { top: 0; }
.page-header::after { bottom: 0; }

.page-header h1 {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 600;
  margin-bottom: 12px;
}

.page-header .subtitle {
  font-size: 16px;
  opacity: 0.85;
}

.content-card {
  background: var(--white);
  max-width: 900px;
  margin: -60px auto 80px;
  padding: 56px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 2;
}

.content-card h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--green-dark);
  margin-top: 40px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ivory-dark);
}

.content-card h2:first-of-type { margin-top: 0; }

.content-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 10px;
  color: var(--text);
}

.content-card p {
  margin-bottom: 14px;
  color: var(--text);
}

.content-card ul {
  margin: 0 0 16px 24px;
}

.content-card li {
  margin-bottom: 8px;
  color: var(--text);
}

.content-card a {
  color: var(--green);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--green-light);
}

.content-card a:hover { color: var(--green-dark); }

.content-card strong {
  color: var(--green-dark);
  font-weight: 600;
}

.intro-box {
  background: linear-gradient(135deg, var(--ivory) 0%, var(--white) 100%);
  border-left: 4px solid var(--gold);
  padding: 20px 24px;
  border-radius: var(--radius-sm);
  margin-bottom: 32px;
}

.intro-box p { margin-bottom: 0; }

.last-update {
  color: var(--text-soft);
  font-size: 13px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px dashed var(--ivory-dark);
  font-style: italic;
}

/* Coming soon page */
.coming-soon-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 32px;
}

.coming-soon-content {
  text-align: center;
  max-width: 600px;
}

.coming-soon-content .icon {
  font-size: 80px;
  margin-bottom: 24px;
  opacity: 0.6;
}

.coming-soon-content h1 {
  font-family: var(--font-display);
  font-size: 42px;
  color: var(--green-dark);
  margin-bottom: 16px;
}

.coming-soon-content p {
  font-size: 17px;
  color: var(--text-soft);
  margin-bottom: 32px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.btn-back:hover { color: var(--green-dark); }

/* ─── RESPONSIVE ────────────────────────────────────── */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .header-container { padding: 16px 20px; }
  .nav { display: none; }
  .nav.open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--ivory);
    flex-direction: column;
    padding: 24px;
    gap: 18px;
    border-bottom: 1px solid var(--ivory-dark);
    box-shadow: var(--shadow-md);
  }
  .menu-toggle { display: block; }

  .hero { padding: 60px 20px; min-height: auto; }
  .hero-name-ar { font-size: 36px; }
  .hero-tagline { font-size: 19px; }
  .hero-logo { width: 100px; height: 100px; }

  .section { padding: 60px 20px; }
  .section-title { font-size: 32px; }
  .cta-section { padding: 60px 20px; }
  .cta-section h2 { font-size: 30px; }

  .page-header { padding: 60px 20px 80px; }
  .page-header h1 { font-size: 32px; }
  .content-card { padding: 32px 24px; margin: -40px 20px 60px; }
  .content-card h2 { font-size: 20px; }

  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
