/* ITS Ibelem – Carte de visite. Tokens issus de la charte graphique ITS Ibelem (avril 2019). */

/* Calibri est la police de la charte ; Carlito (OFL, métriques identiques) la remplace
   sur les appareils qui ne l'ont pas. Hébergée localement : aucun appel externe. */
@font-face { font-family: "Carlito"; font-weight: 400; font-display: swap; src: url("../fonts/carlito-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Carlito"; font-weight: 700; font-display: swap; src: url("../fonts/carlito-latin-700-normal.woff2") format("woff2"); }

:root {
  /* Palette de la charte */
  --navy: #3E4259;
  --navy-700: #33364A;
  --navy-800: #282B3B;
  --red: #EB4A55;        /* rouge corail (titres, accents) */
  --red-deep: #DF0023;   /* rouge du logo */
  --red-700: #D23A45;
  --salmon: #FFA798;
  --green: #22AA66;
  --green-2: #37C582;
  --periwinkle: #8699B7;
  --lavender: #E9E9FB;
  --lavender-50: #F4F4FD;
  /* Dérivés pour le texte (contrastes AA sur blanc) */
  --ink: #2F3246;
  --text-2: #50546C;
  --muted: #6B6F88;
  --border: #E1E1F0;
  --warn-soft: #FFF1D6;
  --font: "Calibri", "Carlito", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --shadow-brand: 0 8px 22px rgba(223, 0, 35, 0.26);
  --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 17px/1.45 var(--font);
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.itsc-i { width: 22px; height: 22px; flex: none; }

/* ---- Cadre ------------------------------------------------------------ */
.itsc {
  position: relative;
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: #fff;
  display: flex;
  flex-direction: column;
}

/* Sur ordinateur : la carte flotte sur le bleu nuit de la charte, avec ses formes rondes */
@media (min-width: 520px) {
  body {
    background:
      radial-gradient(420px 380px at 12% 18%, rgba(134, 153, 183, 0.28), transparent 70%),
      radial-gradient(360px 340px at 88% 82%, rgba(235, 74, 85, 0.22), transparent 70%),
      radial-gradient(220px 200px at 82% 14%, rgba(255, 167, 152, 0.14), transparent 70%),
      var(--navy);
    background-attachment: fixed;
    padding: 40px 16px;
  }
  .itsc {
    min-height: 0;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(20, 22, 34, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
  }
}

/* ---- En-tête lavande + illustration de la charte ------------------------ */
.itsc-hero {
  position: relative;
  height: 212px;
  padding: calc(20px + env(safe-area-inset-top)) var(--gutter) 0;
  background: var(--lavender);
  overflow: hidden;
}
.itsc-blobs { position: absolute; inset: 0; width: 100%; height: 100%; }
.itsc-logo { position: relative; width: 128px; height: auto; }
.itsc-illu {
  position: absolute;
  right: -14px;
  top: calc(6px + env(safe-area-inset-top));
  width: 218px;
  height: auto;
}
.itsc-wave {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  width: 100%;
  height: 58px;
}

/* ---- Identité --------------------------------------------------------- */
.itsc-id { position: relative; padding: 0 var(--gutter); }
.itsc-photo {
  width: 112px; height: 112px;
  margin-top: -74px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-deep) 100%);
  box-shadow: 0 10px 24px rgba(62, 66, 89, 0.22);
  overflow: hidden;
  position: relative;
  display: grid;
  place-items: center;
}
.itsc-photo img { width: 100%; height: 100%; object-fit: cover; }
.itsc-photo span { font: 700 40px/1 var(--font); color: #fff; letter-spacing: 0.02em; }

.itsc-name {
  margin: 16px 0 0;
  font: 700 31px/1.12 var(--font);
  letter-spacing: -0.005em;
  color: var(--navy);
}
.itsc-role {
  margin: 6px 0 0;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.3;
  color: var(--red-700);
}
.itsc-org, .itsc-label {
  margin: 8px 0 0;
  font: 700 13px/1.2 var(--font);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Actions rapides -------------------------------------------------- */
.itsc-quick {
  display: grid;
  grid-template-columns: repeat(var(--n, 4), 1fr);
  gap: 8px;
  margin: 26px var(--gutter) 0;
}
.itsc-q {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-radius: 14px;
}
.itsc-q__ic {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--lavender);
  color: var(--navy);
  transition: background 180ms var(--ease), color 180ms var(--ease), transform 120ms var(--ease);
}
.itsc-q__lbl { font-size: 14px; font-weight: 700; color: var(--text-2); }
.itsc-q:hover .itsc-q__ic { background: var(--red); color: #fff; }
.itsc-q:active .itsc-q__ic { transform: translateY(1px); background: var(--red-700); color: #fff; }
.itsc-q:focus-visible { outline: none; }
.itsc-q:focus-visible .itsc-q__ic { box-shadow: 0 0 0 3px rgba(235, 74, 85, 0.4); }

/* ---- Bouton principal ------------------------------------------------- */
.itsc-cta { margin: 26px var(--gutter) 0; }
.itsc-save {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  height: 58px;
  border-radius: 14px;
  background: linear-gradient(100deg, var(--red) 0%, var(--red-deep) 100%);
  color: #fff;
  font: 700 19px/1 var(--font);
  letter-spacing: 0.01em;
  box-shadow: var(--shadow-brand);
  transition: background 180ms var(--ease), transform 120ms var(--ease), box-shadow 180ms var(--ease);
}
.itsc-save:hover { background: var(--red-deep); }
.itsc-save:active { transform: translateY(1px); background: #C4001F; box-shadow: 0 4px 12px rgba(223, 0, 35, 0.24); }
.itsc-save:focus-visible { outline: none; box-shadow: var(--shadow-brand), 0 0 0 3px #fff, 0 0 0 6px rgba(223, 0, 35, 0.45); }
.itsc-hint { margin: 10px 0 0; text-align: center; font-size: 14.5px; color: var(--muted); }
.itsc-inapp {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--warn-soft);
  color: #6B4E12;
  font-size: 15px;
  line-height: 1.4;
}

/* ---- Coordonnées ------------------------------------------------------ */
.itsc-block { margin: 30px var(--gutter) 0; }
.itsc-block .itsc-label { margin: 0 0 10px 2px; }
.itsc-list {
  list-style: none; margin: 0; padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.itsc-list li + li { border-top: 1px solid #EDEDF7; }
.itsc-list a {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  transition: background 180ms var(--ease);
}
.itsc-list a:hover, .itsc-list a:focus-visible { background: var(--lavender-50); outline: none; }
.itsc-list__ic {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--lavender);
  color: var(--navy);
  flex: none;
}
.itsc-list__ic .itsc-i { width: 20px; height: 20px; }
.itsc-list__txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.itsc-list__lbl { font-size: 14px; color: var(--muted); line-height: 1.3; }
.itsc-list__val {
  font-weight: 700; font-size: 17px; line-height: 1.3; color: var(--ink);
  overflow-wrap: anywhere;
}
.itsc-list a > .itsc-i { width: 18px; height: 18px; color: #B3B5C8; }

/* ---- Expertises (pastilles aux couleurs de la charte) ----------------- */
.itsc-tags {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.itsc-tags li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 10px;
  border-radius: 999px;
  background: var(--lavender-50);
  border: 1px solid var(--border);
  font-size: 15px; font-weight: 700; line-height: 1.2;
  color: var(--navy);
}
.itsc-tags li::before {
  content: "";
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--red);
  flex: none;
}
.itsc-tags li:nth-child(4n+2)::before { background: var(--green); }
.itsc-tags li:nth-child(4n+3)::before { background: var(--periwinkle); }
.itsc-tags li:nth-child(4n+4)::before { background: var(--salmon); }

/* ---- Partage ---------------------------------------------------------- */
.itsc-share {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin: 26px var(--gutter) 0;
}
.itsc-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--navy);
  font: 700 16px/1 var(--font);
  cursor: pointer;
  transition: background 180ms var(--ease), border-color 180ms var(--ease);
}
.itsc-btn .itsc-i { width: 19px; height: 19px; color: var(--red); }
.itsc-btn:hover { background: var(--lavender-50); border-color: #CFD0E6; }
.itsc-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(62, 66, 89, 0.3); }

/* ---- Pied : bandeau rouge de la charte -------------------------------- */
.itsc-foot {
  margin-top: auto;
  padding-top: 34px;
}
.itsc-foot p {
  margin: 0;
  padding: 11px var(--gutter) calc(11px + env(safe-area-inset-bottom));
  background: var(--red-deep);
  color: #fff;
  font-size: 13.5px;
  line-height: 1.35;
  text-align: center;
}
.itsc-foot strong { font-weight: 700; }
.itsc-foot span { color: rgba(255, 255, 255, 0.78); white-space: nowrap; }

/* ---- QR plein écran --------------------------------------------------- */
.itsc-dialog {
  width: min(360px, calc(100vw - 32px));
  padding: 28px 24px 22px;
  border: 0;
  border-radius: 22px;
  text-align: center;
  color: var(--ink);
  font-family: var(--font);
  box-shadow: 0 24px 60px rgba(40, 43, 59, 0.4);
}
.itsc-dialog::backdrop { background: rgba(40, 43, 59, 0.75); backdrop-filter: blur(3px); }
.itsc-dialog .itsc-label { margin: 0; }
.itsc-dialog__name { margin: 6px 0 18px; font: 700 23px/1.2 var(--font); color: var(--navy); }
.itsc-dialog__qr { width: 100%; aspect-ratio: 1; border-radius: 12px; overflow: hidden; }
.itsc-dialog__qr svg { width: 100%; height: 100%; display: block; }
.itsc-dialog__url { margin: 14px 0 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.itsc-dialog__close {
  position: absolute; top: 12px; right: 12px;
  width: 38px; height: 38px;
  border: 0; border-radius: 50%;
  background: var(--lavender); color: var(--navy);
  display: grid; place-items: center; cursor: pointer;
}
.itsc-dialog__close .itsc-i { width: 18px; height: 18px; }

/* ---- Notification ----------------------------------------------------- */
.itsc-toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  width: max-content; max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--navy);
  color: #fff;
  font-size: 16px; line-height: 1.4;
  box-shadow: 0 12px 28px rgba(40, 43, 59, 0.3);
  opacity: 0; pointer-events: none;
  transition: opacity 220ms var(--ease), transform 220ms var(--ease);
}
.itsc-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
