/* CSS Variables */
:root {
  --primary: hsl(239, 48%, 30%);
  --white: #FFFFFF;
  --light-bg: #f8f9fa;
  --text-dark: #333333;
  --text-medium: #555555;
  --text-light: #777777;
  --border-light: #eaeaea;
  --button-hover: #1e1f5a;
  --primary-light: rgba(40, 41, 115, 0.1);
  --primary-lighter: rgba(40, 41, 115, 0.05);

  /*  Font Sizes - Better hierarchy */
  --big-title: 3.5rem;
  --second-title: 1.75rem;
  --third-title: 1.375rem;
  --normal-text: 1.125rem;
  --smaller-text: 1rem;
  --smallest-text: 0.875rem;

  /* Line heights for better readability */
  --line-tight: 1.2;
  --line-normal: 1.6;
  --line-loose: 1.8;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

img,
picture {
  max-width: 100%;
  display: block;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -5rem;
  left: 1rem;
  background: var(--primary);
  color: var(--white);
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 10000;
  transition: top 0.3s;
  font-size: var(--smaller-text);
}

.skip-link:focus {
  top: 1rem;
}

body {
  max-width: 100%;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: var(--normal-text);
  line-height: var(--line-normal);
  letter-spacing: 1.25px;
  color: var(--text-dark);
  background-color: var(--light-bg);
  overflow-x: hidden;
}

/*  Typography Classes */
.big-title {
  font-size: var(--big-title);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.5rem;
  line-height: var(--line-tight);
  letter-spacing: -0.02em;

}

.second-title {
  font-size: var(--second-title);
  font-weight: 500;
  color: var(--text-medium);
  margin-bottom: 1.5rem;
  line-height: var(--line-tight);
}

.third-title {
  font-size: var(--third-title);
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.75rem;
  line-height: var(--line-tight);
}

.normal-text {
  font-size: var(--normal-text);
  color: var(--text-medium);
  margin-bottom: 1.5rem;
  line-height: var(--line-normal);
}

.smaller-text {
  font-size: var(--smaller-text);
  color: var(--text-light);
  margin-bottom: 0.75rem;
  line-height: var(--line-normal);
}

.smallest-text {
  font-size: var(--smallest-text);
  color: var(--text-light);
  line-height: var(--line-normal);
}

.container {
  max-width: 80em;
  margin-inline: auto;
  padding-inline: clamp(1rem, 5vw, 3rem);
}

.flow-10 {
  margin-bottom: calc(.26rem*8);
}

.pl-8 {
  padding-left: calc(.26rem*8);
}

.mr-2 {

  margin-bottom: calc(.26rem*2);
}

.mb-2 {

  margin-bottom: calc(.26rem*2);
}

.mb-4 {

  margin-bottom: calc(.26rem*2);
}

.mr-4 {

  margin-bottom: calc(.26rem*4);
}

/* Navigation - Mobile First */
.navbar {
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.nav-container {
  max-width: 80em;
  margin: 0 auto;
  padding: 0 clamp(1rem, 5vw, 4rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

/* Logo */
.nav-brand img {
  max-width: 100%;
  width: 6rem;
}



/* Mobile Toggle Button */
.nav-toggle {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  width: 30px;
  height: 25px;

}

.hamburger {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
  margin: 3px 0;
  transition: all 0.3s ease;
  transform-origin: center;
}

.nav-toggle[aria-expanded="false"] .hamburger:nth-child(1) {
  top: 5px;
}

.nav-toggle[aria-expanded="false"] .hamburger:nth-child(2) {
  top: 10px;
}

.nav-toggle[aria-expanded="false"] .hamburger:nth-child(3) {
  top: 15px;
}

.nav-toggle[aria-expanded="true"] .hamburger:nth-child(1) {
  transform: rotate(45deg);
  top: 10px;
}

.nav-toggle[aria-expanded="true"] .hamburger:nth-child(2) {
  transform: translateY(-100%);
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .hamburger:nth-child(3) {
  transform: rotate(-45deg);
  top: 10px;
}

/* Navigation Menu - Mobile */
.nav-menu {
  position: fixed;
  top: 80px;
  left: 0;
  width: 100%;
  height: calc(100vh - 80px);
  background: var(--white);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  z-index: 999;
  padding: 1rem 0;
}

.nav-menu[aria-hidden="false"] {
  transform: translateX(0);
}

.nav-list {
  list-style: none;
  width: 100%;
}

.nav-item {
  width: 100%;
  border-bottom: 1px solid var(--border-light);
}

.mega-toggle {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  border: none;
  background: none;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-dark);
  text-decoration: none;
  padding: 1rem 1.5rem;
  font-weight: 500;
  transition: all 0.3s ease;
  width: 100%;
}


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

/* Dropdown Arrow for Mobile */
.dropdown-arrow {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--text-dark);
  transition: transform 0.3s ease;
}

.nav-link[aria-expanded="true"] .dropdown-arrow,
.mega-toggle:hover .dropdown-arrow {
  transform: rotate(180deg);
}

/* Mega Menu - Mobile */
.mega-menu {
  background: var(--light-bg);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mega-menu[aria-hidden="false"] {
  max-height: 500px;
}

.mega-menu-list {
  list-style: none;
  padding: 0.5rem 0;
}

.mega-menu-item {
  width: 100%;
}

.mega-menu-link {
  display: block;
  color: var(--text-medium);
  text-decoration: none;
  padding: 0.75rem 2.5rem;
  transition: all 0.3s ease;
  font-weight: 400;
}

.mega-menu-link:hover,
.mega-menu-link:focus {
  background-color: var(--white);
  color: var(--primary);
  padding-left: 3rem;
}

/* Desktop Styles */
@media (min-width: 769px) {
  .nav-toggle {
    display: none;
  }

  .nav-menu {
    position: static;
    width: auto;
    height: auto;
    transform: none;
    background: transparent;
    padding: 0;
    overflow: visible;
  }

  .nav-menu[aria-hidden] {
    transform: none;
  }

  .nav-list {
    display: flex;
    align-items: center;
    gap: 1.5rem;
  }

  .nav-item {
    width: auto;
    border-bottom: none;
    position: relative;
  }

  .nav-link {
    padding: 0.5rem 1rem;
    border-radius: 5px;
    justify-content: center;
    width: auto;
  }

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

  /* Hide dropdown arrow on desktop */
  .dropdown-arrow {
    margin-left: 10px;
  }

  /* Mega Menu - Desktop */
  .mega-menu {
    position: absolute;
    top: 61px;
    left: 0;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow-large);
    min-width: 500px;
    max-height: none;
    overflow: visible;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    padding: 1.5rem;
  }

  .mega-menu[aria-hidden] {
    max-height: none;
  }

  .mega-menu-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 0;
  }

  .mega-menu-item {
    width: 100%;
  }

  .mega-menu-link {
    padding: 0.75rem 1rem;
    border-radius: 4px;
  }

  .mega-menu-link:hover,
  .mega-menu-link:focus {
    padding-left: 1.25rem;
  }

  /* Show mega menu on hover */
  .mega-menu-parent:hover .mega-menu,
  .mega-menu-parent:focus-within .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

/*  Hero Section */
.hero-section {
  background-image: url(/media/img/hero-img.jpg);
  background-position: top;
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: hsla(239, 48%, 30%, .75);
}

.index-hero {
  background-image: url(/media/img/hero-img.jpg);
  height: 100vh;
}

.price-hero {
  background-image: url(/media/img/hero-img-1.png);
  height: 50vh;
}

.hero-section .container {
  position: relative;
  z-index: 1;
}

.hero-section .big-title {
  color: var(--white);
  font-size: 4.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-section .second-title {
  color: rgba(255, 255, 255, 0.9);
  font-size: 2rem;
  margin-bottom: 2rem;
  font-weight: 500;
}

.hero-section .normal-text {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.375rem;
  margin-bottom: 3rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  line-height: var(--line-loose);
}

.cta-button {
  display: inline-block;
  background: var(--white);
  color: var(--primary);
  padding: 1.25rem 2.5rem;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 700;
  transition: all 0.3s ease;
  font-size: var(--normal-text);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border: 2px solid transparent;
}

.cta-button:hover {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/*  About Section */
.about-section {
  padding: 5rem 0 3rem;
  background: var(--white);
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: center;

}

.about-img {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;

}

.about-img img {
  max-height: 650px;
  padding: 1rem;
  border-radius: 2rem;
}

/* price-section */
.price-section {
  padding: 5rem 0 3rem;
  background: var(--white);
}

@media (min-width:45em) {

  .price-section .normal-text {
    max-width: 80%;
  }
}

/*  Services Section */
.services-section {
  padding: 6rem 0;
  background: var(--light-bg);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
  margin-top: 4rem;
}

.services-grid>*[aria-selected="true"] {
  order: 7;
}

.service-card {
  padding: 3rem 0;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border-top: 4px solid var(--primary);
  text-align: center;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  position: relative;
  cursor: pointer;
}

.service-card::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: hsla(0, 0%, 0%, .55);
  border-radius: 12px;
  z-index: 0;
}

.service-card.penal-img {
  background-image: url(/media/img/droit-penal-sm.png);
}

.service-card.civil-img {
  background-image: url(/media/img/droit-civil-sm.png);
}

.service-card.public-img {
  background-image: url(/media/img/droit-public-sm.png);
}

.service-card.etranger-img {
  background-image: url(/media/img/droit-etranger-sm.png);
}

.service-card.famille-img {
  background-image: url(/media/img/droit-famille-sm.png);
}

.service-card.mineur-img {
  background-image: url(/media/img/droit-mineur-sm.png);
}

.service-card.commerce-img {
  background-image: url(/media/img/droit-commercial-sm.png);
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

.service-card .third-title {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--white);
  position: relative;
  z-index: 1
}

.service-list[aria-hidden="true"] {
  width: 100%;
  height: 0px;
  opacity: 0;
  transition: all .5s;
  overflow-x: hidden;
  position: relative;

}

.service-list[aria-hidden="false"] {
  height: 100%;
  opacity: 1;
  padding-top: 2rem;
}

.service-list[aria-hidden="false"] div.active {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
}


/* valeur Section */
.valeur-section {
  padding: 8rem 0;
  background: var(--white);
}

.valeur-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
  margin-top: 4rem;
}

.valeur-item {
  background: var(--light-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}


.valeur-placeholder {
  padding: 4rem clamp(1rem, 2vw, 2rem);
  background: linear-gradient(135deg, var(--primary) 0%, var(--button-hover) 100%);
  color: var(--white);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

.valeur-placeholder .third-title {
  color: var(--white);
  text-transform: capitalize;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.valeur-placeholder .normal-text {
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--normal-text);
}

/*  Contact Section */
.contact-section {
  padding: 6rem 0 3rem;
  background: var(--light-bg);
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  margin-top: 4rem;
}

.contact-info {
  display: flex;
  gap: clamp(1rem, 2.5vw, 1.5rem);
  flex-direction: column;
}

.contact-item {
  display: flex;
  gap: 1rem;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding: 1.5rem 2rem;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.contact-item .contact-item-icon {
  width: 3rem;
  aspect-ratio: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--light-bg);
  border-radius: 12px;
}

.contact-item .contact-item-icon svg {
  width: calc(.26rem * 5);
  color: var(--primary);

}

.contact-item .third-title {
  font-size: 1rem;
  margin-bottom: .25rem;
}

.contact-item .normal-text {
  margin-bottom: auto;
}

.contact-form {
  display: flex;
  gap: 1rem;
  flex-direction: column;
}

.form-group {
  margin-bottom: 0;
}

.form-label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
  color: var(--text-dark);
  font-size: var(--smaller-text);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 1.25rem;
  border: 2px solid var(--border-light);
  border-radius: 8px;
  font-size: var(--normal-text);
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.submit-button {
  background: var(--primary);
  color: var(--white);
  padding: 1.25rem 2.5rem;
  border: none;
  border-radius: 8px;
  font-size: var(--normal-text);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(40, 41, 115, 0.3);
}

.submit-button:hover {
  background: var(--button-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(40, 41, 115, 0.4);
}

/*  Footer */
.footer {
  background: var(--text-dark);
  color: var(--white);
  padding: 5rem 0 2rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-section h3 {
  color: var(--white);
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.footer-section h4 {
  color: var(--white);
  margin-bottom: 1.5rem;
  font-size: var(--second-title);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.3s ease;
  font-size: var(--smaller-text);
}

.footer-links a:hover {
  color: var(--white);
  padding-left: 5px;
}

.footer-section .smaller-text {
  color: rgba(255, 255, 255, 0.8);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  text-align: center;
}

.footer-bottom .smaller-text {
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--smallest-text);
}

.footer-icon-ctn {
  display: flex;
  gap: 1rem;
  justify-content: flex-start;
}

.footer-icon-ctn a svg {
  width: 1.5rem;
  color: var(--white);
  transition: .3s;
}

.footer-icon-ctn a svg:hover {
  width: 1.6rem;
  transform: translateY(3px);
}

/* Responsive design */
@media (max-width: 1024px) {
  :root {
    --big-title: 3rem;
    --second-title: 1.5rem;
    --third-title: 1.25rem;
  }

  .hero-section .big-title {
    font-size: 3.5rem;
  }

  .hero-section .second-title {
    font-size: 1.75rem;
  }
}

@media (max-width: 968px) {
  :root {
    --big-title: 2.5rem;
    --second-title: 1.375rem;
    --third-title: 1.125rem;
    --normal-text: 1rem;
  }

  /* Mobile responsive sections */
  .hero-section {
    padding: 6rem 0;
  }

  .hero-section .big-title {
    font-size: 2.5rem;
  }

  .hero-section .second-title {
    font-size: 1.5rem;
  }

  .hero-section .normal-text {
    font-size: 1.125rem;
  }

  .about-content {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .about-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .valeur-grid {
    grid-template-columns: 1fr;
  }

  .contact-content {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }



  .hero-section,
  .about-section,
  .price-section,
  .services-section,
  .valeur-section,
  .contact-section {
    padding: 6rem 0;
  }

  .footer-icon-ctn {

    justify-content: center;
  }
}

@media (max-width: 480px) {
  :root {
    --big-title: 2rem;
    --second-title: 1.25rem;
  }

  .hero-section .big-title {
    font-size: 2rem;
  }

  .hero-section .second-title {
    font-size: 1.25rem;
  }

  .about-stats {
    grid-template-columns: 1fr;
  }

  .stat-item .third-title {
    font-size: 2.5rem;
  }

  .hero-section,
  .about-section,
  .price-section,
  .services-section,
  .valeur-section,
  .contact-section {
    padding: 4rem 0;
  }

  .footer-icon-ctn {

    justify-content: center;
  }

}



/* Enhanced focus styles for accessibility */
.nav-link:focus,
.nav-toggle:focus,
.cta-button:focus,
.submit-button:focus {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(40, 41, 115, 0.3);
}

.mega-menu-list a:focus,
.form-input:focus,
.form-textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px rgba(40, 41, 115, 0.3);
}

/* cookies */
#cookies {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #f9fafb;
  color: white;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  z-index: 50;
  text-align: center;
}

.cookie-text {
  font-size: 0.875rem;
  color: #374151;
}

.cookie-link {
  text-decoration: underline;
  color: #3b82f6;
}

.button-container {
  display: flex;
  gap: 0.5rem;
  padding-top: 1.5rem;
}

.btn-accept,
.btn-refuse {
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-accept {
  background-color: #16a34a;
}

.btn-accept:hover {
  background-color: #3b82f6;
}

.btn-refuse {
  background-color: #b91c1c;
}

.btn-refuse:hover {
  background-color: #dc2626;
}

/* Responsive design for medium screens and up */
@media (min-width: 768px) {
  .cookie-text {
    margin-bottom: 0;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --primary: #000080;
    --text-dark: #000000;
    --text-medium: #000000;
  }

  .nav-link:focus,
  .nav-toggle:focus,
  .cta-button:focus,
  .submit-button:focus {
    outline: 3px solid #000000;
    outline-offset: 2px;
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Animation for page load */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

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

/* Performance optimizations */
.hero-section,
.about-section,
.price-section,
.services-section,
.valeur-section,
.contact-section {
  animation: fadeInUp 0.6s ease-out;
  will-change: transform, opacity;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

  .hero-section,
  .about-section,
  .price-section,
  .services-section,
  .valeur-section,
  .contact-section {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }

  .nav-link,
  .cta-button,
  .submit-button,
  .service-card,
  .valeur-item,
  .stat-item,
  .contact-item {
    transition: none;
  }
}

/* Loading states */
.loading {
  opacity: 0.7;
  pointer-events: none;
}