/* Reset et base */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  font-family: 'Montserrat', Arial, sans-serif;
  box-sizing: border-box;
  overflow-x: hidden;
  background: #0a1940;
}

* {
  box-sizing: border-box;
}

/* Background animé */
.background {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100vh;
  z-index: 1;
  background: url('img/fond.png') center center / cover no-repeat;
  filter: blur(7px) brightness(0.84);
  animation: zoomBg 16s infinite alternate ease-in-out;
}

@keyframes zoomBg {
  0% { transform: scale(1); }
  100% { transform: scale(1.06); }
}

/* Overlay */
.overlay {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(120deg, rgba(32, 53, 160, 0.16) 70%, rgba(19, 51, 79, 0.25) 100%);
  z-index: 2;
  pointer-events: none;
}

/* Contenu principal */
.content {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  background: rgba(17, 44, 82, 0.87);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
  text-align: center;
  padding: 40px 50px;
  width: 95%;
  max-width: 1000px;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeIn 1.7s cubic-bezier(.39, .65, .46, .95) forwards;
  opacity: 0;
}

/* Scrollbar personnalisée pour la box */
.content::-webkit-scrollbar {
  width: 8px;
}

.content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

.content::-webkit-scrollbar-thumb {
  background: rgba(187, 230, 252, 0.3);
  border-radius: 10px;
}

.content::-webkit-scrollbar-thumb:hover {
  background: rgba(187, 230, 252, 0.5);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -60%) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Logo */
.logo {
  max-width: 200px;
  width: 100%;
  height: auto;
  margin-bottom: 20px;
  animation: logoFade 1.5s 0.5s both;
}

