/* =====================================================================
   PARC REVENDEURS R+ — feuille de style
   Fondations reprises du design system Maroc Telecom (octobre 2025) :
   rouge #E00800, Funnel Display, contrôles en pilule, cartes 16px.
   ===================================================================== */

@font-face {
  font-family: 'Funnel Display';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url(fonts/funnel-display-02.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Funnel Display';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url(fonts/funnel-display-01.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+2C60-2C7F;
}

:root {
  --red: #E00800;
  --red-hover: #A50500;
  --red-press: #890500;
  --ink: #1A1A19;
  --ink-2: #3C3C3B;
  --grey: #676766;
  --grey-light: #8C8C8B;
  --line: #DEDFDF;
  --line-strong: #C6CACC;
  --sunken: #F6F6F5;
  --bg: #EDEDEC;
  --success: #1E7A4B;
  --radius-card: 16px;
  --radius-field: 8px;
  --pill: 999px;
  --shadow-sm: 0 1px 2px rgba(26, 26, 25, .06);
  --shadow-lg: 0 8px 28px rgba(26, 26, 25, .10);
  --ease: cubic-bezier(.2, .6, .2, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Funnel Display', Helvetica, Arial, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

a { color: var(--red); }
a:hover { color: var(--red-hover); }

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

input, textarea, select { font: inherit; color: inherit; }

/* ---------------------------------------------------------------- shell */

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  background: var(--sunken);
  position: relative;
  overflow: hidden;
}

.vue {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px 128px;
  scrollbar-width: none;
}
.scroll::-webkit-scrollbar { display: none; }

/* --------------------------------------------------------------- entête */

.entete {
  flex: none;
  background: var(--red);
  color: #fff;
  padding: 22px 20px 20px;
  padding-top: max(22px, env(safe-area-inset-top));
  position: relative;
  overflow: hidden;
}

.entete .symbole {
  position: absolute;
  right: -70px;
  bottom: -56px;
  width: 230px;
  opacity: .13;
  pointer-events: none;
}

.entete-haut {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.marque {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .01em;
  text-transform: lowercase;
}

.role {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .72;
}

.titre-app {
  position: relative;
  margin-top: 20px;
  font-size: 31px;
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -.02em;
  text-align: center;
}
.titre-app strong { font-weight: 800; }

.sous-titre {
  position: relative;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 300;
  opacity: .9;
  text-align: center;
}

.entete-fiche h1 {
  position: relative;
  margin: 18px 0 0;
  font-size: 23px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
}

/* ------------------------------------------------------------ contrôles */

.barre-recherche {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color 120ms var(--ease);
}
.barre-recherche:hover { border-color: var(--line-strong); }
.barre-recherche span { font-size: 14px; font-weight: 300; color: var(--grey); }

.champ-recherche {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 14px;
  background: #fff;
  border-radius: var(--pill);
}
.champ-recherche input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  font-size: 14px;
  color: var(--ink);
}

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border-radius: var(--pill);
  font-size: 13px;
  font-weight: 800;
  transition: background-color 120ms var(--ease), border-color 120ms var(--ease), transform 200ms var(--ease);
}
.bouton:active { transform: scale(.98); }
.bouton:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(224, 8, 0, .28); }
.bouton--primaire { background: var(--red); color: #fff; }
.bouton--primaire:hover { background: var(--red-hover); }
.bouton--ink { background: var(--ink); color: #fff; }
.bouton--ink:hover { background: var(--ink-2); }
.bouton--ligne { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.bouton--ligne:hover { border-color: var(--ink); }
.bouton--bloc { width: 100%; height: 48px; }
.bouton[disabled] { opacity: .4; cursor: not-allowed; }

/* ------------------------------------------------------------- vignettes */

.tuiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 20px; }

.tuile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 14px 12px;
  text-align: center;
}
.tuile b {
  display: block;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
}
.tuile span {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--grey);
}

