/**
 * @file
 * El Cottage Du Coin - Styles Globaux & Documentation
 * Dépend de: ecdc-colors.css
 */

/* --- 1. CONFIGURATION GLOBALE & TYPOGRAPHIE --- */

@font-face {
  font-family: 'Idealy';
  src: url('../fonts/portcreb.ttf') format('truetype');
  /* Assurez-vous que le fichier de police est accessible à cette URL */
}

body {
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--bg-page);
  margin: 0;
/*  padding: 20px;*/
  -webkit-font-smoothing: antialiased;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* Classe utilitaire pour le nom du projet dans le texte */
.ecdc-title {
  font-family: 'Idealy', sans-serif;
  color: var(--ap-green);
  font-size: 1.2rem;
  font-weight: 600;
}

/* Conteneur Principal (Largeur Unifiée) */
.ecdc-wrapper {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  background: var(--bg-white);
  padding: 1rem; /* Ajusté selon tes fichiers finaux */
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  box-sizing: border-box;
}

/* --- 2. HEADER UNIFIÉ (TABLE LAYOUT) --- */

.ecdc-header {
  margin-bottom: 40px;
  background: var(--header-bg);
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}

.ecdc-header table {
  width: 100%;
  border-collapse: collapse;
}

.ecdc-header td {
  vertical-align: middle;
  padding: 0;
}

.ecdc-header h1 {
  font-family: 'Idealy', sans-serif;
  font-size: 2.4rem;
  margin: 0;
  text-transform: uppercase;
  color: #fff;
  text-align: center;
  line-height: 1.2;
}

.ecdc-header p {
  font-size: 1.1rem;
  margin-top: 1rem;
  font-style: italic;
  color: #fff;
  opacity: 0.9;
  text-align: center;
}

.ecdc-header img {
  max-width: 100%;
  height: auto;
  max-height: 120px;
  display: block;
  margin: 0 auto;
}

/* --- 3. TYPOGRAPHIE DE CONTENU (H2, H3, P) --- */

h2 {
  font-family: 'Idealy', sans-serif;
  color: var(--ap-green);
  font-size: 1.8rem;
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
  padding-left: 1rem;
  border-radius: 8px;
  /* Style par défaut avec barre latérale */
  border-left: 6px solid var(--ap-light);
/*  background: linear-gradient(90deg, #f0f9f9 0%, #fff 100%);*/
}

/* Variation pour les titres sans fond (ex: Souveraineté) */
h2.plain {
  background: none;
  border-left: 5px solid var(--ap-light);
}

h3 {
  font-family: 'Idealy', sans-serif;
  color: var(--ap-light);
  font-size: 1.4rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

p {
  text-align: justify;
  margin-bottom: 1rem;
}

/* --- 4. COMPOSANTS : GRILLES & CARTES --- */

.ecdc-grid, .options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

/* Cartes Standards (Fonctionnalités, etc.) */
.ecdc-card {
  background: var(--bg-white);
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ecdc-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(21, 60, 61, 0.15);
  border-color: var(--ap-light);
}

.ecdc-tag {
  display: inline-block;
  background: #E6FFFA;
  color: var(--ap-green);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
  border: 1px solid var(--ap-light);
}

/* Cartes Options (Tarifs) avec Prix à droite */
.option-card {
  background-color: var(--bg-option);
  border: 1px solid var(--ap-green);
  border-radius: 6px;
  padding: 1.5rem;
  position: relative;
}

.option-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
  gap: 10px;
}

.option-title {
  color: var(--ap-light);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
}

.option-price-badge {
  display: inline-block;
  background-color: #FFF;
  color: var(--ap-light);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.9rem;
  border: 1px solid var(--ap-light);
  white-space: nowrap;
}

.note-faq {
  font-size: 0.85rem;
  color: var(--ap-light);
  margin-top: 0.5rem;
  font-style: italic;
}

/* --- 5. COMPOSANTS : TABLEAUX & LISTES --- */

.pricing-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.pricing-table th, .pricing-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.pricing-table th {
  background-color: var(--ap-green);
  color: #fff;
  font-family: 'Idealy', sans-serif;
  font-size: 1.1rem;
  border-radius: 8px 8px 0 0;
}

/* Utilitaires pour les coins du tableau */
.pricing-table th.left { border-radius: 8px 0 0 0; }
.pricing-table th.center { border-radius: 0; }
.pricing-table th.right { border-radius: 0 8px 0 0; }

.price-tag-main, .price-tag {
  font-weight: bold;
  color: var(--ap-green);
  font-size: 1.2rem;
  white-space: nowrap;
}

/* Listes Personnalisées */
.ecdc-content ul {
  background-color: var(--bg-light);
  padding: 1.5rem 2.5rem;
  border-radius: 6px;
  margin: 1.5rem 0;
  list-style-type: none;
}

.ecdc-content ul.check-list li::before {
  content: "✓";
  color: var(--ap-green);
  font-weight: bold;
  position: absolute;
  left: 0;
}

.ecdc-content ul.bullet-list {
  background-color: var(--bg-section);
}

.ecdc-content ul.bullet-list li::before {
  content: "•";
  color: var(--ap-green);
  font-weight: bold;
  position: absolute;
  left: 0;
}

.ecdc-content li {
  margin-bottom: 0.8rem;
  position: relative;
  padding-left: 1.5rem;
}

