/*
===========================================
  MISTRAL PRO RENO - FORMULAIRE DEVIS CSS
===========================================

🔋 SOMMAIRE / TABLE DES MATIÈRES :
===========================================

1. 🔧 RESET & BASE
2. 🎨 BANNIÈRE & HEADER
3. 📦 CONTAINERS & LAYOUT
4. 📝 FORMULAIRE
5. 🏷️ LABELS & INPUTS
6. 📊 FIELDSETS & LÉGENDES
7. ☑️ SERVICES & CHECKBOXES
8. 🎯 TITRES DE SECTIONS
9. ⏰ URGENCE & RADIO BUTTONS
10. 📘 BOUTONS (3 BOUTONS EN LIGNE)
11. ⏳ LOADING & SPINNER
12. 💬 MESSAGES & ALERTS
13. 🔒 RGPD & FOOTER
14. ♿ ACCESSIBILITÉ
15. ✅ VALIDATION VISUELLE
16. 📱 RESPONSIVE TABLET (768px)
17. 📱 RESPONSIVE MOBILE (480px)

===========================================
*/

/* ========================================
   1. 🔧 RESET & BASE
======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ========================================
   2. 🎨 BANNIÈRE & HEADER
======================================== */
.banner {
  width: 100%;
  background: #0a2e61;
  color: white;
  padding: 15px 20px;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
}

.logo {
  height: 100px;
  width: auto;
}

.company-info h1 {
  font-size: 32px;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.company-info .slogan {
  font-size: 16px;
  font-weight: 500;
  margin-top: 5px;
}

.company-info .coordonnees {
  font-size: 12px;
  font-weight: 300;
  margin-top: 5px;
  opacity: 0.9;
}

/* ========================================
   3. 📦 CONTAINERS & LAYOUT
======================================== */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.container {
  max-width: 900px;
  width: 100%;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  padding: 20px;
}

/* ========================================
   4. 📝 FORMULAIRE
======================================== */
.form-content {
  padding: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

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

.form-group.full {
  grid-column: 1 / -1;
}

/* ========================================
   5. 🏷️ LABELS & INPUTS
======================================== */
label {
  display: block;
  font-weight: 500;
  color: #333;
  margin-bottom: 5px;
  font-size: 14px;
}

input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e1e5e9;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

input:focus, textarea:focus, button:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
  border-color: #667eea;
}

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

/* ========================================
   6. 📊 FIELDSETS & LÉGENDES
======================================== */
fieldset {
  border: 1px solid #e1e5e9;
  border-radius: 6px;
  padding: 5px;
  margin-bottom: 10px;
}

legend {
  font-weight: 600;
  color: #333;
  padding: 0 10px;
  font-size: 14px;
}

/* ========================================
   7. ☑️ SERVICES & CHECKBOXES
======================================== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 4px;
  margin-top: 4px;
}

.service-item {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  margin-bottom: 2px;
  background: #f8f9fa;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.service-item:hover {
  background: #e9ecef;
  border-color: #667eea;
}

.service-item:focus-within {
  background: #e9ecef;
  border-color: #667eea;
}

.service-item input {
  width: auto;
  margin-right: 8px;
  accent-color: #667eea;
}

.service-item label {
  margin: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: normal;
  width: 100%;
}

/* ========================================
   8. 🎯 TITRES DE SECTIONS
======================================== */
.section-title,
div.section-title {
  font-size: 12px !important;
  font-weight: 600;
  margin: 4px 0 2px 0;
  padding: 3px 6px;
  line-height: 1.2;
  border-left: 3px solid #667eea;
  background: #377bbe !important;
  border-radius: 4px;
  color: #ffffff !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ========================================
   9. ⏰ URGENCE & RADIO BUTTONS
======================================== */
.urgency-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin-top: 6px;
}

.urgency-item {
  flex: 1;
  min-width: 120px;
}

.urgency-item label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 3px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  font-size: 12px;
  transition: all 0.2s ease;
}

