@import url('./variables.css');

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

/* === HEADER GLOBAL === */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--color-background);
  color: var(--color-secondary-dark);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

/* === CONTENEUR INTERNE === */
header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 256px;
  box-sizing: border-box;
  width: 100%;
}

/* === BLOCS PRINCIPAUX === */
header .container > div {
  display: flex;
  align-items: center;
}

/* === Partie GAUCHE : logo + nav */
header .container > div:first-child {
  flex-grow: 1;
  gap: 64px; /* espace entre logo et nav */
}

/* === Partie DROITE : boutons */
header .container > div:last-child {
  gap: 16px;
}

/* === Logo === */
header a img {
  height: 50px;
  display: block;
}

/* === NAVIGATION === */
header nav ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 32px;
}

header nav li a {
  font-family: var(--font-family);
  font-weight: 400;
  font-size: 16px;
  color: var(--color-secondary-dark);
  text-decoration: none;
}

header nav li a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.auth-btn-container{
  padding-left: 12px;
}

/* === BOUTON : Se connecter === */
.btn-login {
  background-color: var(--color-background);
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  border-radius: 999px;
  padding: 8px 16px;
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
}

.btn-login:hover,
.btn-login:focus {
  background-color: var(--color-primary-light);
  border-color: var(--color-background);
}

/* === BOUTON : S’inscrire === */
.btn-signup {
  background-color: var(--color-primary);
  color: var(--color-background);
  border: 2px solid var(--color-primary);
  border-radius: 999px;
  padding: 8px 16px;
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
}

.btn-signup:hover,
.btn-signup:focus {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
}

/* === HOME SECTION === */
.home-section {
  background-color: var(--color-primary-light);
  padding: 180px 256px 60px 256px;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  z-index: 0;
}

/* === BASE GÉNÉRIQUE POUR TOUS LES PICTOS === */
.falling {
  position: absolute;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 0;
  pointer-events: none;
  transform-origin: center center;
}

/* === PICTO 1 === */
.falling-1 {
  top: 100px;
  right: 60px;
  width: 120px;
  height: 120px;
  background-image: url('/assets/falling-picto-1.png');
  filter: blur(4px);
  opacity: 0.5;
  animation: rotate-slow 90s linear infinite;
  z-index: -10;
}

/* === PICTO 2 === */
.falling-2 {
  bottom: 200px;
  left: 600px;
  width: 120px;
  height: 120px;
  background-image: url('/assets/falling-picto-2.png');
  filter: blur(3px);
  opacity: 0.5;
  animation: rotate-reverse 60s linear infinite;
  z-index: -10;
}

/* === PICTO 3 === */
.falling-3 {
  bottom: 60px;
  left: 128px;
  width: 180px;
  height: 180px;
  background-image: url('/assets/falling-picto-3.png');
  filter: blur(1.5px);
  opacity: 0.5;
  animation: rotate 45s linear infinite;
  z-index: -10;
}

/* === PICTO 4 === */
.falling-4 {
  top: 120px;
  left: 50px;
  width: 120px;
  height: 120px;
  background-image: url('/assets/falling-picto-4.png');
  filter: blur(4px);
  opacity: 0.5;
  animation: rotate-reverse 120s linear infinite;
  z-index: -10;
}