/* ------------------------------------------------------------- sections */

.section-titre {
  margin-top: 24px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.section-titre b { font-size: 13px; font-weight: 800; letter-spacing: .02em; }
.section-titre span { font-size: 11px; font-weight: 300; color: var(--grey); }

.liste {
  margin-top: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.ligne-dr {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  border-bottom: 1px solid var(--bg);
  text-align: left;
  transition: background-color 120ms var(--ease);
}
.ligne-dr:last-child { border-bottom: 0; }
.ligne-dr:hover { background: var(--sunken); }
.ligne-dr .nom { font-size: 13px; font-weight: 800; letter-spacing: .01em; }
.ligne-dr .nb { font-size: 15px; font-weight: 800; min-width: 34px; text-align: right; }

.jauge {
  margin-top: 6px;
  height: 4px;
  border-radius: var(--pill);
  background: var(--bg);
  overflow: hidden;
}
.jauge i { display: block; height: 4px; border-radius: var(--pill); background: var(--red); }

/* --------------------------------------------------------- résultats */

.resultats { display: flex; flex-direction: column; gap: 8px; }

.carte-revendeur {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: left;
  transition: border-color 120ms var(--ease), transform 200ms var(--ease), box-shadow 200ms var(--ease);
}
.carte-revendeur:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.initiales {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: var(--pill);
  background: var(--sunken);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--red);
}

.carte-revendeur .corps { flex: 1; min-width: 0; }
.carte-revendeur .nom {
  display: block;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.carte-revendeur .meta {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 300;
  color: var(--grey);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.carte-revendeur .fin { flex: none; text-align: right; }
.carte-revendeur .code {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--grey);
}
.carte-revendeur .droite { display: block; margin-top: 3px; font-size: 11px; font-weight: 800; color: var(--red); }

.compteur {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 8px;
}
.compteur b {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--grey);
}

.puces {
  display: flex;
  gap: 8px;
  padding: 12px 16px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.puces::-webkit-scrollbar { display: none; }

.puce {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 13px;
  border-radius: var(--pill);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.puce--active { background: var(--ink); color: #fff; border-color: var(--ink); }

.vide { margin-top: 60px; text-align: center; padding: 0 24px; }
.vide b { font-size: 15px; font-weight: 800; }
.vide p { margin-top: 8px; font-size: 12px; font-weight: 300; color: var(--grey); line-height: 1.5; }

/* -------------------------------------------------------------- fiche */

.bloc {
  margin-top: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 16px;
}
.bloc--plat { padding: 0; overflow: hidden; }

.bloc-titre {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--grey);
}

.paire { margin-top: 12px; }
.paire + .paire { margin-top: 12px; }
.paire dt {
  font-size: 10px;
  font-weight: 300;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--grey);
}
.paire dd { margin: 3px 0 0; font-size: 14px; font-weight: 800; line-height: 1.3; }

.grille-2 { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grille-2 .paire { margin-top: 0; }
.grille-2 dd { font-size: 13px; }

.separateur { height: 1px; background: var(--bg); margin: 12px 0; }

.contact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--sunken);
  border-radius: var(--radius-field);
}
.contact + .contact { margin-top: 10px; }
.contact .corps { flex: 1; min-width: 0; }
.contact .num { margin-top: 2px; font-size: 15px; font-weight: 800; letter-spacing: .02em; }
.rond {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: var(--pill);
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 120ms var(--ease);
}
.rond:hover { background: var(--red-hover); }

.carte-mini { height: 188px; background: var(--bg); }

.pied-carte {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px 14px;
}
.pied-carte small { font-size: 10px; font-weight: 400; color: var(--grey); }
.pied-carte a { text-decoration: none; }

/* --------------------------------------------------------------- photos */

.pellicule {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.pellicule::-webkit-scrollbar { display: none; }

.photo {
  position: relative;
  flex: none;
  width: 152px;
  height: 112px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg);
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .suppr {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: var(--pill);
  background: rgba(26, 26, 25, .7);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ajout-photo {
  flex: none;
  width: 152px;
  height: 112px;
  border-radius: 12px;
  border: 1px dashed var(--line-strong);
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: border-color 120ms var(--ease);
}
.ajout-photo:hover { border-color: var(--red); }
.ajout-photo span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--grey);
}

.legende {
  margin-top: 8px;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--grey);
}

