/* ==================================================
   VARIABLES
================================================== */
:root {
  --bg: #fdf6ee;
  --bg-card: #fff8f0;
  --bg-white: #fff;

  --text: #3b2a1a;
  --text-muted: #444;

  --primary: #7b2d2d;
  --primary-dark: #5c1f1f;
  --secondary: #c0703a;
  --accent: #5a33cc;

  --border: #e0c4a0;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 6px 18px rgba(34, 34, 68, 0.08);
  --shadow-lg: 0 15px 40px rgba(0, 0, 0, 0.25);

  --transition: 0.2s ease;
}

/* ==================================================
   RESET & BASE
================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  overflow-y: scroll;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;

  font-family: Georgia, serif;
  font-size: 16px;
  line-height: 1.4;

  background: var(--bg);
  color: var(--text);
}

main {
  flex: 1;
  display: block;
  width: min(1100px, 92%);
  margin: 0 auto;
  padding: 0px;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
}

/* ==================================================
   HEADER / FOOTER
================================================== */
header {
  background-color: var(--primary);
  color: var(--bg);
  text-align: center;
  padding: 0;
}

header h1 {
  margin-bottom: 0;
  font-size: 1em;
  letter-spacing: 2px;
  font-family: "Virtual", "Euphoria", "Dancing Script", cursive;
}

header .subtitle {
  font-style: italic;
  font-size: 1em;
  color: #f0c9a0;
}

footer {
  background-color: var(--primary);
  color: var(--bg);
  text-align: center;
  padding: 10px;
  font-size: 0.9em;
}

footer a,
footer p {
  color: #f0c9a0;
}

/* ==================================================
   TYPOGRAPHIE
================================================== */
h2 {
  margin: 20px 0 12px;
  padding-left: 12px;
  font-size: 1.6em;
  color: var(--primary);
  border-left: 4px solid var(--secondary);
}

h3 {
  margin: 18px 0 8px;
  font-size: 1.2em;
  color: var(--primary-dark);
}

p {
  margin-bottom: 16px;
  font-size: 1em;
  color: var(--text);
}

/* Legacy */
p.titre { padding: 20px; font-size: 18px; color: var(--primary); }
p.titre2 { margin-left: 50px; padding: 10px; font-size: 16px; font-weight: 700; color: var(--primary); }
p.titre3 { padding: 0; line-height: 20px; font-weight: 700; color: var(--primary); }
p.titretarif { padding: 10px; font-size: 16px; font-weight: 600; color: var(--primary); }

p.description { width: 350px; padding: 10px; line-height: 20px; }
p.description_wo_w { padding: 4px; }
p.description2 { padding: 20px; }
p.petite_note { margin: 0 40px; font-size: 12px; line-height: 14px; font-style: italic; }
p.tarif { text-align: right; color: var(--primary); }

/* ==================================================
   LISTES
================================================== */
ul { margin: 10px 0 20px 24px; }
ul li { margin-bottom: 8px; }
ul li::marker { color: var(--secondary); }

