/* ============================================================
   Variables & reset
   ============================================================ */
:root {
  --green: #0a8f78;          /* vert principal (boutons) - screen 1 */
  --green-dark: #077963;
  --navy: #1b2634;           /* bleu nuit du footer - screen 4/5 */
  --navy-line: #33404f;      /* trait séparateur clair sur navy - screen 6 */
  --black: #10161f;          /* bas de footer noir */
  --text: #1c2430;
  --text-soft: #5b6675;
  --border: #cfd6dd;
  --bg: #ffffff;
  --radius: 12px;
  --max: 480px;              /* largeur max mobile-first */
  --header-h: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* Conteneur centré, marges logiques sur les bords */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================================
   Header (statique / sticky - reste visible au défilement)
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  height: var(--header-h);
  border-bottom: 1px solid #eef1f4;
  display: flex;
  align-items: center;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Bouton menu : 3 traits aux bords arrondis */
.burger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 34px;
}
.burger span {
  display: block;
  height: 3px;
  width: 24px;
  background: var(--text);
  border-radius: 999px;
}

.brand {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: .5px;
  color: var(--green);
  text-decoration: none;
}
.brand img {
  display: block;
  width: 92px;
  height: auto;
  max-height: 38px;
  object-fit: contain;
}

/* Zone droite : Contact + icône profil (screen 2) */
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-right .contact {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
  color: var(--text);
  text-decoration: none;
  gap: 2px;
}
.header-right .contact svg { width: 22px; height: 22px; }
.profile-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--green);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.profile-btn svg { width: 20px; height: 20px; }