/* --------------------------------------------------------- réalisations */

.kpis { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 14px 12px;
}
.kpi b {
  display: block;
  margin-top: 10px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
}
.kpi span {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 300;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--grey);
  line-height: 1.3;
}

.bloc-ca {
  margin-top: 8px;
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 16px;
}
.bloc-ca .bloc-titre { color: rgba(255, 255, 255, .72); }
.bloc-ca b {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -.02em;
}

/* ------------------------------------------------------------ remarques */

.remarques textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--sunken);
  font-size: 13px;
  line-height: 1.5;
  outline: none;
  transition: border-color 120ms var(--ease), box-shadow 120ms var(--ease);
}
.remarques textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(224, 8, 0, .28); }

.remarques-pied {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.remarques-pied small { flex: 1; font-size: 10px; font-weight: 400; color: var(--grey); }

/* ---------------------------------------------------------------- badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--pill);
  background: #fff;
  color: var(--success);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.retour {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 12px 0 8px;
  border-radius: var(--pill);
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.retour:hover { background: rgba(255, 255, 255, .28); }

.etiquette-code {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--pill);
  background: rgba(0, 0, 0, .22);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
}

/* --------------------------------------------------------------- onglets */

.onglets {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  height: 78px;
  padding: 8px 12px calc(16px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .94);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  backdrop-filter: blur(14px);
}

.onglet {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-top: 4px;
  color: var(--grey);
}
.onglet span { font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.onglet--actif { color: var(--red); }

/* ------------------------------------------------------- panneau filtres */

.voile {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: rgba(26, 26, 25, .55);
  backdrop-filter: blur(14px);
}
.voile > .zone { flex: 1; }

.panneau {
  flex: none;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 18px 20px calc(32px + env(safe-area-inset-bottom));
  animation: monte 220ms var(--ease);
}
@keyframes monte {
  from { transform: translateY(14px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.panneau-haut {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panneau-haut b { font-size: 15px; font-weight: 800; }

.champ { margin-top: 12px; }
.champ label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--ink);
  margin-bottom: 5px;
}
.champ select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-field);
  background: #fff;
  font-size: 13px;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23676766' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.champ select:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(224, 8, 0, .28); }

.panneau-actions { margin-top: 18px; display: flex; gap: 10px; }

/* ----------------------------------------------------------------- toast */

.toast {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 100px;
  z-index: 90;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: var(--shadow-lg);
  animation: monte 200ms var(--ease);
}
.toast--erreur { background: var(--red); }

/* --------------------------------------------------------------- divers */

.chargement {
  padding: 40px 16px;
  text-align: center;
  font-size: 12px;
  font-weight: 300;
  color: var(--grey);
}

.info-carte {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 102px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  font-size: 11px;
  font-weight: 300;
  color: var(--grey);
  line-height: 1.45;
}

.leaflet-container { font-family: inherit; }

/* ------------------------------------------------------------ connexion */

.page-connexion {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  background: var(--red);
}

.carte-connexion {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: var(--radius-card);
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
}
.carte-connexion h1 {
  margin: 18px 0 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.carte-connexion p { margin: 8px 0 0; font-size: 13px; font-weight: 300; color: var(--grey); line-height: 1.5; }

.champ input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-field);
  background: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 120ms var(--ease), box-shadow 120ms var(--ease);
}
.champ input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(224, 8, 0, .28); }

.erreur-connexion {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-field);
  background: var(--sunken);
  border-left: 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--red);
}