/* ==================================================
   NAVIGATION
================================================== */
nav {
  background-color: var(--primary-dark);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

nav a {
  color: #f0c9a0;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 4px 4px 0 0;
  font-size: 0.95em;
  transition: background-color 0.3s, color 0.3s;
}

nav a.eleve {
   background-color: rgba(27, 222, 145, 0.8);
  color: blue;
}

nav a:hover,
nav a.active {
  background-color: var(--bg);
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
}

/* Sous-menu legacy */
ul.subnav { margin: 0; padding: 0; list-style: none; text-align: center; }
li.subnav { display: inline; }
a.subnav { display: inline-block; padding: 4px 16px; text-decoration: none; }

/* ==================================================
   SECTIONS
================================================== */
section {
  display: none;
  animation: fadeIn 0.4s ease;
}
section.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================================================
   COMPOSANTS UI
================================================== */
.card,
.citation,
.descriptiondiv,
.double_descriptiondiv {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card { padding: 24px 28px; margin: 24px 0; }
.citation { width: 500px; margin-left: 10px; padding: 10px; }
.descriptiondiv,
.double_descriptiondiv { max-width: 900px; margin: 20px auto; padding: 20px; line-height: 24px; }

.section-icon { font-size: 2.5em; text-align: center; margin-bottom: 10px; }

.timeline {
  border-left: 3px solid var(--secondary);
  padding-left: 20px;
  margin: 20px 0;
}
.timeline-item { margin-bottom: 20px; position: relative; }
.timeline-item::before {
  content: "";
  width: 12px; height: 12px;
  background-color: var(--secondary);
  border-radius: 50%;
  position: absolute;
  left: -27px; top: 6px;
}
.timeline-item strong { color: var(--primary); }

.tarif-badge {
  display: inline-block;
  margin: 6px 8px 10px 0;
  padding: 6px 14px;
  font-size: 0.95em;
  font-weight: 600;
  color: var(--primary);
  background-color: transparent;
  border: 1px solid var(--secondary);
  border-radius: 14px;
}

/* ==================================================
   BOUTONS / ACTIONS
================================================== */
a.rdv,
.rdv {
  text-decoration: none;
  transition: all var(--transition);
}

.btn-contact {
  display: inline-block;
  margin: 10px 12px 12px 0;
  padding: 12px 28px;
  font-size: 1em;
  text-decoration: none;
  color: #fff;
  background-color: var(--secondary);
  border-radius: var(--radius-sm);
  transition: background-color 0.3s;
}
.btn-contact:hover { background-color: var(--primary); }

/* ==================================================
   ÉTATS / COMMENTAIRES / FORM
================================================== */
td.busy { background-color: var(--primary); }

.commentInfo {
  padding: 20px;
  font-size: 12px;
  font-family: Arial, Helvetica, sans-serif;
}

.comment {
  position: relative;
  padding: 10px;
  background: var(--bg-white);
  border: 1px solid var(--secondary);
  border-radius: var(--radius-sm);
}

.comment::after {
  content: "";
  position: absolute;
  top: 5px; left: -15px;
  border-style: solid;
  border-width: 10px 15px 10px 0;
  border-color: transparent var(--secondary);
}

input[type="text"] {
  padding: 8px;
  font-size: 16px;
  background: var(--bg-white);
  border: 1px solid #cdb79e;
  border-radius: var(--radius-sm);
}
input[type="submit"] {
  padding: 10px 20px;
  font-weight: 700;
  color: #fff;
  background: var(--secondary);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
input[type="submit"]:hover { background: var(--primary); }

/* ==================================================
   CALENDRIER RDV
================================================== */
.blocJoursDispos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
  gap: 16px;
  margin: 10px 0;
}

.jourDispoFiche {
  display: flex;
  flex-direction: column;
  padding: 14px;
  background: var(--bg-white);
  border: 1px solid #e9e9f4;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}

.libJourDispo {
  position: sticky;
  top: 0;
  z-index: 2;
  margin-bottom: 12px;
  padding: 10px 12px;
  text-align: center;
  background: linear-gradient(135deg, #f5f0ff, #eef3ff);
  border: 1px solid #ddd8ff;
  border-radius: 10px;
}
.libJourDispo .jour { display: block; font-weight: 700; color: #3d2c8d; text-transform: capitalize; }
.libJourDispo .date { display: block; margin-top: 2px; color: #6b6b8f; }

.RDV {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 0; padding: 0;
  list-style: none;
}

.libHeureDispo { margin-bottom: 8px; }

.rdv {
  display: block;
  padding: 10px 8px;
  text-align: center;
  font-weight: 600;
  background: linear-gradient(135deg, #f8fbff, #eef5ff);
  border: 1px solid #cfe0ff;
  border-radius: 10px;
}
.rdv:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(40, 90, 180, 0.18);
}

/* ==================================================
   INFOS UTILISATEUR
================================================== */
.info-card {
  margin-top: 10px;
  padding: 12px 14px;
  text-align: center;
  background: #fcfcff;
  border: 1px solid #ebe9ff;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 12px rgba(70, 60, 150, 0.06);
}
.info-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}
.info-value {
  padding: 2px 8px;
  color: var(--accent);
  background: #f2edff;
  border: 1px solid #e3d9ff;
  border-radius: var(--radius);
}

/* ==================================================
   MODAL
================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: 0;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9999;
}
.modal-box {
  width: 100%;
  max-width: 420px;
  padding: 24px;
  text-align: center;
  background: var(--bg-white);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  animation: popup 0.2s ease;
}
@keyframes popup {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-title {
  margin-bottom: 12px;
  font-size: 1.3rem;
  font-weight: 700;
  color: #3d2c8d;
}
.modal-message {
  margin-bottom: 22px;
  line-height: 1.5;
  color: var(--text-muted);
}
.modal-actions { display: flex; gap: 10px; }
.modal-btn {
  flex: 1;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}
.modal-cancel { background: #f1f1f1; }
.modal-confirm { color: #fff; background: var(--accent); }
.modal-confirm:hover { background: #4420ad; }

/* ==================================================
   RDV IFRAME
================================================== */
#rdv {
  width: 100%;
  padding: 0;
  margin: 0;
  height: auto;
  min-height: 0;
}
#rdv iframe {
  width: 100%;
  max-width: 100%;
  display: block;
  border: 0;
  height: 78vh;
  min-height: 620px;
}

#contact {
  width: 100%;
  padding: 0;
  margin: 0;
  height: auto;
  min-height: 0;
}
#contact iframe {
  width: 100%;
  max-width: 100%;
  display: block;
  border: 0;
  height: 78vh;
  min-height: 620px;
}

/* ==================================================
   RESPONSIVE
================================================== */
@media (max-width: 768px) {
  .citation,
  p.description {
    width: auto;
  }

  .descriptiondiv,
  .double_descriptiondiv {
    margin: 10px;
    padding: 15px;
  }

  .jourDispoFiche {
    width: auto;
  }

  #rdv iframe {
    height: 72vh;
    min-height: 520px;
  }
  
    #contact iframe {
    height: 72vh;
    min-height: 520px;
  }
}