.success-logo {
  display: flex;
  justify-content: center;
  padding-top: 42px;
}
.success-logo svg {
  width: 136px;
  height: 136px;
  overflow: visible;
}
.success-logo circle,
.success-logo path {
  fill: none;
  stroke: #22c879;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.success-logo circle { stroke-width: 2.5; }
.success-logo path { stroke-width: 4; }
.success-message {
  padding: 26px 20px 0;
  text-align: center;
}
.success-message h1 {
  font-size: 26px;
  line-height: 1.25;
  font-weight: 700;
}
.success-message p {
  margin-top: 14px;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.5;
}
.security-results {
  padding: 36px 20px 30px;
}
.security-notice {
  display: flex;
  gap: 16px;
  padding: 22px 20px;
  align-items: flex-start;
  border-left: 6px solid #22c879;
  border-radius: 8px;
  background: #effaf5;
  color: var(--text);
}
.notice-icon,
.suspicious-devices svg {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}
.security-notice .notice-icon { color: #147d60; }
.security-notice h2 {
  margin-bottom: 8px;
  color: #147d60;
  font-size: 19px;
  line-height: 1.25;
}
.security-notice p {
  font-size: 17px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.suspicious-devices {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 28px;
  padding: 8px 18px;
  border: 2px solid #e59ab2;
  border-radius: 999px;
  color: #9e2948;
  font-size: 16px;
}
.suspicious-devices svg { width: 19px; height: 19px; }
.device-list {
  margin: 0 16px;
  border: 1px solid #d9d8e1;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.device-list-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 17px 22px;
  border-bottom: 1px solid #dedde5;
  color: #5f5d78;
  font-size: 16px;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.device-list-title svg,
.device-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}
.device-list-title svg { color: #a9264b; }
.device-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid #e6e5eb;
}
.device-row:last-child { border-bottom: 0; }
.device-icon {
  display: grid;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  background: #fceaf1;
  color: #a9264b;
}
.device-info { min-width: 0; flex: 1; }
.device-info h3 { font-size: 17px; line-height: 1.35; }
.device-info p { margin-top: 4px; color: #707084; font-size: 15px; line-height: 1.35; }
.device-info strong { display: block; margin-top: 8px; color: #a12849; font-size: 15px; }
.location-icon {
  width: 17px;
  height: 17px;
  margin-right: 5px;
  vertical-align: -3px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}
.device-status {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid #df8fac;
  border-radius: 50%;
  color: #a12849;
  font-size: 28px;
  line-height: 1;
}
.device-row.is-trusted { background: #fbfdfe; }
.device-row.is-trusted .device-icon { background: #effaf5; color: #168160; }
.device-row.is-trusted .device-info strong { color: #168160; }
.device-row.is-trusted .device-status { border-color: #7bdcb7; color: #168160; font-size: 22px; }
.close-page {
  display: block;
  width: calc(100% - 32px);
  margin: 40px 16px 28px;
  padding: 16px 20px;
  border: 0;
  border-radius: 999px;
  background: #16885f;
  color: #fff;
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 520px) {
  .security-results { padding: 28px 12px 24px; }
  .security-notice { gap: 11px; padding: 18px 14px; border-left-width: 5px; }
  .security-notice h2 { margin-bottom: 7px; font-size: 17px; }
  .security-notice p { font-size: 15px; line-height: 1.55; }
  .suspicious-devices { max-width: 100%; margin-top: 22px; padding: 8px 13px; font-size: 14px; }
  .device-list { margin: 0 12px; }
  .device-list-title { gap: 8px; padding: 15px 14px; font-size: 13px; letter-spacing: .25px; }
  .device-row { gap: 10px; padding: 17px 14px; }
  .device-icon { flex-basis: 42px; width: 42px; height: 42px; }
  .device-icon svg { width: 20px; height: 20px; }
  .device-info h3 { font-size: 15px; }
  .device-info p,
  .device-info strong { font-size: 13px; }
  .device-status { flex-basis: 30px; width: 30px; height: 30px; font-size: 24px; }
  .close-page { width: calc(100% - 24px); margin: 30px 12px 24px; font-size: 18px; }
}

/* ============================================================
   Menu latéral (ouvert par le burger)
   ============================================================ */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease;
  z-index: 200;
}
.menu-overlay.open { opacity: 1; visibility: visible; }

.side-menu {
  position: fixed;
  top: 0; left: 0;
  height: 100%;
  width: 82%;
  max-width: 340px;
  background: #fff;
  z-index: 210;
  transform: translateX(-100%);
  transition: transform .25s ease;
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  overflow-y: auto;
}
.side-menu.open { transform: translateX(0); }
.side-menu .menu-close {
  align-self: flex-end;
  background: none; border: none; font-size: 26px;
  cursor: pointer; color: var(--text); line-height: 1;
}
.side-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 4px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  border-bottom: 1px solid #eef1f4;
}
.side-menu a svg { width: 20px; height: 20px; color: var(--green); }

/* ============================================================
   Boutons / champs génériques
   ============================================================ */
.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 15px 20px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background .15s ease;
}
.btn:hover { background: var(--green-dark); }
.btn:active { transform: translateY(1px); }

.field-label {
  display: block;
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 6px;
}

/* Champ texte / faux-select (screen 3) */
.input,
.fake-select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px 44px 14px 14px;
  font-size: 15px;
  color: var(--text);
  position: relative;
}
.input:focus { outline: 2px solid var(--green); border-color: var(--green); }
.input::placeholder { color: #9aa4af; }

.input-wrap { position: relative; }
.input-wrap .clear-btn,
.input-wrap .chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--green);
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center;
}
.input-wrap .clear-btn svg,
.input-wrap .chevron svg { width: 20px; height: 20px; }

.fake-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: #9aa4af;
}
.fake-select.filled { color: var(--text); }
.fake-select .select-arrow {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-right: 24px;
  color: var(--green);
}

/* ============================================================
   Page 1 : hero
   ============================================================ */
.hero { padding: 34px 0 10px; }
.hero h1 {
  font-size: 30px;
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: 12px;
}
.hero .subtitle {
  font-size: 15px;
  color: var(--text-soft);
  margin-bottom: 26px;
}
.hero .field-block { margin-bottom: 16px; }

.or-sep {
  text-align: center;
  color: var(--text-soft);
  font-weight: 700;
  font-size: 13px;
  margin: 22px 0;
  letter-spacing: 1px;
}

.gap-lg { height: 70px; }

/* ============================================================
   Liste des régions (dropdown)
   ============================================================ */
.region-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 6px;
  max-height: 320px;
  overflow-y: auto;
  display: none;
}
.region-list.open { display: block; }
.region-list button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid #eef1f4;
  padding: 14px 16px;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
}
.region-list button:last-child { border-bottom: none; }
.region-list button:hover { background: #f4faf8; color: var(--green); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { background: var(--navy); color: #fff; }
.footer-top {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 26px 0 20px;
}
.footer-top a {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.footer-top a svg { width: 20px; height: 20px; }

.footer-logo {
  text-align: center;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 1px;
  padding: 6px 0 26px;
  color: #fff;
}
.footer-logo img {
  display: inline-block;
  width: 120px;
  height: 42px;
  object-fit: contain;
  vertical-align: middle;
}

/* Catégories : trait clair + texte gras + flèche */
.footer-cats { border-top: 1px solid var(--navy-line); }
.footer-cats details {
  border-bottom: 1px solid var(--navy-line);
}
.footer-cats summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  font-weight: 700;
  font-size: 15px;
}
.footer-cats summary::-webkit-details-marker { display: none; }
.footer-cats summary .chev {
  transition: transform .2s ease;
  display: flex;
}
.footer-cats summary .chev svg { width: 18px; height: 18px; }
.footer-cats details[open] summary .chev { transform: rotate(180deg); }
.footer-cats .cat-content {
  padding: 0 20px 16px;
  font-size: 14px;
  color: #c3ccd6;
}
.footer-cats .cat-content a {
  display: block;
  padding: 6px 0;
  text-decoration: none;
  color: #c3ccd6;
}

/* Bas de footer noir : 4 liens soulignés, un par ligne */
.footer-bottom { background: var(--black); padding: 22px 20px 30px; }
.footer-bottom a {
  display: block;
  color: #fff;
  text-decoration: underline;
  font-size: 14px;
  padding: 8px 0;
}

/* ============================================================
   Page 2 : identifiant + bande verte + cartes
   ============================================================ */
.page-title {
  text-align: center;
  font-weight: 700;
  font-size: 26px;
  line-height: 1.25;
  padding: 32px 0 24px;
}

.login-block { padding-bottom: 8px; }
.login-block .field-block { margin-bottom: 14px; }
.help-link {
  display: inline-block;
  color: var(--green);
  font-weight: 600;
  font-size: 14px;
  text-decoration: underline;
  margin: 4px 0 22px;
}

/* Bande verte pâle pleine largeur (colle les bords, pas d'arrondi) */
.green-band {
  background: #e9f4ef;
  color: var(--text);
  border-radius: 0;
  padding: 24px 20px;
  width: 100vw;
  margin: 30px calc(50% - 50vw) 34px;
}
.green-band .band-title {
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 14px;
  color: var(--text);
}
.band-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: #fff;
  color: var(--text);
  border: none;
  border-radius: var(--radius);
  padding: 16px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
}
.band-btn .ico { display: flex; align-items: center; gap: 12px; }
.band-btn .ico svg { width: 22px; height: 22px; color: var(--green); }
.band-btn .arrow svg { width: 20px; height: 20px; color: var(--green); }

/* Section cartes */
.cards-title {
  font-weight: 700;
  font-size: 20px;
  margin: 6px 0 18px;
}
.card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.card .card-ico {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border-radius: 9px;
  background: #eef3f1;
  color: var(--green);
  display: flex; align-items: center; justify-content: center;
}
.card .card-ico svg { width: 19px; height: 19px; }
.card .card-body { flex: 1; }
.card .card-body h3 { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.card .card-body p { font-size: 13px; color: var(--text-soft); margin-bottom: 6px; line-height: 1.4; }
.card .card-body .access {
  color: var(--green);
  font-weight: 600;
  font-size: 13px;
  text-decoration: underline;
}

/* ============================================================
   Page 3 : code personnel (clavier)
   ============================================================ */
.code-wrap { padding: 4px 0 40px; max-width: 350px; margin: 0 auto; }
.code-heading { font-weight: 600; font-size: 15px; color: var(--text); margin-bottom: 2px; }
.code-label { font-size: 13px; color: var(--text-soft); margin-bottom: 14px; }

.code-dots {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.code-dots .cell {
  width: 42px;
  height: 52px;
  border: 1px solid #333b47;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--text-soft);
}
.code-dots .cell::after { content: "-"; }
.code-dots .cell.filled { color: var(--text); }
.code-dots .cell.filled::after { content: "•"; }
.code-dots.reveal .cell.filled::after { content: attr(data-val); font-size: 20px; }
.code-dots .eye {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid #e4ebe8;
  color: var(--green);
  background: #edf3f1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  margin-left: 6px;
}
.code-dots .eye svg { width: 20px; height: 20px; }

.forgot {
  display: inline-block;
  color: var(--green);
  text-decoration: underline;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 26px;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 6px;
  margin: 4px 0 28px;
}
.keypad button {
  background: none;
  border: none;
  font-size: 24px;
  font-weight: 300;
  padding: 18px 0;
  cursor: pointer;
  color: var(--text);
  border-radius: 10px;
}
.keypad button.empty {
  cursor: default;
}
.keypad button:not(.empty):hover { background: #f4f6f8; }
.keypad button.del { color: var(--green); }

/* Bas de page : Se connecter centré, Retour centré en dessous */
.code-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.code-actions .btn {
  width: auto;
  padding: 14px 40px;
}
.code-actions .back {
  color: var(--text);
  text-decoration: underline;
  font-weight: 600;
  font-size: 15px;
}

/* Traits des icônes plus fins */
.card-ico svg,
.band-btn svg,
.header-right svg,
.side-menu a svg,
.footer-cats summary svg,
.code-dots .eye svg { stroke-width: 1.6; }

/* ============================================================
   Utilitaires
   ============================================================ */
.section { padding: 8px 0; }
.mb-24 { margin-bottom: 24px; }