/* --- 6. COMPOSANTS : BOÎTES SPÉCIALES --- */

.highlight-box, .legal-box, .example-box {
  background-color: var(--bg-info);
  border: 1px solid var(--ap-light);
  padding: 1.5rem;
  border-radius: 6px;
  margin: 2rem 0;
}

.legal-box {
  border-left: 5px solid var(--ap-green);
  border: 1px solid var(--ap-light); /* Override pour garder le contour */
}

.example-box {
  border-left: 5px solid var(--ap-green);
}

.example-calc {
  background: #fff;
  padding: 1rem;
  border-radius: 4px;
  margin-top: 1rem;
  font-family: monospace;
  font-size: 0.95rem;
}

.alert-box {
  background-color: var(--bg-warning);
  border-left: 5px solid var(--badge-red-border);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 4px;
  color: var(--text-alert);
}

.price-section {
  background-color: var(--bg-code);
  border: 1px solid var(--badge-yellow-border);
  padding: 1.5rem;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.link-box {
  background-color: var(--bg-warning);
  border-left: 4px solid var(--badge-red-link);
  padding: 1rem;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.link-box a {
  color: var(--badge-red-link);
  font-weight: bold;
  text-decoration: none;
}

/* --- 7. COMPOSANTS : SCÉNARIOS (PAIEMENT) --- */

.card {
  background: var(--bg-white);
  padding: 30px;
  margin-bottom: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  border-left: 5px solid var(--header-bg);
}

.card.scenario-a { border-left-color: var(--badge-orange); }
.card.scenario-b { border-left-color: var(--badge-green); }
.card.scenario-c { border-left-color: var(--badge-blue); }

.card h2 {
  margin-top: 0;
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
  background: none;
  border-left: none;
  color: var(--header-bg);
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: bold;
  color: #fff;
  margin-left: 10px;
  vertical-align: middle;
}

.badge-a { background-color: var(--badge-orange); }
.badge-b { background-color: var(--badge-green); }
.badge-c { background-color: var(--badge-blue); }

/* Listes numérotées pour scénarios */
.ecdc-content ol.step-list {
  counter-reset: step;
  list-style: none;
  padding: 0;
}

.ecdc-content ol.step-list li {
  position: relative;
  padding-left: 40px;
  margin-bottom: 15px;
}

.ecdc-content ol.step-list li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  background: var(--header-bg);
  color: white;
  border-radius: 50%;
  text-align: center;
  line-height: 30px;
  font-weight: bold;
}

/* --- 8. FOOTER --- */

.ecdc-content .ecdc-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
  font-size: 0.9rem;
}

.ecdc-content .footer-col strong {
  display: block;
  color: var(--ap-green);
  font-family: 'Idealy', sans-serif;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.ecdc-content .footer-contact a {
  color: var(--ap-light);
  text-decoration: none;
  display: block;
  margin-bottom: 0.3rem;
  transition: color 0.2s;
}

.ecdc-content .footer-contact a:hover {
  color: var(--ap-green);
  text-decoration: underline;
}

/* --- 9. RESPONSIVE & IMPRESSION --- */

@media (max-width: 768px) {
  .ecdc-header td {
    display: block;
    width: 100% !important;
    text-align: center;
  }
  .ecdc-header td:nth-child(2) {
    margin-top: 1rem;
  }
  .ecdc-footer {
    flex-direction: column;
    text-align: center;
  }
  .options-grid, .ecdc-grid {
    grid-template-columns: 1fr;
  }
  .option-title-row {
    flex-direction: column;
    gap: 5px;
  }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
}

@media print {
  @page {
    size: A4;
    margin: 15mm;
  }
  body {
    background: #fff;
    padding: 0;
    margin: 0;
    font-size: 11pt;
  }
  .ecdc-wrapper {
    box-shadow: none;
    padding: 0;
    width: 100%;
    max-width: none;
    border: none;
    border-radius: 0;
  }
  
  /* Header Print */
  .ecdc-header {
    background: var(--header-bg) !important;
    color: #fff !important;
    padding: 30px 20px;
    margin-bottom: 30px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .ecdc-header h1, .ecdc-header p {
    color: #fff !important;
  }
  .ecdc-header img {
    height: 100px;
    width: auto;
  }

  /* Contenu Print */
  h2 {
    color: #000;
    border-left: 5px solid #000;
    background: none;
    page-break-after: avoid;
  }
  
  .ecdc-card, .option-card, .card, ul, .highlight-box, .alert-box, .price-section {
    break-inside: avoid;
    border: 1px solid #ccc;
    background-color: #fff !important;
    box-shadow: none;
  }
  
  .legal-box, .alert-box, .card {
    border-left: 5px solid #000 !important;
  }

  .pricing-table th {
    background-color: #000 !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact;
  }

.ecdc-content   ol.step-list li::before {
    background: #000;
  }

  /* Footer Print */
  .ecdc-footer {
    margin-top: 2rem;
    border-top: 1px solid #000;
    display: flex !important;
    flex-wrap: nowrap;
    justify-content: space-between;
    font-size: 9pt;
    page-break-inside: avoid;
  }
  .footer-col strong, .footer-contact a {
    color: #000;
  }
.ecdc-content a {
    text-decoration: none;
    color: #000;
  }
}