@media (max-width: 600px) {
  header h1 {
    font-size: 0.7em;
  }

  nav {
    display: grid; /* au lieu de flex */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    align-items: stretch;
  }

  nav a {
    display: block;
    width: 100%;
    min-width: 0;           /* important pour éviter débordement */
    text-align: center;
    padding: 10px 8px;
    font-size: 0.9em;
    border-radius: 6px;
    line-height: 1.2;
    white-space: normal;    /* autorise retour à la ligne */
    word-break: break-word; /* fallback Samsung */
  }

  h2 {
    font-size: 1.3em;
  }

  main {
    width: 100%;
    margin: 0 auto;
    padding: 12px 10px 20px;
  }

  section#rdv {
    padding: 0;
    margin: 0;
  }

  .section-icon {
    margin: 8px 0;
    font-size: 2rem;
  }

  #rdv iframe {
    height: 70vh;   /* fallback */
    height: 70dvh;  /* mobile moderne */
    min-height: 420px;
  }
  
  
  #contact iframe {
    height: 70vh;   /* fallback */
    height: 70dvh;  /* mobile moderne */
    min-height: 420px;
  }
}

@media (max-width: 500px) {
  .RDV,
  .blocJoursDispos {
    grid-template-columns: 1fr;
  }
}

/* ==================================================
   FORMULAIRE RDV
================================================== */

.form-rdv {
    max-width: 650px;
    margin: 20px auto;
}

.form-rdv table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 5px;
}

.form-rdv td {
    vertical-align: top;
}

.form-rdv label {
    display: block;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 4px;
}

