/* ============================================================
   FlowLab — Page d'accueil (portail) : layout blanc minimal.
   Style inspiré d'apps modernes (blanc/noir, grande typo, beaucoup
   d'espace, accent teal discret). S'appuie sur flowlab-ds.css.
   Chargée en dernier. Aucune logique / id / action modifiés.
   ============================================================ */

.portal-page {
  position: relative; z-index: 1; min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--fl-bg);
}

/* --- Header (collant, épuré) ------------------------------- */
.portal-header {
  position: sticky; top: 0; z-index: 50;
  width: 100%; margin: 0;
  padding: 16px max(24px, calc((100% - 1200px) / 2));
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  background: var(--fl-bg);
  border-bottom: 1px solid var(--fl-border);
  transition: background-color .3s ease, border-color .3s ease;
}
.portal-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mark {
  width: 40px; height: 40px; flex: 0 0 auto;
  border-radius: 11px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--fl-surface-2); border: 1px solid var(--fl-border);
}
.mark.logo-ready { padding: 0; gap: 0; }
.mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.portal-brand h1 { margin: 0; font-size: 20px; line-height: 1; letter-spacing: -.02em; }
.portal-brand p { margin: 3px 0 0; color: var(--fl-muted); font-size: 12px; font-weight: 500; }
.portal-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.portal-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 38px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid transparent; background: transparent;
  color: var(--fl-text-2); text-decoration: none; font-size: 14.5px; font-weight: 600;
  transition: color .18s ease, background-color .18s ease;
}
.portal-link:hover { color: var(--fl-text); background: var(--fl-surface-2); }

/* --- Conteneur principal ----------------------------------- */
.portal-main {
  width: 100%;
  padding-inline: max(24px, calc((100% - 1200px) / 2));
  display: block;
}

/* --- Hero --------------------------------------------------- */
.portal-hero-premium {
  display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(360px, .94fr);
  gap: 48px; align-items: center;
  padding: clamp(48px, 7vw, 96px) 0 clamp(40px, 5vw, 72px);
}
.hero-copy { min-width: 0; padding: 0; border: none; background: none; box-shadow: none; }
.portal-kicker, .kicker {
  display: inline-flex; align-items: center;
  color: var(--fl-text-2); font-size: 13px; font-weight: 600;
  text-transform: none; letter-spacing: 0; margin: 0 0 18px;
}
.portal-kicker::before, .kicker::before {
  content: ""; width: 6px; height: 6px; border-radius: 999px;
  background: var(--fl-accent); margin-right: 8px;
}
.hero-copy h1, .hero-copy h2 {
  margin: 0; max-width: 640px;
  font-weight: 800;
  font-size: clamp(34px, 5.2vw, 58px);
  line-height: 1.04; letter-spacing: -.035em;
  color: var(--fl-text);
}
.hero-lead {
  max-width: 520px; margin: 22px 0 0;
  color: var(--fl-text-2);
  font-size: clamp(16px, 1.5vw, 18px); line-height: 1.6;
}
.hero-actions { margin-top: 30px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-actions .portal-link { border: 1px solid var(--fl-border-2); }
.hero-actions .portal-link:hover { border-color: var(--fl-text-2); background: transparent; color: var(--fl-text); }

.proof-strip { margin-top: 34px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 560px; }
.proof-pill { min-width: 0; padding: 0; border: none; background: none; }
.proof-pill strong { display: block; color: var(--fl-text); font-size: 14px; font-weight: 700; }
.proof-pill span { display: block; margin-top: 3px; color: var(--fl-muted); font-size: 12.5px; line-height: 1.4; }

/* --- Panneau de connexion ---------------------------------- */
.secure-access-panel {
  min-width: 0;
  border: 1px solid var(--fl-border); border-radius: var(--fl-r-xl);
  background: var(--fl-surface); box-shadow: var(--fl-shadow); backdrop-filter: none;
  overflow: hidden;
}
.secure-access-panel .panel-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 24px 24px 18px; border-bottom: 1px solid var(--fl-border);
}
.secure-access-panel .panel-top .kicker { margin-bottom: 8px; }
.secure-access-panel .panel-top h2 { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.15; }
.secure-access-panel .panel-top p { margin: 8px 0 0; color: var(--fl-muted); font-size: 13.5px; line-height: 1.5; }
.secure-access-panel .views { padding: 22px 24px 26px; }
.secure-access-panel .login-card,
.secure-access-panel .change-password-card { width: 100%; margin: 0; padding: 0; background: none; border: none; border-radius: 0; box-shadow: none; }
.view { display: none; }
.view.active { display: block; }
.form-group { display: grid; gap: 8px; margin-bottom: 16px; }
.password-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.password-row input { min-width: 0; }

