/* Page de connexion — design n° 4 « Montagnes » (Meridian Protect) */
.lp {
  --navy: #0B2A55; --ink: #13325E; --muted: #5B7392; --blue: #0A5FD6; --blue-d: #0049B0; --sky: #2F8FF0;
  --line: #D3E2F2; --soft: #EEF4FC; --bg: #EDF5FD;
  position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink);
  background: linear-gradient(180deg, #F3F8FE 0%, var(--bg) 60%, #E6F0FB 100%); overflow: hidden;
}
body:has(.lp) { background: var(--bg, #EDF5FD); }
.lp *, .lp *::before, .lp *::after { box-sizing: border-box; }

/* ---------- Paysage ---------- */
.lp-hero { position: absolute; inset: 0 0 auto 0; height: clamp(460px, 72vh, 700px); pointer-events: none; z-index: 0; }
.lp-hero img.lp-photo { position: absolute; top: 0; left: 0; width: 124%; height: 100%; object-fit: cover; object-position: 50% 78%; }
.lp-hero::before {   /* voile clair à gauche (lisibilité du texte) + fondu vers le bas */
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(90deg, rgba(240,247,255,.92) 0%, rgba(240,247,255,.62) 26%, rgba(240,247,255,.08) 52%, rgba(240,247,255,0) 70%),
    linear-gradient(180deg, rgba(240,247,255,.55) 0%, rgba(240,247,255,0) 18%, rgba(237,245,253,0) 58%, var(--bg) 100%);
}
.lp-band { position: absolute; z-index: 2; left: 0; right: 0; }
.lp-band.b1 {   /* grande bande bleue en diagonale */
  top: 47%; height: 36%;
  background: linear-gradient(100deg, rgba(47,143,240,.62) 0%, rgba(47,143,240,.30) 26%, rgba(47,143,240,0) 44%);
  clip-path: polygon(0 18%, 46% 74%, 46% 86%, 0 42%);
}
.lp-band.b2 {
  top: 42%; height: 40%;
  background: linear-gradient(100deg, rgba(120,190,250,.5), rgba(120,190,250,0) 48%);
  clip-path: polygon(0 0, 50% 60%, 50% 66%, 0 11%);
}
.lp-band.b3 {   /* trame technique */
  top: 47%; height: 28%; opacity: .35;
  background-image: linear-gradient(rgba(255,255,255,.7) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.7) 1px, transparent 1px);
  background-size: 14px 14px;
  clip-path: polygon(0 12%, 26% 46%, 26% 72%, 0 52%);
  -webkit-mask-image: linear-gradient(90deg, #000, transparent); mask-image: linear-gradient(90deg, #000, transparent);
}
.lp-band.b4 {   /* reflet bleu à droite, derrière la carte */
  top: 39%; height: 34%; left: auto; width: 34%;
  background: linear-gradient(200deg, rgba(47,143,240,.75), rgba(47,143,240,0) 70%);
  clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%);
  opacity: .5;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 45%, transparent); mask-image: linear-gradient(180deg, transparent, #000 45%, transparent);
}
.lp-mark {   /* grand « M » translucide en filigrane */
  position: absolute; z-index: 2; left: 7%; top: 70px; width: 300px; opacity: .22;
  filter: brightness(0) invert(1) drop-shadow(0 0 30px rgba(255,255,255,.6));
}
.lp-mark.ghost { left: 1%; top: 60px; width: 420px; opacity: .10; }

/* ---------- En-tête ---------- */
.lp-top { position: relative; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1240px; width: 100%; margin: 0 auto; padding: 26px 48px 0; }
.lp-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.lp-brand img { width: 62px; height: auto; display: block; }
.lp-word { display: grid; line-height: 1; }
.lp-word strong { font-family: Archivo, Inter, sans-serif; font-stretch: 125%; font-weight: 800; font-size: 20px; letter-spacing: .01em; color: var(--navy); white-space: nowrap; }
.lp-word strong span { color: #1E73E8; }
.lp-word small { margin-top: 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; color: var(--ink); text-transform: uppercase; }
.lp-private { display: flex; align-items: center; gap: 10px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; color: var(--navy); text-transform: uppercase; white-space: nowrap; }
.lp-private svg { flex: none; }

/* ---------- Contenu ---------- */
.lp-main { position: relative; z-index: 4; flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 48px 24px;
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr); column-gap: 7%; align-items: start; }
.lp-intro { padding-top: clamp(130px, calc(100vh - 560px), 400px); max-width: 600px; }
.lp-eyebrow { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; font-size: 12px; font-weight: 700; letter-spacing: .16em; color: var(--blue); text-transform: uppercase; }
.lp-eyebrow::before { content: ""; width: 36px; height: 2px; background: var(--blue); border-radius: 2px; }
.lp-intro h1 { margin: 0 0 22px; font-size: clamp(36px, 3.7vw, 50px); line-height: 1.06; letter-spacing: -.03em; font-weight: 800; color: var(--navy); }
.lp-desc { margin: 0; font-size: 16px; line-height: 1.65; color: #1E3B63; max-width: 470px; }
.lp-features { list-style: none; padding: 0; margin: 26px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.lp-features li { display: flex; align-items: center; gap: 12px; font-size: 13.5px; line-height: 1.35; color: #1E3B63; }
.lp-features br { display: none; }
.lp-ico { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: #DCEBFA; color: var(--navy); }

/* ---------- Carte de connexion ---------- */
.lp-login { padding-top: clamp(16px, calc(100vh - 650px), 250px); display: flex; justify-content: flex-end; }
.lp-card { width: 100%; max-width: 440px; background: #fff; border-radius: 14px; padding: 32px 30px 28px; box-shadow: 0 24px 60px rgba(22,79,132,.16), 0 2px 6px rgba(22,79,132,.06); }
.lp-card h2 { margin: 0; font-size: 27px; font-weight: 700; letter-spacing: -.02em; color: var(--navy); }
.lp-sub { margin: 8px 0 26px; font-size: 14.5px; color: var(--muted); }
.lp-card label { display: block; margin: 0 0 9px; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--navy); text-transform: uppercase; }
.lp-field { position: relative; margin-bottom: 22px; }
.lp-field > svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #4A6283; pointer-events: none; }
.lp-card input[type=text], .lp-card input[type=password], .lp-card input[type=email] {
  width: 100%; height: 50px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  padding: 0 46px 0 46px; font: inherit; font-size: 15px; color: var(--ink); outline: none; box-shadow: none; margin: 0;
  transition: border-color .15s, box-shadow .15s;
}
.lp-card input::placeholder { color: #8296B0; }
.lp-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10,95,214,.14); }
.lp-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: transparent; color: #36557E; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.lp-eye:hover { background: var(--soft); }
.lp-eye .off { display: none; }
.lp-eye[aria-pressed="true"] .on { display: none; }
.lp-eye[aria-pressed="true"] .off { display: block; }
.lp-error { margin: -6px 0 14px; padding: 10px 12px; border-radius: 8px; background: #FEF3F2; color: #B42318; font-size: 13.5px; line-height: 1.45; }
.lp-info { margin: 0 0 18px; padding: 10px 12px; border-radius: 8px; background: #FFFAEB; color: #93370D; font-size: 13.5px; line-height: 1.45; }
.lp-submit { width: 100%; min-height: 52px; margin-top: 4px; border: 0; border-radius: 8px; background: var(--blue); color: #fff; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 8px 20px rgba(10,95,214,.25); transition: background .15s, transform .05s; }
.lp-submit:hover { background: var(--blue-d); }
.lp-submit:active { transform: translateY(1px); }
.lp-submit:disabled { opacity: .7; cursor: progress; }
.lp-faceid { margin-top: 12px; }
.lp-faceid[hidden] { display: none !important; }
.lp-faceid button { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--navy); cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px; }
.lp-faceid button:hover { background: var(--soft); border-color: #B9D0EA; }
.lp-faceid .err { margin: 8px 0 0; color: #B42318; font-size: 13px; }
.lp-faceid .err:empty { display: none; }
.lp-notice { display: flex; align-items: center; gap: 16px; margin: 20px 0 0; padding: 16px 18px; border-radius: 9px; background: var(--soft); font-size: 13.5px; line-height: 1.5; color: #23436E; }
.lp-notice svg { flex: none; color: var(--navy); }

/* ---------- Pied de page ---------- */
.lp-foot { position: relative; z-index: 4; border-top: 1px solid #DCE8F5; background: rgba(255,255,255,.45); }
.lp-foot div { max-width: 1240px; margin: 0 auto; padding: 18px 48px; display: flex; justify-content: space-between; gap: 16px; font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.lp-foot span:last-child { text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Tablette ---------- */
@media (max-width: 1080px) {
  .lp-main { column-gap: 5%; padding: 0 32px 40px; grid-template-columns: minmax(0, 1fr) minmax(340px, 1fr); }
  .lp-top { padding: 22px 32px 0; }
  .lp-foot div { padding: 18px 32px; }
  .lp-features { grid-template-columns: 1fr; gap: 10px; margin-top: 20px; }
  .lp-intro { padding-top: clamp(96px, calc(100vh - 670px), 380px); }
  .lp-login { padding-top: clamp(16px, calc(100vh - 670px), 230px); }
  .lp-band.b4 { width: 45%; }
}

/* ---------- Smartphone ---------- */
@media (max-width: 820px) {
  .lp { background: linear-gradient(180deg, #F3F8FE, var(--bg) 40%, #E9F2FC); }
  .lp-top { position: relative; padding: 14px 20px; background: rgba(255,255,255,.96); box-shadow: 0 1px 0 #E3ECF6; }
  .lp-brand img { width: 50px; }
  .lp-word strong { font-size: 16px; }
  .lp-word small { font-size: 9px; margin-top: 5px; }
  .lp-private { flex-direction: column; gap: 6px; font-size: 9px; letter-spacing: .04em; padding-left: 16px; border-left: 1px solid #E3ECF6; align-self: stretch; justify-content: center; }
  .lp-hero { top: 0; height: 250px; }
  .lp-hero img.lp-photo { width: 100%; object-position: 64% 40%; }
  .lp-hero::before { background: linear-gradient(180deg, rgba(240,247,255,0) 0%, rgba(240,247,255,0) 62%, var(--bg) 97%), linear-gradient(90deg, rgba(240,247,255,.45), rgba(240,247,255,0) 45%); }
  .lp-band.b1, .lp-band.b2, .lp-band.b3, .lp-band.b4 { display: none; }
  .lp-mark { left: -14px; top: 74px; width: 190px; opacity: .25; }
  .lp-mark.ghost { display: none; }
  .lp-main { display: flex; flex-direction: column; padding: 0 20px 24px; }
  .lp-intro { display: contents; }
  .lp-eyebrow { order: 1; margin-top: 168px; }
  .lp-intro h1 { order: 2; }
  .lp-login { order: 3; }
  .lp-desc { order: 4; margin-top: 26px; }
  .lp-features { order: 5; }

  .lp-eyebrow { font-size: 11px; margin-bottom: 14px; }
  .lp-intro h1 { font-size: clamp(28px, 7.8vw, 36px); margin-bottom: 18px; }
  .lp-desc { font-size: 15px; line-height: 1.55; }
  .lp-features { margin-top: 20px; gap: 12px; grid-template-columns: 1fr; }
  .lp-features li { font-size: 14.5px; gap: 16px; }
  .lp-ico { width: 46px; height: 46px; }
  .lp-ico svg { width: 22px; height: 22px; }
  .lp-login { padding-top: 6px; justify-content: stretch; }
  .lp-card { max-width: none; padding: 24px 20px 20px; border-radius: 12px; }
  .lp-card h2 { font-size: 24px; }
  .lp-sub { margin-bottom: 22px; }
  .lp-foot { border-top: 0; background: transparent; }
  .lp-foot div { flex-direction: column; align-items: center; gap: 6px; padding: 8px 20px 26px; font-size: 11px; text-align: center; }
}
@media (max-width: 360px) {
  .lp-word strong { font-size: 14px; }
  .lp-brand img { width: 42px; }
  .lp-private { padding-left: 10px; }
}
@media (prefers-reduced-motion: no-preference) {
  .lp-card { animation: lpIn .45s ease both; }
  @keyframes lpIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}

/* Écrans d'ordinateur peu hauts : tout tient sans défiler */
@media (min-width: 821px) and (max-height: 760px) {
  .lp-top { padding-top: 16px; }
  .lp-intro h1 { font-size: clamp(30px, 3.2vw, 40px); margin-bottom: 14px; }
  .lp-eyebrow { margin-bottom: 12px; }
  .lp-desc { font-size: 14.5px; line-height: 1.55; }
  .lp-features { margin-top: 18px; }
  .lp-card { padding: 24px 26px 20px; }
  .lp-sub { margin-bottom: 18px; }
  .lp-field { margin-bottom: 16px; }
  .lp-card input[type=text], .lp-card input[type=password] { height: 46px; }
  .lp-notice { margin-top: 14px; padding: 12px 14px; }
  .lp-foot div { padding: 12px 48px; }
}

/* Petits téléphones : le bouton de connexion reste visible sans défiler */
@media (max-width: 820px) and (max-height: 720px) {
  .lp-hero { height: 190px; }
  .lp-mark { width: 140px; top: 66px; }
  .lp-eyebrow { margin-top: 116px; margin-bottom: 10px; }
  .lp-intro h1 { font-size: 26px; margin-bottom: 12px; }
  .lp-card { padding: 18px 18px 16px; }
  .lp-card h2 { font-size: 21px; }
  .lp-sub { margin: 4px 0 14px; font-size: 13.5px; }
  .lp-field { margin-bottom: 14px; }
  .lp-card label { margin-bottom: 6px; }
  .lp-card input[type=text], .lp-card input[type=password] { height: 46px; }
  .lp-submit { min-height: 48px; }
}
.lp-right { display: flex; align-items: center; gap: 22px; }
.lp-lang { display: flex; gap: 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; }
.lp-lang a { color: var(--muted); text-decoration: none; padding: 4px 6px; border-radius: 6px; }
.lp-lang a.on { color: var(--blue); background: rgba(10,95,214,.08); }
.lp-lang a:hover { color: var(--navy); }
@media (max-width: 820px) {
  .lp-right { flex-direction: column-reverse; align-items: center; gap: 6px; padding-left: 12px; border-left: 1px solid #E3ECF6; align-self: stretch; justify-content: center; }
  .lp-right .lp-private { border-left: 0; padding-left: 0; }
  .lp-lang { font-size: 9.5px; }
  .lp-lang a { padding: 2px 3px; }
}

/* Ordinateurs à fenêtre basse (appli installée, zoom navigateur, écran 125–150 %) : version compacte */
@media (min-width: 821px) and (max-height: 640px) {
  .lp-top { padding-top: 10px; }
  .lp-brand img { width: 48px; }
  .lp-intro { padding-top: clamp(60px, calc(100vh - 470px), 130px); }
  .lp-login { padding-top: 8px; }
  .lp-intro h1 { font-size: clamp(26px, 2.8vw, 34px); margin-bottom: 10px; }
  .lp-desc { font-size: 13.5px; line-height: 1.5; }
  .lp-features { margin-top: 12px; gap: 10px; }
  .lp-features li { font-size: 12.5px; }
  .lp-ico { width: 38px; height: 38px; }
  .lp-card { padding: 18px 22px 16px; }
  .lp-card h2 { font-size: 22px; }
  .lp-sub { margin: 4px 0 12px; font-size: 13.5px; }
  .lp-card label { margin-bottom: 5px; }
  .lp-field { margin-bottom: 12px; }
  .lp-card input[type=text], .lp-card input[type=password], .lp-card input[type=email] { height: 42px; }
  .lp-submit { min-height: 44px; }
  .lp-faceid { margin-top: 8px; }
  .lp-faceid button { min-height: 40px; }
  .lp-notice { margin-top: 10px; padding: 8px 12px; font-size: 12.5px; gap: 10px; }
  .lp-foot div { padding: 8px 48px; font-size: 11px; }
}
/* Filet de sécurité : si ça dépasse encore (très petite fenêtre), la page est réduite pour tenir sans défiler */
.lp { zoom: var(--lpz, 1); min-height: calc(100dvh / var(--lpz, 1)); }

/* ---------- Code oublié / réinitialisation ---------- */
.lp-forgot { margin: -14px 0 16px; text-align: right; font-size: 13px; }
.lp-forgot a, .lp-back a { color: var(--blue); text-decoration: none; font-weight: 600; }
.lp-forgot a:hover, .lp-back a:hover { text-decoration: underline; }
.lp-back { margin: 16px 0 0; text-align: center; font-size: 13.5px; }
a.lp-submit { text-decoration: none; }
.lp-ok { margin: 8px 0 20px; padding: 12px 14px; border-radius: 8px; background: #ECFDF3; color: #05603A; font-size: 14px; line-height: 1.5; }
.lp-newcode { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; padding: 14px 16px; border: 1px dashed #9CC0EA; border-radius: 10px; background: var(--soft); }
.lp-newcode code { font: 700 26px/1.1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .08em; color: var(--navy); user-select: all; }
.lp-copy { flex: none; border: 1px solid var(--line); background: #fff; color: var(--navy); border-radius: 8px; padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.lp-copy:hover { background: #fff; border-color: #B9D0EA; }
.lp-card input[type=email] { padding-left: 46px; }
@media (min-width: 821px) and (max-height: 640px) { .lp-forgot { margin: -8px 0 10px; } .lp-back { margin-top: 10px; } }

/* v49 — iPhone : l'en-tête tient en entier (« ACCÈS PRIVÉ » et les langues n'étaient plus visibles en entier),
   langues et œil plus faciles à toucher */
.lp-eye { width: 44px; height: 44px; right: 4px; }
@media (max-width: 820px) {
  .lp-top { padding: 12px 14px; gap: 10px; }
  .lp-brand { min-width: 0; }
  .lp-brand img { width: 40px; }
  .lp-word strong { font-size: 14.5px; }
  .lp-word small { font-size: 8px; letter-spacing: .1em; }
  .lp-right { flex: none; padding-left: 10px; }
  .lp-lang { font-size: 11px; gap: 0; }
  .lp-lang a { padding: 9px 4px; margin: -7px 0; }
}

/* v56 — Mode nuit (même réglage que le reste du site) */
html[data-theme="dark"] body:has(.lp) { background: #050B14; }
html[data-theme="dark"] .lp {
  --navy: #F3F6FA; --ink: #C9D6E8; --muted: #9DB0C8; --line: #23406A; --soft: #0E2038; --bg: #050B14;
  background: linear-gradient(180deg, #071426 0%, #050B14 60%, #050B14 100%); color-scheme: dark;
}
html[data-theme="dark"] .lp-hero img.lp-photo { filter: brightness(.45) saturate(.8); }
html[data-theme="dark"] .lp-hero::before {
  background:
    linear-gradient(90deg, rgba(5,11,20,.9) 0%, rgba(5,11,20,.55) 30%, rgba(5,11,20,.1) 60%, rgba(5,11,20,0) 75%),
    linear-gradient(180deg, rgba(5,11,20,.4) 0%, rgba(5,11,20,0) 20%, rgba(5,11,20,0) 55%, #050B14 100%);
}
html[data-theme="dark"] .lp-mark { opacity: .12; }
html[data-theme="dark"] .lp-desc, html[data-theme="dark"] .lp-features li { color: #C9D6E8; }
html[data-theme="dark"] .lp-card { background: #0B1A2E; box-shadow: 0 24px 60px rgba(0,0,0,.45); border: 1px solid #1C3354; }
html[data-theme="dark"] .lp-card :is(input[type=text], input[type=password], input[type=email]),
html[data-theme="dark"] .lp-field input { background: #0E2038; color: #F3F6FA; border-color: #2A4468; }
html[data-theme="dark"] .lp-card input::placeholder { color: #7D90AA; }
html[data-theme="dark"] :is(.lp-faceid button, .lp-copy, .lp-copy:hover) { background: #10243F; color: #F3F6FA; }
html[data-theme="dark"] .lp-eye { color: #9DB0C8; }
html[data-theme="dark"] .lp-eye:hover { background: #10243F; }
html[data-theme="dark"] .lp-foot { background: rgba(5,11,20,.6); border-color: #13263F; }
html[data-theme="dark"] .lp-error { background: #3A0F0A; color: #FDA29B; }
html[data-theme="dark"] .lp-info { background: #2B1D05; color: #FEC84B; }
@media (max-width: 820px) {
  html[data-theme="dark"] .lp { background: #050B14; }
  html[data-theme="dark"] .lp-top { background: rgba(7,20,38,.96); box-shadow: 0 1px 0 #13263F; }
  html[data-theme="dark"] .lp-right { border-color: #13263F; }
}
html[data-theme="dark"] .lp-notice { color: #C9D6E8; }
html[data-theme="dark"] .lp-ico { background: #0E2A4F; color: #9FCBFF; }