.form-rdv input[type="text"],
.form-rdv input[type="tel"],
.form-rdv input[type="email"],
.form-rdv textarea {
    width: 100%;
    padding: 5px 5px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 5px;
    transition: all .2s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.04);
}

.form-rdv textarea {
    min-height: 140px;
    resize: vertical;
}

.form-rdv input:focus,
.form-rdv textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow:
        0 0 0 4px rgba(192,112,58,.15),
        inset 0 1px 3px rgba(0,0,0,.04);
}

.form-rdv .required {
    color: #b53b3b;
}

.form-rdv .help {
    font-size: 2px;
    color: #777;
    margin-top: 2px;
}

.form-rdv .submit-zone {
    text-align: center;
    padding-top: 5px;
}

.form-rdv input[type="submit"] {
    min-width: 220px;
    padding: 5px 5px;
    font-size: 16px;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(123,45,45,.18);
}

.form-rdv input[type="submit"]:hover {
    transform: translateY(-2px);
}


/* ───────────────────────────────────────
   RESPONSIVE — Tablette (≤ 768px)
─────────────────────────────────────── */
@media (max-width: 768px) {
    .form-rdv {
        margin: 16px;
        max-width: 100%;
    }

    /* Transformation du tableau en blocs empilés */
    .form-rdv table,
    .form-rdv tbody,
    .form-rdv tr,
    .form-rdv td {
        display: block;
        width: 100%;
    }

    .form-rdv tr {
        margin-bottom: 4px;
    }

    .form-rdv td {
        padding: 0;
    }

    .form-rdv input[type="text"],
    .form-rdv input[type="tel"],
    .form-rdv input[type="email"],
    .form-rdv textarea {
        font-size: 14px;
        padding: 5px 5px;
    }

    .form-rdv input[type="submit"] {
        min-width: 180px;
        font-size: 15px;
        padding: 5px 5px;
    }
}


/* ───────────────────────────────────────
   RESPONSIVE — Mobile (≤ 480px)
─────────────────────────────────────── */
@media (max-width: 480px) {
    .form-rdv {
        margin: 12px;
    }

    .form-rdv label {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .form-rdv input[type="text"],
    .form-rdv input[type="tel"],
    .form-rdv input[type="email"],
    .form-rdv textarea {
        font-size: 16px; /* ≥ 16px évite le zoom auto sur iOS */
        padding: 5px 5px;
        border-radius: 8px;
    }

    .form-rdv textarea {
        min-height: 110px;
    }

    .form-rdv .help {
        font-size: 11px;
    }

    .form-rdv .submit-zone {
        padding-top: 6px;
    }

    .form-rdv input[type="submit"] {
        width: 100%;       /* bouton pleine largeur sur petit écran */
        min-width: unset;
        font-size: 15px;
        padding: 5px 5px;
        box-shadow: 0 4px 12px rgba(123,45,45,.18);
    }
}

.flash-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin: 15px auto;
    max-width: 600px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.flash-error {
    background-color: #fdecea;
    border-left: 5px solid #e53935;
    color: #b71c1c;
}

.flash-success {
    background-color: #e8f5e9;
    border-left: 5px solid #43a047;
    color: #1b5e20;
}

.flash-message a {
    margin-left: auto;
    color: inherit;
    font-weight: bold;
    text-decoration: underline;
}

/* ==================================================
   NAVIGATION ESPACE CLIENT (iframe) — verticale
================================================== */
.nav-client {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 16px 12px;
    background-color: var(--bg-card);
    border-right: 2px solid var(--border);
    min-width: 180px;
    width: 200px;
}

.nav-client a {
    display: block;
    padding: 10px 16px;
    font-size: 0.95em;
    font-family: Georgia, serif;
    text-decoration: none;
    color: var(--primary);
    background-color: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-client a:hover {
    background-color: var(--secondary);
    color: #fff;
    border-color: var(--secondary);
    padding-left: 22px;
}

.nav-client a.active {
    background-color: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 700;
}

.nav-client a.nav-logout {
    color: #b71c1c;
    border-color: #e57373;
    background-color: #fdecea;
    margin-top: 10px;
}

.nav-client a.nav-logout:hover {
    background-color: #e53935;
    color: #fff;
    border-color: #e53935;
}

/* Mise en page globale espace client */
.client-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    min-height: 80vh;
}

.client-content {
    flex: 1;
    padding: 20px 24px;
    min-width: 0; /* évite débordement flex */
}

/* Responsive : nav passe en haut en colonne sur mobile */
@media (max-width: 600px) {
    .client-layout {
        flex-direction: column;
    }

    .nav-client {
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
        border-right: none;
        border-bottom: 2px solid var(--border);
        padding: 10px;
        min-width: unset;
    }

    .nav-client a {
        flex: 1;
        text-align: center;
        font-size: 0.82em;
        padding: 8px 10px;
        white-space: normal;
    }

    .nav-client a:hover {
        padding-left: 10px; /* annule le décalage hover sur mobile */
    }

    .nav-client a.nav-logout {
        margin-top: 0;
    }
}

/* ==================================================
   TABLEAU DOCUMENTS
================================================== */
.table-docs {
    width: 100%;
    border-collapse: collapse;
    margin-top: 5px;
    font-size: 0.95em;
    line-height: 0.9;
}

.table-docs th {
    text-align: left;
    padding: 5px 5px;
    background-color: var(--primary);
    color: #fff;
    font-weight: 600;
}

.table-docs th:first-child { border-radius: 8px 0 0 0; }
.table-docs th:last-child  { border-radius: 0 8px 0 0; }

.table-docs td {
    padding: 5px 5px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--text);
    line-height: 0.9;
}

