/* ═══════════════════════════════════════
   Espace demandeur — feuille de style scopée
   Réutilise les variables de style.css (--vert, --or, --rouge, ...)
═══════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600;700&display=swap');

.mono {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
}

.espace-demandeur { background: var(--gris); }

.espace-demandeur .inscription-container { max-width: 900px; }

.espace-demandeur [x-cloak] { display: none !important; }

/* Code OTP : styles externalisés car les styles inline sont bloqués par la CSP. */
.espace-demandeur .form-control.otp-input {
  min-height: 4.75rem;
  padding: .5rem .25rem;
  background-image: none;
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  font-size: clamp(2rem, 8vw, 2.5rem);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1;
  letter-spacing: clamp(.65rem, 3vw, 1rem);
  text-align: center;
  text-indent: clamp(.65rem, 3vw, 1rem);
}

.espace-demandeur .form-control.otp-input::placeholder {
  color: #b0b8c1;
  font-weight: 400;
  opacity: 1;
}

.otp-verification-overlay {
  background-color: rgba(0, 0, 0, .5);
}

.otp-expiration {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: -.25rem 0 1rem;
  color: var(--texte-s);
  font-size: .875rem;
}

.otp-expiration i,
.otp-expiration strong {
  color: var(--vert);
}

.otp-expiration-inline {
  flex: 0 0 auto;
  justify-content: flex-end;
  margin: 0;
  font-weight: 600;
  white-space: nowrap;
}

.modal.show .modal-dialog.otp-verification-dialog {
  transform: translateY(-.5rem);
}

.otp-verification-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.otp-retry {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
}

.otp-retry-message {
  margin: 0;
  color: #9a5b00;
  font-size: .8125rem;
}

.otp-retry-message strong {
  color: #7a4700;
}

.otp-verification-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.otp-verification-actions .btn-success {
  margin-left: auto;
}

@media (min-height: 600px) {
  .modal.show .modal-dialog.otp-verification-dialog {
    transform: translateY(-1.5rem);
  }
}

@media (max-width: 420px) {
  .otp-verification-actions {
    gap: .5rem;
  }

  .otp-verification-actions .btn {
    padding-right: .75rem;
    padding-left: .75rem;
    font-size: .875rem;
  }
}

/* ───────────── Cartouche de bienvenue ───────────── */

.cartouche {
  position: relative;
  background: var(--blanc);
  border: 1.5px solid var(--vert);
  border-radius: 4px;
  padding: 36px 44px;
}

.cartouche-logout { position: absolute; top: 18px; right: 26px; margin: 0; }
.cartouche-logout button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--texte-s);
  cursor: pointer;
  transition: color .15s ease;
}
.cartouche-logout button:hover,
.cartouche-logout button:focus-visible { color: var(--rouge); }
.cartouche-logout i { font-size: 15px; }

.corner { position: absolute; width: 16px; height: 16px; }
.corner::before,
.corner::after { content: ''; position: absolute; background: var(--vert); }
.corner::before { top: 50%; left: 0; width: 100%; height: 1.5px; transform: translateY(-50%); }
.corner::after  { left: 50%; top: 0; height: 100%; width: 1.5px; transform: translateX(-50%); }
.corner-tl { top: 10px; left: 10px; }
.corner-tr { top: 10px; right: 10px; }
.corner-bl { bottom: 10px; left: 10px; }
.corner-br { bottom: 10px; right: 10px; }

.cartouche-body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.cartouche-eyebrow {
  font-size: 12px;
  font-weight: 700;
  color: var(--vert);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 8px;
}

.cartouche-title {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  color: var(--texte);
  margin-bottom: 14px;
  line-height: 1.2;
}

.cartouche-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.cartouche-numero {
  font-size: 13px;
  font-weight: 600;
  color: var(--texte-s);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(27, 107, 58, .08);
  color: var(--vert);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 50px;
}

.cartouche-stats { display: flex; gap: 36px; }

.stat { text-align: center; }
.stat-value { display: block; font-size: 28px; font-weight: 700; color: var(--vert); line-height: 1; }
.stat-label { display: block; margin-top: 6px; font-size: 11px; color: var(--texte-s); text-transform: uppercase; letter-spacing: .04em; max-width: 110px; }

.alert-cartouche {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--or-l);
  color: #854F0B;
  border: 1px solid rgba(245, 166, 35, .4);
  border-radius: var(--r, 12px);
  padding: 14px 18px;
  font-size: 14px;
}

/* ───────────── Actions rapides ───────────── */

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
  min-height: 120px;
  background: var(--blanc);
  border: 1px solid var(--gris-b);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  font-weight: 700;
  color: var(--texte);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.quick-action i { font-size: 26px; color: var(--vert); }

.quick-action:hover,
.quick-action:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md, 0 8px 40px rgba(0,0,0,.12));
  border-color: var(--vert);
  color: var(--texte);
}

