@import url("theme.css");

* { box-sizing: border-box; }

body{
  margin: 0;
  font-family: -apple-system, "Segoe UI", Arial, sans-serif;
  background: var(--page-bg);
  color: var(--on-page);
}

a { color: inherit; }

.site-header{
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 28px 24px 20px;
  text-align: center;
  border-bottom: 1px solid var(--page-border);
  background: var(--page-bg);
}

.site-header .brand{
  display: block;
  margin: 0 auto 14px;
  height: 56px;
  width: auto;
  background: var(--white);
  padding: 10px 18px;
  border-radius: 8px;
  box-sizing: content-box;
}

.site-header h1{
  margin: 0;
  font-size: 28px;
  color: var(--on-page);
}

.site-nav{
  max-width: var(--max-w);
  margin: 18px auto 0;
  display: flex;
  gap: 20px;
  justify-content: center;
  font-size: 14px;
}

.site-nav a{
  text-decoration: none;
  color: var(--on-page-soft);
  padding: 6px 4px;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a.active{
  color: var(--on-page);
  border-bottom-color: var(--accent);
}

main{
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px 64px;
}

/* ---- Tuiles (accueil) ---- */
.tiles{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 12px;
}

.tiles-single{
  grid-template-columns: repeat(2, minmax(260px, 340px));
  justify-content: center;
}

@media (max-width: 620px){
  .tiles-single{
    grid-template-columns: minmax(260px, 340px);
  }
}

.tiles-section-title{
  margin: 40px 0 12px;
  text-align: center;
  color: var(--on-page-soft);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .14em;
}

.tiles-row{
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

@media (max-width: 720px){
  .tiles-row{
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

.tile{
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--white);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 32px 28px;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
  transition: transform .15s ease, box-shadow .15s ease;
}

.tile:hover{
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
}

.tile .tile-icon{
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--green-soft);
  color: var(--green);
}

.tile.tile-primary{
  background: var(--green);
  color: var(--white);
}

.tile.tile-primary .tile-icon{
  background: rgba(255,255,255,.15);
  color: var(--white);
}

.tiles-row .tile .tile-icon{
  background: rgba(37,211,102,.15);
  color: #25D366;
}

.tiles-row .tile.tile-primary .tile-icon{
  background: rgba(255,255,255,.2);
  color: #25D366;
}

.tile .tile-icon.tile-icon-plain{
  background: var(--bg-alt);
}

.tile.tile-primary .tile-desc{ color: rgba(255,255,255,.8); }

.tile h2{
  margin: 0;
  font-size: 20px;
}

.tile .tile-desc{
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.tile .tile-cta{
  margin-top: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-dark);
}

.tile.tile-primary .tile-cta{ color: var(--white); }

/* ---- FAQ ---- */
.faq-list{
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.faq-item{
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

.faq-item summary{
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 12px;
}

.faq-item summary::-webkit-details-marker{ display: none; }

.faq-item summary::before{
  content: "+";
  color: var(--accent-dark);
  font-size: 18px;
  width: 18px;
}

.faq-item[open] summary::before{ content: "\2212"; }

.faq-item .faq-answer{
  padding: 0 22px 20px 54px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

.faq-category{
  color: var(--on-page-soft);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 12px;
  font-weight: 700;
  margin: 32px 0 10px;
}

.faq-category:first-child{ margin-top: 0; }

/* ---- Formation ---- */
.formation-layout{
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

.fiche-list{
  background: var(--white);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  position: sticky;
  top: 210px;
}

.fiche-list button{
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 14px 14px;
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 4px;
}

.fiche-list button .fiche-tag{
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-soft);
  margin-bottom: 2px;
}

.fiche-list button:hover{ background: var(--bg-alt); }

.fiche-list button.active{
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 700;
}

.fiche-list button.active .fiche-tag{ color: var(--green-dark); }

.fiche-content{
  background: var(--white);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  min-height: 400px;
}

.fiche-pane{ display: none; }
.fiche-pane.active{ display: block; }

.fiche-content table{
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.fiche-content th, .fiche-content td{
  border: 1px solid var(--border);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  font-weight: normal;
}

.fiche-content thead th{ background: var(--bg-alt); }
.fiche-content strong{ font-weight: 700; }

.fiche-content table table{ margin-bottom: 0; }
.fiche-content table table th{ background: none; border: none; padding: 4px 10px; }

.fiche-content img{
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 8px 0;
}

.fiche-content img.zoomable{
  cursor: zoom-in;
  transition: transform .15s ease, box-shadow .15s ease;
}

.fiche-content img.zoomable:hover{
  transform: scale(1.02);
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
}

.lightbox{
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.85);
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: zoom-out;
}

.lightbox.open{ display: flex; }

.lightbox img{
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

.fiche-content p{ margin: 0 0 8px; }
.fiche-content ul{ margin: 8px 0; padding-left: 20px; }

/* ---- Blocs colorés des fiches formation ---- */
.fiche-heading{
  color: var(--green-dark);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 28px 0 10px !important;
}

.fiche-block{ border-radius: 10px; overflow: hidden; }
.fiche-block th{ border: none; }

.fiche-objectif > thead > tr > th{
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
}
.fiche-objectif strong{ color: var(--accent-dark); }

.fiche-prereq > thead > tr > th{
  background: var(--green-soft);
  border-left: 4px solid var(--green);
}
.fiche-prereq strong{ color: var(--green-dark); }

.fiche-step{ background: var(--white); border: 1px solid var(--border); }
.fiche-step > thead > tr > th:first-child{
  background: var(--green);
  color: var(--white);
  text-align: center;
  width: 44px;
}
.fiche-step > thead > tr > th:first-child strong{ color: var(--white); font-size: 16px; }
.fiche-step > thead > tr > th:last-child{ background: var(--bg-alt); }

.fiche-tips > thead > tr > th{
  background: var(--accent-soft);
  border-left: 4px solid var(--accent-dark);
}
.fiche-tips strong{ color: var(--accent-dark); }

.fiche-trouble > thead > tr > th{
  background: var(--danger-soft);
  border-left: 4px solid var(--danger);
}
.fiche-trouble strong{ color: var(--danger); }

.fiche-flow{ background: none; border: none; }
.fiche-flow thead tr{ display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.fiche-flow th{ border: none; padding: 8px 4px; }
.fiche-flow th.flow-status{
  background: var(--green-soft);
  color: var(--green-dark);
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 700 !important;
}
.fiche-flow th.flow-arrow{
  color: var(--on-page-soft);
  color: var(--ink-soft);
  padding: 0 2px;
}

@media (max-width: 760px){
  .formation-layout{ grid-template-columns: 1fr; }
  .fiche-list{ position: static; }
}