.urgency-item input:checked + label {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.urgency-item input:focus + label {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.urgency-item input {
  display: none;
}

/* ========================================
   10. 📘 BOUTONS (3 BOUTONS EN LIGNE)
======================================== */

/* Container pour les 3 boutons en ligne */
.button-container-three {
  display: flex;
  gap: 8px;
  margin-top: 15px;
  width: 100%;
}

/* Style commun pour les 3 boutons */
.action-btn {
  flex: 1;
  padding: 12px 8px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Bouton appel (vert) */
.call-btn-three {
  background: #28a745;
  color: white;
}

.call-btn-three:hover {
  background: #218838;
  transform: translateY(-1px);
  color: white;
  text-decoration: none;
}

/* Bouton devis (bleu/violet) */
.submit-btn-three {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.submit-btn-three:hover:not(:disabled) {
  transform: translateY(-1px);
}

.submit-btn-three:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Bouton services (orange) */
.services-btn-three {
  background: #fd7e14;
  color: white;
}

.services-btn-three:hover {
  background: #e8681a;
  transform: translateY(-1px);
  color: white;
  text-decoration: none;
}

/* ========================================
   11. ⏳ LOADING & SPINNER
======================================== */
.loading {
  display: none;
  text-align: center;
  margin-top: 10px;
  color: #666;
  font-size: 14px;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

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

/* ========================================
   12. 💬 MESSAGES & ALERTS
======================================== */
.message {
  padding: 12px;
  border-radius: 6px;
  margin-top: 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
}

.message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.required {
  color: #dc3545;
  font-weight: bold;
}

/* ========================================
   13. 🔒 RGPD & FOOTER
======================================== */
.rgpd {
  font-size: 11px;
  color: #666;
  text-align: center;
  margin-top: 12px;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 6px;
}

.company-details {
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  padding: 12px 18px;
  font-size: 10px;
  color: #666;
  line-height: 1.4;
}

.company-details .details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
  text-align: center;
}

.company-details strong {
  color: #333;
  display: block;
  margin-bottom: 3px;
}

/* ========================================
   14. ♿ ACCESSIBILITÉ
======================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========================================
   15. ✅ VALIDATION VISUELLE
======================================== */
input:invalid:not(:placeholder-shown) {
  border-color: #dc3545;
}

input:valid:not(:placeholder-shown) {
  border-color: #28a745;
}

/* ========================================
   16. 📱 RESPONSIVE TABLET (768px)
======================================== */
@media (max-width: 768px) {
  body {
    padding: 8px;
  }

  .container {
    padding: 15px;
  }

  .form-content {
    padding: 12px;
  }

  .banner {
    height: auto;
    text-align: center;
    padding: 10px 15px;
  }

  .banner-content {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  .logo {
    height: 60px;
    margin-bottom: 4px;
  }

  .company-info h1 {
    font-size: 20px;
  }

  .company-info .slogan {
    font-size: 13px;
  }

  .company-info .coordonnees {
    font-size: 10px;
  }

  .form-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
  }

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

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

  .urgency-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 4px;
  }

  .urgency-item {
    min-width: auto;
  }

  .urgency-item label {
    padding: 8px 6px;
    font-size: 11px;
  }

  .company-details {
    padding: 10px 15px;
  }

  .company-details .details-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    text-align: left;
  }

  .section-title {
    font-size: 10px;
    margin: 2px 0 1px 0;
    padding: 2px 4px;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  fieldset {
    padding: 8px;
    margin-bottom: 8px;
  }

  legend {
    font-size: 12px;
  }

  /* Adaptation boutons sur tablette */
  .button-container-three {
    gap: 6px;
  }

  .action-btn {
    padding: 10px 6px;
    font-size: 12px;
  }
}

/* ========================================
   17. 📱 RESPONSIVE MOBILE (480px)
======================================== */
@media (max-width: 480px) {
  body {
    padding: 5px;
  }

  .logo {
    height: 50px;
  }

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

  .company-info h1 {
    font-size: 18px;
  }

  .company-info .slogan {
    font-size: 11px;
  }

  .company-info .coordonnees {
    font-size: 9px;
  }

  .service-item {
    padding: 6px 8px;
  }

  .service-item label {
    font-size: 11px;
  }

  .urgency-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-top: 4px;
  }

  .urgency-item label {
    padding: 10px 8px;
    font-size: 12px;
  }

  .container {
    padding: 10px;
  }

  .form-content {
    padding: 8px;
  }

  /* Adaptation boutons sur mobile */
  .button-container-three {
    gap: 4px;
  }

  .action-btn {
    padding: 10px 4px;
    font-size: 11px;
  }
}