/* --- Sections (aérées, filets fins) ------------------------ */
.fl-feature-band {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px;
  padding: clamp(36px, 4vw, 56px) 0; border-top: 1px solid var(--fl-border);
}
.portal-section { background: transparent; border: none; border-top: 1px solid var(--fl-border); border-radius: 0; box-shadow: none; padding: clamp(48px, 6vw, 84px) 0; }
.portal-section-head { max-width: 720px; margin-bottom: 32px; }
.portal-section-head .portal-kicker { margin-bottom: 14px; }
.portal-section-head h2 {
  margin: 0; font-weight: 700;
  font-size: clamp(26px, 3.4vw, 40px); line-height: 1.08; letter-spacing: -.03em; color: var(--fl-text);
}
.portal-section-head p { margin: 14px 0 0; color: var(--fl-text-2); font-size: clamp(15px, 1.4vw, 16.5px); line-height: 1.6; }

.portal-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.portal-grid.problem-grid, .portal-grid.technical-grid, .portal-grid.target-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.portal-card {
  min-width: 0; min-height: 0; padding: 22px;
  border: 1px solid var(--fl-border); border-radius: var(--fl-r-lg);
  background: var(--fl-surface);
  transition: border-color .2s ease, transform .16s ease, box-shadow .2s ease;
}
.portal-card:hover { border-color: var(--fl-border-2); transform: translateY(-3px); box-shadow: var(--fl-shadow-sm); }
.portal-card .badge { margin-bottom: 14px; }
.portal-card strong { display: block; color: var(--fl-text); font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.portal-card span:not(.badge) { display: block; margin-top: 8px; color: var(--fl-text-2); font-size: 13.5px; line-height: 1.55; }

.fl-feature { padding: 0; border: none; background: none; }
.fl-feature strong { display: block; color: var(--fl-text); font-size: 15px; font-weight: 700; }
.fl-feature span { display: block; margin-top: 6px; color: var(--fl-muted); font-size: 13px; line-height: 1.5; }

.fl-card-ico {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  color: var(--fl-text); background: var(--fl-surface-2); border: 1px solid var(--fl-border); margin-bottom: 16px;
}
.fl-card-ico svg { width: 23px; height: 23px; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* --- Bande CTA inversée ------------------------------------ */
.portal-section#contact { border-top: none; }
.impact-band {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: clamp(32px, 4vw, 52px);
  border-radius: var(--fl-r-xl); border: 1px solid transparent;
  background: var(--fl-text); color: var(--fl-bg);
}
.impact-band .portal-kicker { color: var(--fl-bg); opacity: .7; }
.impact-band .portal-kicker::before { background: var(--fl-bg); }
.impact-band h2 { margin: 12px 0 0; font-weight: 700; font-size: clamp(22px, 2.6vw, 32px); line-height: 1.12; letter-spacing: -.03em; color: var(--fl-bg); max-width: 680px; }
.impact-band p { margin: 12px 0 0; color: var(--fl-bg); opacity: .72; font-size: 14.5px; line-height: 1.55; max-width: 620px; }
.impact-band .btn-primary { background: var(--fl-bg); border-color: var(--fl-bg); color: var(--fl-text); }
.impact-band .btn-primary:hover { background: var(--fl-surface-2); border-color: var(--fl-surface-2); color: var(--fl-text); }

/* --- Footer ------------------------------------------------- */
.portal-footer {
  width: 100%; margin: 0; padding: 32px max(24px, calc((100% - 1200px) / 2));
  border-top: 1px solid var(--fl-border);
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  color: var(--fl-muted); font-size: 13px;
}
.fl-foot-brand { display: flex; align-items: center; gap: 12px; }
.fl-foot-brand .mark { width: 38px; height: 38px; }
.fl-foot-brand strong { display: block; color: var(--fl-text); font-size: 15px; font-weight: 700; line-height: 1.1; }
.fl-foot-brand small { display: block; color: var(--fl-muted); font-size: 12px; margin-top: 3px; }
.fl-foot-nav { display: flex; gap: 20px; flex-wrap: wrap; }
.fl-foot-nav a { color: var(--fl-text-2); text-decoration: none; font-size: 14px; font-weight: 600; transition: color .18s ease; }
.fl-foot-nav a:hover { color: var(--fl-accent); }
.fl-foot-legal { color: var(--fl-muted); font-size: 12.5px; }

/* --- Vue connectée (modules) ------------------------------- */
.user-shell { display: grid; gap: 18px; padding-top: clamp(24px, 3vw, 40px); }
.user-card {
  padding: 20px; border-radius: var(--fl-r-lg);
  background: var(--fl-surface); border: 1px solid var(--fl-border);
  display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center;
}
.user-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.avatar {
  width: 52px; height: 52px; flex: 0 0 auto; border-radius: 14px; display: grid; place-items: center;
  background: var(--fl-text); color: var(--fl-bg); font-size: 17px; font-weight: 700;
}
.user-main h3 { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.2; }
.user-main p { margin: 6px 0 0; color: var(--fl-muted); font-size: 12.5px; line-height: 1.5; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }

.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.module-card {
  min-height: 152px; padding: 20px; border-radius: var(--fl-r-lg);
  background: var(--fl-surface); border: 1px solid var(--fl-border);
  display: flex; flex-direction: column; justify-content: space-between; cursor: pointer;
  transition: border-color .2s ease, transform .16s ease, box-shadow .2s ease;
}
.module-card:hover { border-color: var(--fl-text-2); transform: translateY(-3px); box-shadow: var(--fl-shadow-sm); }
.module-card:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--fl-ring); }
.module-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.module-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; color: var(--fl-text); background: var(--fl-surface-2); border: 1px solid var(--fl-border); }
.module-icon svg { width: 23px; height: 23px; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.module-card h3 { margin: 16px 0 0; font-size: 17px; font-weight: 700; }
.module-card p { margin: 7px 0 0; color: var(--fl-muted); font-size: 12.5px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.open-label { margin-top: 18px; color: var(--fl-text-2); font-size: 12.5px; font-weight: 600; }

.empty-state-pro { padding: 26px; border-radius: var(--fl-r-lg); background: var(--fl-surface); border: 1px solid var(--fl-border); text-align: center; color: var(--fl-muted); line-height: 1.6; }
.empty-state-pro strong { display: block; color: var(--fl-text); margin-bottom: 4px; }

/* --- Responsive -------------------------------------------- */
@media (max-width: 920px) {
  .portal-hero-premium { grid-template-columns: 1fr; gap: 32px; }
  .fl-feature-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-grid, .portal-grid.problem-grid, .portal-grid.technical-grid, .portal-grid.target-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .fl-feature-band { grid-template-columns: 1fr; }
  .portal-grid, .portal-grid.problem-grid, .portal-grid.technical-grid, .portal-grid.target-grid, .module-grid { grid-template-columns: 1fr; }
  .user-card { grid-template-columns: 1fr; }
  .proof-strip { grid-template-columns: 1fr 1fr; }
  .portal-footer { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* === Accueil : nav, visuel héros, splits image, bande ECG === */
.portal-nav { display: flex; align-items: center; gap: 4px; }
.portal-link-ghost { border: 1px solid var(--fl-border-2); }
.portal-link-ghost:hover { border-color: var(--fl-text-2); color: var(--fl-text); background: transparent; }

.hero-visual { min-width: 0; display: flex; align-items: center; justify-content: center; }
.hero-visual img { width: 100%; height: auto; max-height: 560px; object-fit: contain; display: block; }
.hero-visual.is-empty { width: 100%; min-height: 340px; border-radius: var(--fl-r-xl); background: var(--fl-surface-2); border: 1px solid var(--fl-border); }
.hero-visual.is-empty img { display: none; }

.fl-split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.fl-split-media { min-width: 0; }
.fl-split.reverse .fl-split-media { order: 2; }
.fl-split-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--fl-r-xl); filter: grayscale(1) contrast(1.03); display: block; }
.fl-split-media.is-empty { aspect-ratio: 4 / 3; border-radius: var(--fl-r-xl); background: var(--fl-surface-2); border: 1px solid var(--fl-border); }
.fl-split-media.is-empty img { display: none; }
.fl-split-text { min-width: 0; }
.fl-split-text .portal-kicker { margin-bottom: 12px; }
.fl-split-text h2 { margin: 0; font-weight: 700; font-size: clamp(24px, 3vw, 36px); line-height: 1.1; letter-spacing: -.03em; color: var(--fl-text); }
.fl-split-text p { margin: 14px 0 0; color: var(--fl-text-2); font-size: clamp(15px, 1.4vw, 16.5px); line-height: 1.6; }
.fl-split-text .btn { margin-top: 24px; }

.impact-band.has-bg { position: relative; overflow: hidden; background: #0c0e10; border-color: transparent; }
.impact-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .42; z-index: 0; filter: grayscale(1); }
.impact-band.has-bg > .impact-inner, .impact-band.has-bg > .btn { position: relative; z-index: 1; }
.impact-band.has-bg, .impact-band.has-bg h2, .impact-band.has-bg p { color: #ffffff; }
.impact-band.has-bg p { opacity: .82; }
.impact-band.has-bg .portal-kicker { color: #ffffff; opacity: .72; }
.impact-band.has-bg .portal-kicker::before { background: #ffffff; }
.impact-band.has-bg .btn-primary { background: #ffffff; border-color: #ffffff; color: #0c0e10; }
.impact-band.has-bg .btn-primary:hover { background: #e6e8ea; border-color: #e6e8ea; color: #0c0e10; }

@media (max-width: 920px) {
  .portal-nav { display: none; }
  .fl-split { grid-template-columns: 1fr; gap: 28px; }
  .fl-split.reverse .fl-split-media { order: 0; }
  .fl-split-media img, .fl-split-media.is-empty { aspect-ratio: 16 / 10; }
}
