/* ============================================================
   Interface CLIENT ID-COM — accueillante, simple, mobile-first.
   Public non technique, parfois stressé : une action par écran,
   gros boutons, contrastes nets, vocabulaire quotidien.
   ============================================================ */

:root {
    --bleu: #1b4f8a;
    --bleu-fonce: #143a66;
    --vert: #2e7d32;
    --vert-fond: #eaf4ea;
    --texte: #24303a;
    --doux: #5b6b74;
    --bord: #d5dde3;
    --fond: #eef3f8;
    --erreur: #c62828;
    --erreur-fond: #fdecea;
    --rayon: 14px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 17px;
    color: var(--texte);
    background: var(--fond);
    line-height: 1.55;
}

.page-client { min-height: 100vh; display: flex; flex-direction: column; }

.entete-client {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.2rem; background: var(--bleu); color: #fff;
}
.marque-client { font-size: 1.15rem; }
.marque-client strong { font-weight: 700; }
.lien-quitter {
    background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 999px; padding: .35rem .9rem; font-size: .95rem; cursor: pointer;
}
.form-inline { margin: 0; }

.contenu-client {
    flex: 1; display: flex; justify-content: center; align-items: flex-start;
    padding: 1.5rem 1rem;
}

.pied-client { text-align: center; color: var(--doux); font-size: .85rem; padding: 1.2rem; }
.pied-marque { margin-bottom: .35rem; }

/* Coordonnées ID-COM (config, endroit fixe — jamais générées par l'IA) */
.coordonnees-idcom { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .35rem .5rem; }
.coord-intro { font-weight: 600; color: var(--texte); }
.coord-sep { color: var(--bord); }
.coord-site { white-space: nowrap; }
.coord-tel { color: var(--bleu); text-decoration: none; font-weight: 600; }
.coord-tel:hover { text-decoration: underline; }
.bloc-coordonnees { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--bord); text-align: center; color: var(--doux); font-size: .9rem; }

/* Carte principale — une seule par écran */
.carte-client {
    background: #fff; border-radius: var(--rayon); box-shadow: 0 4px 20px rgba(20, 50, 80, .1);
    padding: 1.8rem 1.6rem; width: 100%; max-width: 480px;
}
.carte-client h1 { font-size: 1.5rem; margin: 0 0 .6rem; color: var(--bleu-fonce); }
.accroche { color: var(--doux); margin: 0 0 1.4rem; font-size: 1.02rem; }

/* Formulaires */
.form-client { display: flex; flex-direction: column; }
.form-client label, .label-photos { font-weight: 600; margin: .6rem 0 .35rem; }
.form-client input, .zone-texte {
    width: 100%; padding: .85rem .9rem; font-size: 1.05rem; font-family: inherit;
    border: 2px solid var(--bord); border-radius: 10px; background: #fff;
}
.form-client input:focus, .zone-texte:focus { outline: none; border-color: var(--bleu); }
.zone-texte { resize: vertical; min-height: 130px; }
.aide-champ { color: var(--doux); font-size: .9rem; margin: .35rem 0 0; }

.champ-code {
    font-size: 1.8rem !important; letter-spacing: .5rem; text-align: center; font-weight: 700;
}