.quick-action-primary { background: var(--vert); color: var(--blanc); border-color: var(--vert); }
.quick-action-primary i { color: var(--blanc); }
.quick-action-primary:hover,
.quick-action-primary:focus-visible { background: var(--vert-d); color: var(--blanc); }

.quick-action-inline {
  display: inline-flex;
  flex-direction: row;
  min-height: 0;
  padding: 10px 22px;
  gap: 8px;
}
.quick-action-inline i { font-size: 16px; }

/* ───────────── Bannière d'action principale ───────────── */

.action-banner {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--blanc);
  border: 1px solid var(--gris-b);
  border-left: 4px solid var(--vert);
  border-radius: 14px;
  padding: 28px 32px;
}

.action-banner-icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: var(--vert);
  color: var(--blanc);
}
.action-banner-icon i { font-size: 30px; }

.action-banner-body { flex: 1 1 auto; min-width: 0; }

.action-banner-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
  color: var(--texte);
}

.action-banner-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--texte-s);
  max-width: 62ch;
}

.action-banner-cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 12px;
  background: var(--vert);
  border: 1px solid var(--vert);
  color: var(--blanc);
  font-weight: 700;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.action-banner-cta i { font-size: 16px; }
.action-banner-cta:hover,
.action-banner-cta:focus-visible {
  background: var(--vert-d);
  color: var(--blanc);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md, 0 8px 40px rgba(0,0,0,.12));
}

@media (max-width: 767.98px) {
  .action-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 24px;
  }
  .action-banner-cta { width: 100%; justify-content: center; }
}

/* ───────────── Sections ───────────── */

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--texte);
  margin-bottom: 20px;
}
.section-heading i { color: var(--vert); }

.empty-state {
  text-align: center;
  background: var(--blanc);
  border: 1.5px dashed var(--gris-b);
  border-radius: var(--r-lg, 20px);
  padding: 56px 24px;
}
.empty-state i { font-size: 40px; color: var(--vert); margin-bottom: 14px; display: inline-block; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--texte); margin-bottom: 8px; }
.empty-state p { color: var(--texte-s); max-width: 420px; margin: 0 auto 22px; }

.notif-empty { color: var(--texte-s); }

/* ───────────── Dossier ───────────── */

.dossier-card {
  background: var(--blanc);
  border: 1px solid var(--gris-b);
  border-radius: var(--r-lg, 20px);
  padding: 24px;
  height: 100%;
  box-shadow: var(--shadow, 0 4px 24px rgba(0,0,0,.08));
}

.dossier-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dossier-numero { font-size: 13px; font-weight: 700; color: var(--texte-s); }

.dossier-libelle { font-size: 16px; font-weight: 700; color: var(--texte); margin-bottom: 8px; }
.dossier-categorie { font-weight: 500; color: var(--texte-s); }

.dossier-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--texte-s);
  margin-bottom: 18px;
}

/* Tampon administratif */
.tampon {
  display: inline-block;
  border: 2px solid;
  border-radius: 4px;
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  transform: rotate(-3deg);
  white-space: nowrap;
  flex-shrink: 0;
}
.tampon-valide       { border-color: var(--vert);  color: var(--vert);  background: rgba(27, 107, 58, .08); }
.tampon-instruction  { border-color: var(--or);    color: #854F0B;      background: var(--or-l); }
.tampon-rejete       { border-color: var(--rouge); color: var(--rouge); background: rgba(193, 39, 45, .08); }
.tampon-brouillon    { border-color: var(--texte-s); color: var(--texte-s); background: var(--gris); }

/* Mini stepper 4 étapes */
.stepper {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.stepper-step {
  position: relative;
  flex: 1;
  text-align: center;
  font-size: 11px;
  color: var(--texte-s);
}

.stepper-step:not(:first-child)::before {
  content: '';
  position: absolute;
  top: 11px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--gris-b);
  z-index: 0;
}

.stepper-dot {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--gris-b);
  background: var(--blanc);
  color: var(--texte-s);
  font-size: 10px;
  font-weight: 700;
}

.stepper-label { display: block; margin-top: 6px; }

.stepper-step.is-done:not(:first-child)::before { background: var(--vert); }
.stepper-step.is-done .stepper-dot { border-color: var(--vert); background: var(--vert); color: var(--blanc); }
.stepper-step.is-current .stepper-dot { box-shadow: 0 0 0 3px rgba(27, 107, 58, .18); }
.stepper-step.is-done .stepper-label { color: var(--texte); font-weight: 600; }

.stepper-rejete .stepper-step.is-done:not(:first-child)::before { background: var(--rouge); }
.stepper-rejete .stepper-step.is-done .stepper-dot { border-color: var(--rouge); background: var(--rouge); }
.stepper-rejete .stepper-step.is-current .stepper-dot { box-shadow: 0 0 0 3px rgba(193, 39, 45, .18); }