/* === ANIMATION DE ROTATION === */
@keyframes rotate {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes rotate-reverse {
  0%   { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

@keyframes rotate-slow {
  0%   { transform: rotate(0deg) scale(1); }
  100% { transform: rotate(360deg) scale(1); }
}

.home-container {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start; /* important : aligne tout à gauche */
}

.home-text {
  flex: 1;
  max-width: 66%;
  padding-right: 16px;
}

.home-text h1 {
  font-family: var(--font-family);
  font-style: bold;
  font-size: 40px;
  font-weight: 700;
  color: var(--color-secondary-dark);
  margin-top: 0;
  margin-bottom: 32px;

}

.highlight-primary {
  color: var(--color-primary);
}


.home-text p {
  font-family: var(--font-family);
  font-size: 18px;
  color: var(--color-secondary-dark);
  margin-bottom: 32px;
  line-height: 1.6;
}

.home-buttons {
  display: flex;
  gap: 16px;
}

/* === BOUTON SECONDAIRE === */
.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  border-radius: 999px;
  padding: 8px 16px;
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: var(--color-primary);
  color: var(--color-background);
}

/* === IMAGE === */
.home-image {
  flex: 1;
  margin-left: auto; /* pousse le bloc vers la droite */
  max-width: 43%; /* pour garder le ratio si besoin */
}

.home-image img {
  width: 100%;
  max-width: 600px;
  height: auto;
  border-radius: 8px;
}

/* === SECTION SOLUTION === */
.solution-section {
  padding: 128px 256px 0 256px;
  background-color: var(--color-background);
  text-align: center;
}

.solution-section h2 {
  font-family: var(--font-family);
  font-size: 32px;
  font-weight: 700;
  color: var(--color-secondary-dark);
  margin-bottom: 128px;
}

/* === BLOC INDIVIDUEL === */
.solution-item {
  display: flex;
  align-items: flex-start;
  gap: 64px;
  margin: 0 auto 48px auto;
  max-width: 600px;
  margin-bottom: 180px;
}

.solution-item img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  flex-shrink: 0;
}

.solution-item p {
  font-family: var(--font-family);
  font-size: 18px;
  color: var(--color-secondary-dark);
  line-height: 1.6;
  margin: 0;
}

.solution-text {
  text-align: left;
}

.solution-text h3 {
  font-family: var(--font-family);
  font-size: 22px;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0 0 8px 0;
}

.solution-text p {
  font-family: var(--font-family);
  font-size: 16px;
  color: var(--color-secondary-dark);
  line-height: 1.5;
  margin: 0;
}

/* === SECTION PRICING === */
.pricing-section {
  padding: 0 256px;
  background-color: var(--color-background);
  text-align: center;
}

.pricing-section h2 {
  font-family: var(--font-family);
  font-size: 32px;
  font-weight: 700;
  color: var(--color-secondary-dark);
  margin-bottom: 64px;
}

/* === GRILLE DE CARTES === */
.pricing-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 32px;
}

/* === CARTE TARIF === */
.pricing-card {
  background-color: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
  padding: 32px;
  width: 320px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--color-secondary-light);
}

.pricing-card h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-secondary-dark);
  margin-bottom: 12px;
  font-family: var(--font-family);
}

.pricing-card .subtitle {
  font-size: 14px;
  color: var(--color-secondary-dark);
  margin-bottom: 24px;
  font-family: var(--font-family);
}

.price {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 24px;
  font-family: var(--font-family);
}

/* === LISTE FONCTIONNALITÉS === */
.features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
}

.features li {
  font-size: 14px;
  color: var(--color-secondary-dark);
  font-family: var(--font-family);
  margin-bottom: 8px;
  padding-left: 24px;
  position: relative;
}

.features li::before {
  content: "✔";
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-size: 14px;
}

/* === BOUTONS === */
.cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-orange {
  background-color: var(--color-primary);
  font-family: var(--font-family);
  color: var(--color-background);
  text-align: center;
  border-radius: 999px;
  padding: 10px 0;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.btn-orange:hover {
  background-color: var(--color-primary-dark);
}

.btn-link {
  text-align: center;
  color: var(--color-secondary-dark);
  font-family: var(--font-family);
  text-decoration: none;
  font-size: 14px;
}

.btn-link:hover {
  text-decoration: underline;
  color: var(--color-primary);
}


a.disabled,
.btn-orange.disabled,
.btn-secondary.disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
  text-decoration: none;
}

.pricing-custom-offer {
  margin-top: 64px;
  font-family: var(--font-family);
  font-size: 16px;
  color: var(--color-secondary-dark);
  text-align: center;
  margin-bottom: 128px;
}

.pricing-custom-offer a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}

.pricing-custom-offer a:hover {
  text-decoration: underline;
}

/* CONTACT SECTION */

.contact-section{
  font-family: var(--font-family);
  padding: 128px 256px 0 256px;
  background-color: var(--color-primary-light);
  text-align: center;
}

.contact-section h2 {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-secondary-dark);
  margin-bottom: 64px;
}

.contact-section p {
  color: var(--color-secondary-dark);
  margin-bottom: 64px;
  max-width: 720px;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;

}

.contact-form {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}


.form-floating-custom {
  position: relative;
  margin-bottom: 24px;
}

.form-floating-custom input {
  width: 100%;
  padding: 24px 12px 12px 12px;
  font-size: 16px;
  border: 1px solid var(--color-secondary-light);
  border-radius: 8px;
  font-family: var(--font-family);
  background-color: #fff;
}

.form-floating-custom label {
  position: absolute;
  left: 12px;
  top: 70%;
  transform: translateY(-100%);
  background-color: #fff;
  color: var(--color-secondary);
  font-size: 16px;
  transition: 0.2s ease all;
  pointer-events: none;
}

.form-floating-custom input:focus + label,
.form-floating-custom input:not(:placeholder-shown) + label {
  top: 24px;
  font-size: 12px;
}

.form-floating-custom textarea {
  width: 100%;
  padding: 24px 12px 12px 12px;
  font-size: 16px;
  border: 1px solid var(--color-secondary-light);
  border-radius: 8px;
  font-family: var(--font-family);
  background-color: #fff;
  resize: vertical;
}