/* Gros bouton d'action principal — pleine largeur, doigt-friendly */
.btn-client {
    display: block; width: 100%; text-align: center; text-decoration: none;
    margin-top: 1.4rem; padding: 1rem; font-size: 1.15rem; font-weight: 700;
    color: #fff; background: var(--bleu); border: none; border-radius: 12px; cursor: pointer;
    transition: background .12s ease;
}
.btn-client:hover { background: var(--bleu-fonce); }
.btn-client:disabled { opacity: .6; cursor: default; }
.btn-secondaire-client { background: #fff; color: var(--bleu); border: 2px solid var(--bleu); }
.btn-secondaire-client:hover { background: #eef4fb; }

.lien-secondaire {
    display: inline-block; margin-top: 1rem; background: none; border: none;
    color: var(--bleu); font-size: 1rem; cursor: pointer; text-decoration: underline; padding: 0;
}
.form-renvoi { margin: 0; }

.alerte-client {
    background: var(--erreur-fond); color: var(--erreur); border: 1px solid #f3c4c0;
    border-radius: 10px; padding: .8rem 1rem; margin-bottom: 1rem; font-weight: 500;
}
.info-client {
    background: #eef4fb; color: var(--bleu-fonce); border: 1px solid #cddff0;
    border-radius: 10px; padding: .8rem 1rem; margin-bottom: 1rem;
}

/* Gros choix (type d'intervention) */
.choix-gros {
    display: block; width: 100%; text-align: left; cursor: pointer;
    background: #fff; border: 2px solid var(--bord); border-radius: 12px;
    padding: 1.1rem 1.2rem; margin-top: 1rem; transition: border-color .12s ease, background .12s ease;
}
.choix-gros:hover { border-color: var(--bleu); background: #f7fafd; }
.choix-gros:disabled { opacity: .6; cursor: default; }
.choix-emoji { font-size: 1.8rem; display: block; }
.choix-titre { display: block; font-size: 1.15rem; font-weight: 700; color: var(--bleu-fonce); margin-top: .3rem; }
.choix-sous { display: block; color: var(--doux); font-size: .95rem; margin-top: .2rem; }

/* Guidage — fil de discussion */
.chat-fil { display: flex; flex-direction: column; gap: .6rem; margin: 1rem 0; }
.bulle {
    max-width: 85%; padding: .7rem .9rem; border-radius: 14px; line-height: 1.4;
    white-space: pre-wrap; word-wrap: break-word;
}
.bulle-assistant { align-self: flex-start; background: #eef4fb; color: var(--texte); border-bottom-left-radius: 4px; }
.bulle-client { align-self: flex-end; background: var(--bleu); color: #fff; border-bottom-right-radius: 4px; }
.bulle-reflexion { font-style: italic; color: var(--doux); background: #f0f2f5; }
.chat-saisie { display: flex; flex-direction: column; gap: .5rem; margin-top: .8rem; }
.chat-saisie textarea {
    width: 100%; padding: .75rem .9rem; font-size: 1.05rem; font-family: inherit;
    border: 2px solid var(--bord); border-radius: 10px; resize: vertical;
}
.chat-saisie textarea:focus { outline: none; border-color: var(--bleu); }
.chat-saisie .btn-client { margin-top: 0; }

/* Replanification / espace client */
.rappel-demande { background: var(--fond); border-left: 3px solid var(--bleu); border-radius: 8px; padding: .7rem .9rem; margin: 0 0 1rem; color: var(--doux); font-style: italic; }
.champ-tel { width: 100%; padding: .85rem .9rem; font-size: 1.05rem; font-family: inherit; border: 2px solid var(--bord); border-radius: 10px; margin-bottom: .3rem; }
.champ-tel:focus { outline: none; border-color: var(--bleu); }
.demande-attente { border: 2px solid var(--bord); border-radius: 12px; padding: 1rem; margin: 1rem 0; }
.demande-resume { font-weight: 600; color: var(--bleu-fonce); }
.demande-creneau { color: var(--doux); font-size: .95rem; margin: .3rem 0 .2rem; }
.separateur { border: none; border-top: 1px solid var(--bord); margin: 1.6rem 0; }

/* Créneaux proposés */
.creneau-choix {
    display: block; width: 100%; text-align: left; cursor: pointer;
    background: #fff; border: 2px solid var(--bord); border-radius: 12px;
    padding: .9rem 1.1rem; margin-top: .8rem;
}
.creneau-choix:hover { border-color: var(--bleu); background: #f7fafd; }
.creneau-choix:disabled { opacity: .6; cursor: default; }
.creneau-date { display: block; font-size: 1.1rem; font-weight: 700; color: var(--bleu-fonce); }
.creneau-meta { display: block; color: var(--doux); font-size: .92rem; margin-top: .15rem; }

/* Captures */
.champ-fichier { display: block; margin-top: .4rem; font-size: 1rem; }
.liste-photos { list-style: none; margin: 1rem 0 0; padding: 0; }
.liste-photos li {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--fond); border-radius: 8px; padding: .5rem .8rem; margin-bottom: .4rem;
}
.photo-nom { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liste-photos .lien-secondaire { margin: 0; font-size: .9rem; }

/* Confirmation */
.carte-succes { text-align: center; }
.grande-coche {
    width: 72px; height: 72px; margin: 0 auto 1rem; border-radius: 50%;
    background: var(--vert-fond); color: var(--vert); font-size: 2.2rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.note-suite { color: var(--doux); font-size: .95rem; }

/* Erreur Blazor */
#blazor-error-ui {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff3cd; color: #664d03; padding: .8rem 1.2rem; text-align: center;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, .15); z-index: 1000;
}
#blazor-error-ui .reload { margin-left: .5rem; font-weight: 600; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

@media (max-width: 520px) {
    .carte-client { padding: 1.4rem 1.1rem; border-radius: 0; box-shadow: none; }
    .contenu-client { padding: .5rem; }
}

/* Aide au choix de rue (adresse introuvable dans une commune du secteur). */
.saisie-libre { margin-top: 1rem; }
.saisie-libre summary { cursor: pointer; font-weight: 600; color: var(--bleu, #1b4f8a); }
.saisie-libre label { display: block; margin-top: .6rem; }
.saisie-libre .btn-secondaire-client { margin-top: .6rem; }
.lien-client {
    background: none; border: none; color: var(--gris-doux, #5b6b74);
    text-decoration: underline; margin-top: 1rem; padding: .4rem 0; font-size: .95rem;
}