/* ───────────── Notifications ───────────── */

.notif-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }

.notif-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
}
.notif-item.is-unread { background: var(--blanc); box-shadow: var(--shadow, 0 4px 24px rgba(0,0,0,.08)); }

.notif-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-top: 7px;
  flex-shrink: 0;
  background: var(--gris-b);
}
.notif-item.is-unread .notif-dot { background: var(--vert); box-shadow: 0 0 0 3px rgba(27, 107, 58, .15); }

.notif-content { flex: 1; min-width: 0; }
.notif-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.notif-titre { font-weight: 600; color: var(--texte-s); }
.notif-item.is-unread .notif-titre { font-weight: 700; color: var(--texte); }
.notif-date { font-size: 11px; color: var(--texte-s); flex-shrink: 0; }
.notif-message { font-size: 13px; color: var(--texte-s); margin-top: 2px; }

/* ───────────── Pièces requises (liste, sans upload) ───────────── */

.piece-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--gris-b);
  border-radius: 12px;
  margin-bottom: 8px;
}
.piece-item i { color: var(--texte-s); font-size: 18px; }
.piece-item span { font-size: 14px; color: var(--texte); }
.piece-item .btn { flex-shrink: 0; }

/* ───────────── Pièces requises (uploader tus, par pièce) ───────────── */

.piece-uploader {
  border: 1px solid var(--gris-b);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: border-color .15s ease, background .15s ease;
}

.piece-uploader-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.piece-uploader-icon { font-size: 20px; color: var(--texte-s); flex-shrink: 0; }

.piece-uploader-libelle {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.piece-uploader-libelle span:first-child { font-size: 14px; font-weight: 600; color: var(--texte); }
.piece-status { font-size: 12px; color: var(--texte-s); }

.piece-uploader-btn,
.piece-download-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.piece-progress {
  height: 6px;
  margin-top: 10px;
  background: var(--gris);
  display: none;
}

.piece-error { margin-top: 6px; }

.piece-en-cours .piece-uploader-icon { color: var(--or); animation: piece-spin 1s linear infinite; }
.piece-en-cours .piece-progress { display: flex; }
.piece-en-cours .piece-progress-bar { background: var(--or); }

.piece-recue { border-color: var(--vert); background: rgba(27, 107, 58, .04); }
.piece-recue .piece-uploader-icon { color: var(--vert); }
.piece-recue .piece-status { color: var(--vert); font-weight: 600; }

.piece-erreur { border-color: var(--rouge); }

@keyframes piece-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ───────────── Responsive ───────────── */

/* 3 cartes par ligne (col-lg-4) : cartes plus étroites, stepper resserré
   pour éviter que les libellés à 4 étapes ne se chevauchent. */
@media (min-width: 992px) {
  .dossier-card { padding: 20px; }
  .stepper-label { font-size: 9.5px; }
  .stepper-dot { width: 20px; height: 20px; font-size: 9px; }
}

@media (max-width: 575.98px) {
  .cartouche { padding: 28px 24px; }
  .cartouche-logout { top: 12px; right: 14px; }
  .cartouche-logout span { display: none; }
  .cartouche-stats { gap: 24px; width: 100%; justify-content: space-between; }
  .stepper-label { font-size: 10px; }
}

/* ───────────── Combobox « Commune » (formulaire de dépôt) ─────────────
   Champ de recherche + liste de suggestions filtrée. Aligné visuellement
   sur .form-control de style.css (bordure 1.5px, focus vert). */
[x-cloak] { display: none !important; }

.commune-combobox { position: relative; }

.commune-combobox__list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
  background: var(--blanc);
  border: 1.5px solid var(--gris-b);
  border-radius: 9px;
  box-shadow: 0 8px 24px rgba(26, 26, 46, .12);
}

.commune-combobox__option {
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--texte);
  cursor: pointer;
}

.commune-combobox__option:hover,
.commune-combobox__option.is-active {
  background: rgba(27, 107, 58, .1);
  color: var(--vert-d);
}

.commune-combobox__empty {
  padding: 9px 12px;
  font-size: 13px;
  color: var(--texte-s);
}

/* Mobile : la liste ne doit jamais déborder de l'écran. */
@media (max-width: 575.98px) {
  .commune-combobox__list { max-height: 220px; }
}

/* Sélecteur d'indicatif téléphonique (inscription) : menu court et scrollable.
   Classes dédiées car la CSP stricte des pages publiques bloque les style="". */
.indicatif-menu {
  min-width: 280px;
}

.indicatif-menu__liste {
  max-height: 240px;
  overflow-y: auto;
}

@media (max-width: 575.98px) {
  .indicatif-menu__liste { max-height: 200px; }
}