.form-floating-custom textarea:focus + label,
.form-floating-custom textarea:not(:placeholder-shown) + label {
  top: 24px;
  font-size: 12px;
}


.form-floating-custom textarea + label {
  top: 36px;
  font-size: 16px;
  color: var(--color-secondary);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 32px;
  padding-bottom: 64px;
}


.form-row {
  display: flex;
  gap: 24px;
  width: 100%;
}

.form-row .form-floating-custom {
  width: 100%;
}

input.is-invalid,
textarea.is-invalid {
  border: 2px solid var(--danger);
  background-color: #fff0f0;
}

input.is-valid,
textarea.is-valid {
  border: 2px solid var(--success);
  background-color: #f0fff4;
}

.invalid-feedback {
  display: none;
  font-size: 13px;
  color: var(--danger);
  margin-top: 4px;
  text-align: right;
}

/** SPINNER**/
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-background);
  border-top: 2px solid var(--color-primary-dark);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 8px;
  vertical-align: text-bottom;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/** TOASTS **/
.custom-toast-container {
  position: fixed;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding: 0 16px;
  pointer-events: none;
}

.custom-toast-container.bottom {
  bottom: 24px;
  right: 0;
  align-items: flex-end;
  width: auto;
}

.custom-toast {
  background-color: var(--success);
  color: var(--color-background);
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.3s ease;
  font-family: var(--font-family);
  font-size: 15px;
  text-align: right;
  pointer-events: auto;
  max-width: 90vw;
  display: inline-block;
}


.custom-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.custom-toast.exiting {
  animation: slideDownOut 0.3s ease forwards;
}

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

.custom-toast.success { background-color: var(--success); }
.custom-toast.danger  { background-color: var(--danger); }



.site-footer {
  background-color: #fff;
  color: var(--color-secondary-dark);
  padding: 16px 256px;
  border-top: 1px solid var(--color-secondary-light);
  font-family: var(--font-family);
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 14px;
}

.footer-link:hover {
  text-decoration: underline;
}

.footer-socials a {
  color: var(--color-primary);
  font-size: 1.5rem;
  margin-left: 16px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-socials a:hover {
  color: var(--color-primary-dark);
}


.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 2000;
}

.modal-overlay.show {
  display: flex;
}

.modal-dialog {
  background-color: #fff;
  color: var(--color-secondary-dark);
  max-width: 720px;
  width: 90%; /* responsive sur petits écrans */
  max-height: 90vh;
  overflow-y: auto;
  margin: 32px;
  border-radius: 12px;
  position: relative;
  font-family: var(--font-family);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
}


.modal-dialog h3 {
  margin-top: 0;
  font-size: 24px;
  color: var(--color-primary);
}

.modal-content {
  font-size: 14px;
  line-height: 1.6;
  padding : 16px 32px 16px 32px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 28px;
  background: none;
  border: none;
  color: var(--color-secondary-dark);
  cursor: pointer;
}

.modal-close:hover {
  color: var(--color-secondary-light);
 
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background-color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;

  border-bottom: 1px solid var(--color-secondary-light);
}



@media (max-width: 768px) {
  /* PADDING GLOBAL */
  header .container,
  .home-section,
  .solution-section,
  .pricing-section,
  .contact-section,
  .site-footer {
    padding-left: 24px;
    padding-right: 24px;
  }

  /* === HEADER RESPONSIVE === */
  header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    padding: 16px 24px;
  }

  header .container > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
  }

  header nav {
    display: none;
  }

  header nav ul {
    flex-direction: column;
    gap: 16px;
  }



  header .container > div:last-child {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* ou center si tu veux centrer */
    gap: 8px;
  }

  .btn-login,
  .btn-signup {
    width: 100%; /* ou auto si tu veux garder la taille naturelle */
    text-align: center;
  }



  header a img {
    height: 40px;
  }


  /* HOME */
  .home-container {
    flex-direction: column;
    gap: 48px;
  }

  .home-text,
  .home-image {
    max-width: 100%;
  }

  .home-text h1 {
    font-size: 28px;
  }

  .home-text p {
    font-size: 16px;
  }

  .home-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  /* SOLUTION */
  .solution-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .solution-text {
    text-align: center;
  }

  /* PRICING */
  .pricing-grid {
    flex-direction: column;
    align-items: center;
  }

  .pricing-card {
    width: 100%;
    max-width: 360px;
  }

  /* CONTACT */
  .form-row {
    flex-direction: column;
    gap: 0px;
  }

  .form-actions {
    justify-content: center;
  }

  /* FOOTER */
  .footer-container {
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
  }

  .footer-socials a {
    margin-left: 8px;
    margin-right: 8px;
  }
}