.table-docs tr:last-child td {
    border-bottom: none;
}

.table-docs tr:hover td {
    background-color: var(--bg);
}

/* Responsive tableau */
@media (max-width: 600px) {
    .table-docs thead { display: none; }

    .table-docs tr {
        display: block;
        margin-bottom: 2px;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 2px;
        line-height: 1;
    }

    .table-docs td {
        display: block;
        border: none;
        padding: 1px 1px;
    }
}

/* ==================================================
   ZONE DE DÉPÔT (DRAG & DROP)
================================================== */
.drop-zone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 5px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--secondary);
    background: #fff8f0;
}

.drop-zone.drag-over {
    transform: scale(1.01);
    box-shadow: var(--shadow-md);
}

/* Cache l'input file natif mais le garde fonctionnel */
.drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.drop-zone-icon {
    font-size: 2.5em;
    pointer-events: none;
}

.drop-zone-texte {
    margin: 0;
    color: var(--text-muted);
    pointer-events: none;
}

.drop-zone-nom {
    margin: 2px 0 0;
    font-weight: 600;
    font-size: 0.9em;
    pointer-events: none;
}

/* ==================================================
   BARRE DE PROGRESSION
================================================== */
.progress-wrap {
    display: none;
    position: relative;
    height: 10px;
    margin-top: 12px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--secondary), var(--primary));
    border-radius: 999px;
    transition: width 0.2s ease;
}

.progress-label {
    display: block;
    text-align: center;
    font-size: 0.8em;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==================================================
   SELECT catégorie (harmonisé avec form-rdv)
================================================== */
.form-rdv select {
    width: 100%;
    padding: 5px 5px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 5px;
    transition: all .2s ease;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237b2d2d' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.form-rdv select:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(192,112,58,.15);
}

/* ==================================================
   CHAMP MOT DE PASSE AVEC ŒIL
================================================== */
.input-password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-password-wrap input[type="password"],
.input-password-wrap input[type="text"] {
    width: 100%;
    padding-right: 44px; /* espace pour l'icône */
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1em;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
    transition: color var(--transition);
    user-select: none;
}

.toggle-password:hover {
    color: var(--primary);
}
