/* ============================================
   HADRA.TN — Template HTML/CSS/JS
   Design System: Dynamique & Coloré
   Palette: Navy #1E3A8A | Orange #F59E0B | Or #FBBF24
   ============================================ */

:root {
  --primary: #1E3A8A;
  --primary-dark: #0F1E4D;
  --primary-light: #3B5BDB;
  --secondary: #F59E0B;
  --secondary-dark: #D97706;
  --gold: #FBBF24;
  --dark: #0F172A;
  --gray-900: #1F2937;
  --gray-700: #374151;
  --gray-500: #6B7280;
  --gray-300: #D1D5DB;
  --gray-100: #F3F4F6;
  --gray-50: #FAFAFB;
  --white: #FFFFFF;
  --success: #10B981;

  --gradient-hero: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 60%, var(--secondary) 130%);
  --gradient-cta: linear-gradient(135deg, var(--secondary) 0%, var(--gold) 100%);
  --gradient-soft: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 100%);

  --shadow-sm: 0 2px 4px rgba(15,23,42,0.06);
  --shadow-md: 0 6px 18px rgba(15,23,42,0.08);
  --shadow-lg: 0 16px 40px rgba(15,23,42,0.12);
  --shadow-xl: 0 24px 60px rgba(30,58,138,0.18);
  --shadow-glow: 0 8px 30px rgba(245,158,11,0.35);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --radius-full: 999px;

  --transition: all .3s cubic-bezier(.4,0,.2,1);
  --transition-slow: all .6s cubic-bezier(.4,0,.2,1);

  --font-heading: 'Poppins', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --container: 1240px;
  --nav-h: 80px;
}

/* ===== RESET ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--gray-900);
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--dark);
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.75rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); }
p  { color: var(--gray-700); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1.5rem; }

/* RTL */
html[dir="rtl"] body { font-family: 'Tajawal', var(--font-body); text-align: right; }
html[dir="rtl"] .nav-menu { flex-direction: row-reverse; }

/* ===== TOP BAR ===== */
.top-bar {
  background: var(--dark);
  color: var(--white);
  padding: .55rem 0;
  font-size: .85rem;
  position: relative;
  z-index: 1001;
}
.top-bar-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.top-info { display: flex; gap: 1.5rem; align-items: center; opacity: .9; }
.top-info a { color: var(--white); transition: var(--transition); }
.top-info a:hover { color: var(--gold); }
.lang-switcher { display: flex; gap: .25rem; align-items: center; }
.lang-switcher button {
  color: var(--white);
  padding: .25rem .55rem;
  border-radius: var(--radius-sm);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .5px;
  transition: var(--transition);
}
.lang-switcher button:hover { background: rgba(255,255,255,.1); color: var(--gold); }
.lang-switcher button.active { background: var(--secondary); color: var(--white); }

/* ===== NAVBAR ===== */
.navbar {
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--transition);
}
.navbar.scrolled { box-shadow: var(--shadow-md); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; height: var(--nav-h); }
.nav-logo img { height: 78px; width: auto; }
.nav-menu { display: flex; align-items: center; gap: 2.25rem; }
.nav-menu > li { position: relative; }
.nav-menu > li > a {
  font-weight: 600;
  font-size: .95rem;
  color: var(--gray-900);
  padding: .5rem 0;
  position: relative;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
.nav-menu > li > a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 3px;
  background: var(--gradient-cta);
  border-radius: 3px;
  transition: var(--transition);
}
.nav-menu > li > a:hover { color: var(--primary); }
.nav-menu > li > a:hover::after,
.nav-menu > li > a.active::after { width: 100%; }
.nav-menu > li > a.active { color: var(--primary); }