@keyframes logoFade {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Titre */
h1 {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  color: #effaff;
  font-weight: bold;
  letter-spacing: 2px;
  margin: 0 0 20px 0;
  text-shadow: 0 6px 18px rgba(33, 40, 33, 0.68);
  animation: textPop 2s .7s both cubic-bezier(.69, .29, .59, .98);
}

@keyframes textPop {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

/* Paragraphe */
p {
  font-size: clamp(0.95rem, 3vw, 1.2rem);
  color: #bbe6fc;
  margin: 0 0 15px 0;
  letter-spacing: 1px;
  line-height: 1.6;
  animation: fadeText 1.7s 1.2s both;
}

p:last-of-type {
  margin-bottom: 0;
}

p strong {
  color: #effaff;
  font-weight: bold;
}

/* Réseaux sociaux */
.social-links {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin: 25px 0;
  flex-wrap: wrap;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  transition: all 0.3s ease;
  animation: fadeText 1.7s 1.4s both;
}

.social-link.facebook {
  background: rgba(24, 119, 242, 0.2);
  border: 2px solid rgba(24, 119, 242, 0.5);
  color: #5b9dff;
}

.social-link.facebook:hover {
  background: rgba(24, 119, 242, 0.3);
  border-color: #1877f2;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(24, 119, 242, 0.4);
}

.social-link.instagram {
  background: rgba(225, 48, 108, 0.2);
  border: 2px solid rgba(225, 48, 108, 0.5);
  color: #ff6eb7;
}

.social-link.instagram:hover {
  background: rgba(225, 48, 108, 0.3);
  border-color: #e1306c;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(225, 48, 108, 0.4);
}

.social-link svg {
  width: 20px;
  height: 20px;
}

@keyframes fadeText {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Messages d'alerte */
.alert {
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  text-align: center;
  animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-success {
  background: rgba(76, 175, 80, 0.2);
  border: 2px solid rgba(76, 175, 80, 0.6);
  color: #a7ffaa;
}

.alert-error {
  background: rgba(244, 67, 54, 0.2);
  border: 2px solid rgba(244, 67, 54, 0.6);
  color: #ffb3b3;
}

/* Formulaire */
form {
  margin-top: 30px;
  text-align: left;
  animation: fadeText 1.7s 1.5s both;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  color: #bbe6fc;
  margin-bottom: 8px;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  letter-spacing: 0.5px;
}

input,
textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid rgba(187, 230, 252, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #effaff;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  transition: all 0.3s ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(187, 230, 252, 0.5);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #bbe6fc;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 10px rgba(187, 230, 252, 0.3);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* Bouton pour afficher le formulaire */
.contact-button {
  width: auto;
  padding: 16px 40px;
  margin: 25px auto;
  background: linear-gradient(135deg, #2035a0 0%, #1e4d7a 100%);
  color: #effaff;
  border: none;
  border-radius: 10px;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(32, 53, 160, 0.4);
  animation: fadeText 1.7s 1.2s both;
  display: block;
  position: relative;
  overflow: hidden;
}

.contact-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.contact-button:hover::before {
  width: 300px;
  height: 300px;
}

.contact-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(32, 53, 160, 0.6);
  background: linear-gradient(135deg, #2540b8 0%, #1e5d94 100%);
}

.contact-button:active {
  transform: translateY(0);
}

.contact-button.loading {
  pointer-events: none;
  opacity: 0.7;
}

.contact-button.loading::after {
  content: '';
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #effaff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

/* Bouton de soumission */
button[type="submit"] {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #2035a0 0%, #1e4d7a 100%);
  color: #effaff;
  border: none;
  border-radius: 8px;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: clamp(1rem, 2.5vw, 1.1rem);
  font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(32, 53, 160, 0.4);
  margin-top: 10px;
}

button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(32, 53, 160, 0.6);
  background: linear-gradient(135deg, #2540b8 0%, #1e5d94 100%);
}

button[type="submit"]:active {
  transform: translateY(0);
}

/* Media queries pour le responsive */

/* Tablettes */
@media (max-width: 768px) {
  .content {
    padding: 30px 28px;
    width: 90%;
    max-width: 700px;
  }

  .logo {
    max-width: 150px;
  }

  h1 {
    letter-spacing: 1.5px;
    margin-bottom: 15px;
  }

  p {
    letter-spacing: 0.5px;
  }

  form {
    margin-top: 25px;
  }

  .form-group {
    margin-bottom: 16px;
  }

  input,
  textarea {
    padding: 10px 12px;
  }

  button {
    padding: 12px 18px;
  }
  
  .social-links {
    gap: 12px;
  }
  
  .social-link {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
}

/* Smartphones */
@media (max-width: 480px) {
  .content {
    padding: 20px 18px;
    width: 95%;
    border-radius: 15px;
  }

  .logo {
    max-width: 120px;
    margin-bottom: 15px;
  }

  h1 {
    letter-spacing: 1px;
    margin-bottom: 12px;
  }

  p {
    letter-spacing: 0.3px;
    line-height: 1.5;
  }

  form {
    margin-top: 20px;
  }

  .form-group {
    margin-bottom: 14px;
  }

  label {
    margin-bottom: 6px;
  }

  input,
  textarea {
    padding: 10px 12px;
    border-radius: 6px;
  }

  textarea {
    min-height: 100px;
  }

  button {
    padding: 12px 16px;
    border-radius: 6px;
  }
  
  .social-links {
    flex-direction: column;
    gap: 10px;
  }
  
  .social-link {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
  }
}

/* Très petits écrans */
@media (max-width: 360px) {
  .content {
    padding: 16px 14px;
  }

  .logo {
    max-width: 100px;
  }

  input,
  textarea {
    padding: 8px 10px;
  }

  button {
    padding: 10px 14px;
  }
}

/* Mode paysage sur mobile */
@media (max-height: 600px) and (orientation: landscape) {
  .content {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    margin: 20px auto;
    max-height: 90vh;
    overflow-y: auto;
  }

  body {
    overflow-y: auto;
  }
}

/* Accessibilité - préférence de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .background {
    animation: none;
  }
}
