/* Réglages propres à cette page, pour ne pas toucher à la feuille de
     styles commune et éviter tout problème de cache navigateur. */
  .ticket-wrap { max-width: 840px; margin: 0 auto; }

  .bloc-titre { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
  .bloc-titre h2 { font-size: 1.3rem; }
  .bloc-titre .compte { color: var(--muted); font-size: .88rem; }

  /* ---------- Historique ---------- */
  .demandes { display: grid; gap: 14px; margin-bottom: 46px; }
  .demande { padding: 20px 22px; }
  .demande-haut { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
  .demande-titre { font-weight: 600; color: var(--blue-deep); margin: 0; }
  .demande-ref { display: block; font-weight: 400; font-size: .78rem; color: var(--muted); margin-top: 3px; letter-spacing: .02em; }

  /* ---------- Tunnel d'étapes ---------- */
  .tunnel { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 3px; }
  .tunnel li {
    flex: 1 1 110px; font-size: .71rem; line-height: 1.25; text-align: center;
    padding: 8px 10px 8px 16px; background: var(--border); color: var(--muted);
    clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%, 9px 50%);
  }
  .tunnel li:first-child { clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); border-radius: 5px 0 0 5px; }
  .tunnel li:last-child  { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 9px 50%); border-radius: 0 5px 5px 0; }
  .tunnel li.faite    { background: var(--blue-wash-2); color: var(--blue-deep); }
  .tunnel li.courante { background: var(--blue); color: var(--white); font-weight: 600; }
  .tunnel li.courante.fin { background: var(--ok-ink); }

  .demande-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
  @media (min-width: 620px) { .demande-meta { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
  .demande-meta dt { font-size: .73rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
  .demande-meta dd { margin: 3px 0 0; font-size: .92rem; font-variant-numeric: tabular-nums; }

  .demande-actions { margin-top: 16px; }
  .lien-fil {
    background: none; border: none; padding: 0; cursor: pointer;
    color: var(--blue); font-weight: 600; font-size: .9rem; text-decoration: underline;
    text-underline-offset: 3px;
  }

  /* ---------- Conversation ---------- */
  .fil { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
  .fil[hidden] { display: none; }
  .messages { display: grid; gap: 12px; margin-bottom: 18px; }
  .message { padding: 13px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--page); }
  .message.de-nicolas { background: var(--blue-wash); border-color: var(--blue-wash-2); }
  .message-haut { display: flex; justify-content: space-between; gap: 12px; font-size: .78rem; color: var(--muted); margin-bottom: 7px; }
  .message-haut strong { color: var(--blue-deep); }
  .message-corps { font-size: .93rem; white-space: pre-wrap; margin: 0; }
  .message-fichiers { margin: 9px 0 0; font-size: .82rem; }
  .message-fichiers a { display: block; }
  .fil-vide { color: var(--muted); font-size: .9rem; margin-bottom: 16px; }

  .reponse textarea {
    width: 100%; min-height: 110px; resize: vertical;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    padding: 12px 14px; background: var(--white); line-height: 1.55;
  }
  .reponse textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(1, 118, 211, .16); }
  .reponse-barre { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
  .reponse-barre input[type="file"] { flex: 1; min-width: 200px; font-size: .85rem; }

  .vide { color: var(--muted); font-size: .94rem; }

  /* ---------- Formulaire ---------- */
  .field textarea.textarea-lg { min-height: 300px; line-height: 1.6; }
  .char-count { display: block; text-align: right; font-size: .8rem; color: var(--muted); margin-top: 6px; }
  .field-row-2 { display: grid; gap: 0; }
  @media (min-width: 680px) { .field-row-2 { grid-template-columns: 1fr 1fr; gap: 0 18px; } }
  .field input[type="url"], .field input[type="file"] {
    width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    padding: 12px 14px; background: var(--white);
  }
  .field input[type="file"] { padding: 11px 13px; }
  .field input[type="url"]:focus, .field input[type="file"]:focus {
    outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(1, 118, 211, .16);
  }

  .notice {
    background: var(--blue-wash); border: 1px solid var(--blue-wash-2);
    border-radius: var(--radius-sm); padding: 16px 18px; margin-bottom: 24px; font-size: .93rem;
  }
  .notice p { margin: 0; }
  .notice p + p { margin-top: 9px; }
  .notice strong { color: var(--blue-deep); }
  .notice.alerte { background: #fdf0ef; border-color: #f2c9c5; }
  .notice.alerte strong { color: #8c1d18; }

  /* ---- Connexion ---- */
  .carte-connexion {
    max-width: 430px; margin: 0 auto;
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 34px 34px 30px;
    box-shadow: 0 1px 2px rgba(3,45,96,.04), 0 8px 28px rgba(3,45,96,.07);
  }
  .carte-connexion h2 { margin: 0 0 6px; font-size: 1.35rem; color: var(--blue-deep); }
  .carte-connexion .sous { margin: 0 0 24px; font-size: .92rem; color: var(--muted); line-height: 1.6; }
  .carte-connexion .sous strong { color: var(--blue-deep); }
  .carte-connexion .field { margin-bottom: 18px; }
  .carte-connexion label {
    display: block; font-size: .86rem; font-weight: 600;
    color: var(--blue-deep); margin-bottom: 7px;
  }
  .carte-connexion input {
    width: 100%; box-sizing: border-box; padding: 12px 14px; font-size: .97rem;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--white);
  }
  .carte-connexion input:focus {
    outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(1,118,211,.14);
  }
  .carte-connexion input.en-faute { border-color: #f2c9c5; box-shadow: 0 0 0 3px rgba(140,29,24,.08); }
  .carte-connexion .btn { width: 100%; margin-top: 6px; }
  .champ-code {
    font-size: 1.4rem; letter-spacing: .45em; text-align: center;
    font-variant-numeric: tabular-nums; padding-left: .45em;
  }
  .aide { margin: 18px 0 0; text-align: center; font-size: .87rem; color: var(--muted); }
  .lien-nu {
    background: none; border: 0; padding: 0; font: inherit; color: var(--blue);
    cursor: pointer; text-decoration: underline;
  }
  .lien-nu:hover { color: var(--blue-deep); }
  .jauge { display: flex; gap: 5px; margin-top: 9px; }
  .jauge i { height: 4px; flex: 1; border-radius: 2px; background: #e3e9f0; transition: background .18s; }
  .jauge i.on   { background: #2e844a; }
  .jauge i.faux { background: #c23934; }
  .regle { font-size: .8rem; color: var(--muted); margin: 8px 0 0; }

  /* Respiration sous la carte, et bouton centré quand il la suit. */
  .retour-accueil { margin-top: 34px; }
  #connexion:not([hidden]) ~ .retour-accueil { margin-top: 56px; text-align: center; }
  .barre-compte {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    flex-wrap: wrap; margin-bottom: 26px; font-size: .9rem; color: var(--muted);
  }

  .file-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 9px; }
  .file-list li {
    display: flex; align-items: center; gap: 10px; font-size: .88rem; background: var(--white);
    border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 12px;
  }
  .file-list .f-nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .file-list .f-poids { color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }
  .file-list .f-etat { flex: none; font-size: .8rem; font-weight: 600; }
  /* Croix de retrait, visible seulement avant l'envoi. */
  .file-list .f-retirer {
    flex: none; width: 26px; height: 26px; margin-left: 2px; padding: 0;
    border: 1px solid var(--line); border-radius: 50%; background: #fff;
    color: var(--muted); font-size: 1.05rem; line-height: 1; cursor: pointer;
  }
  .file-list .f-retirer:hover { border-color: #c9332a; color: #8c1d18; background: #fdf0ef; }
  .file-list .f-retirer:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
  .file-list li.is-ko { border-color: #f2c9c5; background: #fdf0ef; }
  .file-list li.is-ko .f-etat { color: #8c1d18; }
  .file-list li.is-ok .f-etat { color: var(--ok-ink); }

  .progress { height: 7px; border-radius: 99px; background: var(--border); overflow: hidden; margin-top: 14px; }
  .progress[hidden] { display: none; }
  .progress span { display: block; height: 100%; width: 0; background: var(--blue); transition: width .2s ease; }

  .confirme { text-align: center; padding: 34px 24px; }
  .confirme-mark {
    width: 62px; height: 62px; margin: 0 auto 20px; border-radius: 50%;
    background: var(--ok-bg); border: 1px solid var(--ok-border);
    display: flex; align-items: center; justify-content: center;
  }
  .confirme h2 { font-size: 1.35rem; }
  .confirme p { color: var(--muted); margin-top: 12px; }
  .confirme .ref {
    display: inline-block; margin-top: 18px; padding: 8px 16px; border-radius: 99px;
    background: var(--blue-wash); border: 1px solid var(--blue-wash-2);
    color: var(--blue-deep); font-weight: 600; letter-spacing: .03em;
  }

  /* Remplace les attributs style= de la page : la politique de sécurité
     du site interdit aussi bien les styles en ligne que les scripts. */
  .svg-defs { position: absolute; width: 0; height: 0; }
  .bloc-espace { margin-top: 26px; }

  /* ---- Œil, afficher ou masquer un mot de passe ---- */
  .champ-mdp { position: relative; display: block; }
  .champ-mdp input { padding-right: 46px; }
  .oeil {
    position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
    width: 36px; height: 36px; padding: 0; border: 0; background: none;
    cursor: pointer; color: #7b879a; display: flex; align-items: center;
    justify-content: center; border-radius: var(--radius-sm);
  }
  .oeil:hover { color: var(--blue-deep); }
  .oeil:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
  .oeil svg {
    width: 21px; height: 21px; fill: none; stroke: currentColor;
    stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  }
  /* Par défaut le mot de passe est masqué : on propose de l'afficher. */
  .oeil .oeil-barre  { display: none; }
  .oeil.montre .oeil-ouvert { display: none; }
  .oeil.montre .oeil-barre  { display: block; }

  /* ---- Bouton d'ouverture du formulaire ---- */
  .barre-action { margin-bottom: 30px; }
  .barre-action .btn { width: auto; }
  #depot .bloc-titre { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }

  /* Champs renseignés par la fiche client : lisibles, non modifiables. */
  .field input[readonly] {
    background: #f3f6fa; color: #53606f; cursor: default;
  }
  .field input[readonly]:focus { border-color: var(--border); box-shadow: none; }