.dropdown-menu {
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%) translateY(10px);
  min-width: 260px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: .65rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  border-top: 3px solid var(--secondary);
}
.dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.dropdown-menu a {
  display: block;
  padding: .7rem 1rem;
  color: var(--gray-900);
  font-size: .9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.dropdown-menu a:hover { background: var(--gray-100); color: var(--primary); padding-left: 1.4rem; }

.nav-cta {
  background: var(--gradient-cta);
  color: var(--white) !important;
  padding: .7rem 1.4rem !important;
  border-radius: var(--radius-full);
  font-weight: 600;
  box-shadow: var(--shadow-glow);
  transition: var(--transition);
}
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(245,158,11,.5); }
.nav-cta::after { display: none; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.nav-toggle span { width: 26px; height: 3px; background: var(--primary); border-radius: 3px; transition: var(--transition); }
.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(6px,6px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(6px,-6px); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .9rem 1.8rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .3px;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary { background: var(--gradient-cta); color: var(--white); box-shadow: var(--shadow-glow); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(245,158,11,.45); }
.btn-outline { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,.4); }
.btn-outline:hover { background: var(--white); color: var(--primary); border-color: var(--white); }
.btn-dark { background: var(--primary); color: var(--white); }
.btn-dark:hover { background: var(--primary-dark); transform: translateY(-3px); box-shadow: var(--shadow-xl); }
.btn-arrow::after { content: '→'; transition: var(--transition); font-size: 1.2em; }
.btn-arrow:hover::after { transform: translateX(5px); }

/* ===== SECTIONS ===== */
section { padding: 6rem 0; position: relative; }
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(245,158,11,.12);
  color: var(--secondary-dark);
  padding: .45rem 1.1rem;
  border-radius: var(--radius-full);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.section-tag::before { content: '◆'; color: var(--secondary); }
.section-head { text-align: center; max-width: 760px; margin: 0 auto 4rem; }
.section-head p { font-size: 1.1rem; color: var(--gray-500); margin-top: 1rem; }
.section-dark { background: var(--dark); color: var(--white); }
.section-dark h1, .section-dark h2, .section-dark h3 { color: var(--white); }
.section-dark p { color: rgba(255,255,255,.75); }
.section-soft { background: var(--gradient-soft); }

/* ===== FOOTER ===== */
.footer {
  background: var(--dark);
  color: rgba(255,255,255,.75);
  padding: 5rem 0 0;
  position: relative;
  overflow: hidden;
}
.footer::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(245,158,11,.15), transparent 70%);
  border-radius: 50%;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 3rem;
  position: relative;
}
.footer h4 { color: var(--white); font-size: 1.05rem; margin-bottom: 1.25rem; font-weight: 700; }
.footer-brand img { height: 96px; width: auto; margin-bottom: 1rem; }
.footer-brand p { font-size: .9rem; line-height: 1.7; }
.footer-links a { display: block; padding: .35rem 0; font-size: .9rem; color: rgba(255,255,255,.7); transition: var(--transition); }
.footer-links a:hover { color: var(--gold); padding-left: 6px; }
.footer-contact li { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: .9rem; font-size: .9rem; }
.footer-contact .icon { color: var(--secondary); flex-shrink: 0; margin-top: 2px; }
.footer-contact .icon svg {
  width: 18px;
  height: 18px;
}
.icon-svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.footer-bottom {
  margin-top: 4rem;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .85rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-bottom .rights-line {
  width: 100%;
  text-align: center;
}
.footer-bottom .dev-link {
  color: var(--gold);
  font-weight: 600;
}
.footer-bottom .dev-link:hover {
  color: var(--secondary);
  text-decoration: underline;
}
.socials { display: flex; gap: .75rem; }
.socials a {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
  transition: var(--transition);
}
.socials a:hover { background: var(--secondary); transform: translateY(-3px); }

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  background: linear-gradient(135deg, #FF9F0A 0%, #FFB300 100%);
  border-radius: 10px;
  box-shadow: 0 10px 22px rgba(255, 159, 10, .35);
  z-index: 1100;
  transition: transform .25s ease, opacity .25s ease;
  animation: backToTopFloat 1.6s ease-in-out infinite;
}
.back-to-top:hover {
  transform: translateY(-4px) scale(1.06);
}
.back-to-top svg {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .15));
}
.back-to-top svg path {
  fill: none;
  stroke: #FFFFFF;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(245,158,11,.5); } 50% { box-shadow: 0 0 0 18px rgba(245,158,11,0); } }
@keyframes spinSlow { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes backToTopFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.reveal { opacity: 0; transform: translateY(30px); transition: opacity .8s ease, transform .8s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
}
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    padding: 1.5rem;
    gap: .25rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(-150%);
    transition: var(--transition);
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
  }
  .nav-menu.active { transform: translateY(0); }
  .nav-menu > li > a { padding: 1rem; border-bottom: 1px solid var(--gray-100); }
  .nav-menu > li > a::after { display: none; }
  .dropdown-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; padding: 0 0 0 1rem; border-top: none; }
  .nav-cta { margin-top: .5rem; justify-content: center; }
  section { padding: 4rem 0; }
  .top-info { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .btn { padding: .8rem 1.4rem; font-size: .9rem; }
  .nav-logo img { height: 60px; }
  .back-to-top { right: 1rem; bottom: 1rem; }
  .back-to-top { width: 36px; height: 36px; border-radius: 9px; }
  .back-to-top svg { width: 20px; height: 20px; }
}
