/* Page de connexion et d'activation d'invitation : une marque, une phrase, un formulaire.
   Jetons --l-* : clair par defaut, sombre par html[data-theme="dark"] (assets/theme-init.js).
   Les couleurs d'une famille se substituent en redefinissant --l-accent / --l-on-accent. */
:root {
  /* Theme « Racines » (par defaut) ; Ndop et Toghu ci-dessous (attribut pose sur <html>). */
  --theme-band: url("/assets/themes/racines.svg");
  --l-bg: #f2f4ea;
  --l-surface: #ffffff;
  --l-text: #14261f;
  --l-muted: #476055;
  --l-line: #d5dcc6;
  --l-accent: #123d2f;
  --l-on-accent: #ffffff;
  --l-danger-bg: #fdecea;
  --l-danger: #8b2f2f;
  --l-halo: rgba(16, 48, 36, .1);
  --shadow-rgb: 16, 48, 36;
  color-scheme: light;
}
:root[data-direction="ndop"] { --theme-band: url("/assets/themes/ndop.svg"); }
:root[data-direction="ndop"]:not([data-theme="dark"]) {
  --l-bg: #eef1f8;
  --l-surface: #ffffff;
  --l-text: #0f1b3d;
  --l-muted: #43507a;
  --l-line: #ccd4ea;
  --l-accent: #132257;
  --l-on-accent: #ffffff;
  --l-halo: rgba(19, 34, 87, .1);
  --shadow-rgb: 19, 34, 87;
}
:root[data-direction="toghu"] { --theme-band: url("/assets/themes/toghu.svg"); }
:root[data-direction="toghu"]:not([data-theme="dark"]) {
  --l-bg: #fbf5ec;
  --l-surface: #ffffff;
  --l-text: #1e1210;
  --l-muted: #66504a;
  --l-line: #ead9c6;
  --l-accent: #9e1b20;
  --l-on-accent: #ffffff;
  --l-halo: rgba(60, 20, 10, .1);
  --shadow-rgb: 60, 20, 10;
}
:root[data-theme="dark"] {
  --shadow-rgb: 0, 0, 0;
  --l-bg: #0f1a15;
  --l-surface: #17261f;
  --l-text: #eef4e8;
  --l-muted: #b4c6ba;
  --l-line: rgba(238, 244, 232, .14);
  --l-accent: #d5e86a;
  --l-on-accent: #12210f;
  --l-danger-bg: #4b2a3b;
  --l-danger: #f2a7a7;
  --l-halo: rgba(213, 232, 106, .16);
  color-scheme: dark;
}
:root[data-direction="ndop"][data-theme="dark"] {
  --l-bg: #0b1128;
  --l-surface: #141c3d;
  --l-text: #eef1f8;
  --l-muted: #b6c0e6;
  --l-line: rgba(238, 241, 248, .15);
  --l-accent: #b4c4f7;
  --l-on-accent: #0b1128;
  --l-halo: rgba(180, 196, 247, .16);
  --shadow-rgb: 0, 0, 0;
}
:root[data-direction="toghu"][data-theme="dark"] {
  --l-bg: #17110f;
  --l-surface: #231b18;
  --l-text: #fbf3e6;
  --l-muted: #c9b8a6;
  --l-line: rgba(251, 243, 230, .15);
  --l-accent: #f5a14a;
  --l-on-accent: #1a0f05;
  --l-halo: rgba(245, 161, 74, .16);
  --shadow-rgb: 0, 0, 0;
}
/* Sans JavaScript (theme-init.js absent) : on suit quand meme la preference du systeme. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --l-bg: #0f1a15;
    --l-surface: #17261f;
    --l-text: #eef4e8;
    --l-muted: #b4c6ba;
    --l-line: rgba(238, 244, 232, .14);
    --l-accent: #d5e86a;
    --l-on-accent: #12210f;
    --l-danger-bg: #4b2a3b;
    --l-danger: #f2a7a7;
    --l-halo: rgba(213, 232, 106, .16);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body.landing-login {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(60rem 30rem at 85% -10%, var(--l-halo), transparent 60%),
    var(--l-bg);
  color: var(--l-text);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.5;
}

.login {
  min-height: 100vh;
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
}
.login-brand { display: flex; align-items: center; gap: .65rem; }
.login-crest {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 12px;
  background: var(--l-accent);
  color: var(--l-on-accent);
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
}
.login-name { font-weight: 700; letter-spacing: .01em; }

.login-grid {
  flex: 1;
  display: grid;
  gap: 2rem;
  align-items: center;
  align-content: center;
  padding-top: 1.5rem;
}
.login-intro h1 {
  margin: 0 0 .6rem;
  font-family: "Inter", system-ui, sans-serif;
  font-size: clamp(1.9rem, 6vw, 3rem);
  line-height: 1.1;
  font-weight: 600;
}
.login-lede { margin: 0 0 1.4rem; color: var(--l-muted); font-size: 1.05rem; max-width: 30ch; }
.login-points { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.login-points li {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .4rem .85rem .4rem .65rem;
  border: 1px solid var(--l-line);
  border-radius: 999px;
  background: var(--l-surface);
  font-size: .9rem;
  font-weight: 600;
}
.login-points svg { width: 1.15rem; height: 1.15rem; color: var(--l-accent); }

.login-card {
  background: var(--l-surface);
  border: 1px solid var(--l-line);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: 0 24px 48px rgba(var(--shadow-rgb), .12);
  width: 100%;
  max-width: 420px;
  justify-self: center;
}
.login-card h2 { margin: 0 0 1rem; font-size: 1.25rem; font-family: "Inter", system-ui, sans-serif; }
.login-form { display: grid; gap: .35rem; }
.login-form label { font-size: .9375rem; font-weight: 600; margin-top: .5rem; }
.login-form input {
  width: 100%;
  min-height: 52px;
  padding: .55rem .8rem;
  font: inherit;
  color: var(--l-text);
  background: var(--l-bg);
  border: 1px solid var(--l-line);
  border-radius: 12px;
}
.login-form input:focus-visible,
.login-btn:focus-visible,
.login-card a:focus-visible { outline: 3px solid var(--l-accent); outline-offset: 2px; }
.login-btn {
  margin-top: 1rem;
  min-height: 52px;
  font-size: 1.0625rem;
  border: none;
  border-radius: 14px;
  background: var(--l-accent);
  color: var(--l-on-accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.login-btn:hover { filter: brightness(1.06); }
.login-hint { margin: .5rem 0 0; font-size: .9375rem; color: var(--l-muted); }
/* Liens sous le formulaire : de vraies cibles tactiles (48 px), lisibles. */
.login-hint a { display: inline-flex; align-items: center; min-height: 48px; }
.login-card a { color: var(--l-accent); font-weight: 600; }
.landing-error {
  margin-bottom: .75rem;
  padding: .6rem .8rem;
  border-radius: 12px;
  background: var(--l-danger-bg);
  color: var(--l-danger);
  font-size: .9rem;
}

@media (min-width: 860px) {
  .login-grid { grid-template-columns: 1.1fr .9fr; gap: 3rem; }
  .login-card { justify-self: end; }
}
@media (prefers-reduced-motion: no-preference) {
  .login-btn { transition: filter .15s ease; }
}

/* ---------------------------------------------------------------------------------------------------------------
   Page d'accueil publique : photo de famille, ce que la famille y trouve, comment commencer.
   --------------------------------------------------------------------------------------------------------------- */
.login { max-width: 1120px; min-height: auto; }
.login-grid { min-height: calc(100vh - 6rem); }
.login-photo { margin: 1.75rem 0 0; max-width: 460px; }
.login-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center 30%;
  border-radius: 24px;
  border: 1px solid var(--l-line);
  box-shadow: 0 18px 40px rgba(var(--shadow-rgb), .14);
}
.showcase { padding: 3rem 0 0; }
.showcase h2 {
  margin: 0 0 1.25rem;
  font-family: "Inter", system-ui, sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  font-weight: 600;
  line-height: 1.15;
}
.showcase h3 { margin: 0 0 .35rem; font-size: 1.125rem; line-height: 1.3; }
.showcase p { margin: 0; color: var(--l-muted); font-size: 1rem; }
.showcase-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
@media (min-width: 720px) { .showcase-features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .showcase-features { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.showcase-features li {
  padding: 1.25rem;
  border: 1px solid var(--l-line);
  border-radius: 18px;
  background: var(--l-surface);
}
.showcase-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: .75rem;
  border-radius: 12px;
  background: var(--l-halo);
  color: var(--l-accent);
}
.showcase-icon svg { width: 26px; height: 26px; }
.showcase-steplist {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}
@media (min-width: 860px) { .showcase-steplist { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.showcase-steplist li { counter-increment: step; display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; }
.showcase-steplist li::before {
  content: counter(step);
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--l-accent);
  color: var(--l-on-accent);
  font-weight: 700;
  font-size: 1.125rem;
}
.showcase-cta { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; margin-top: 1.75rem; }
.showcase-btn {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 1.4rem;
  border-radius: 14px;
  background: var(--l-accent);
  color: var(--l-on-accent);
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
}
.showcase-link { display: inline-flex; align-items: center; min-height: 48px; color: var(--l-accent); font-weight: 600; }
.showcase-footer {
  margin-top: 3rem;
  padding: 1.25rem 0 .5rem;
  border-top: 1px solid var(--l-line);
  color: var(--l-muted);
  font-size: .9375rem;
}
.showcase-footer a { color: var(--l-accent); display: inline-flex; align-items: center; min-height: 44px; }
.showcase-btn:focus-visible, .showcase-link:focus-visible, .showcase-footer a:focus-visible { outline: 3px solid var(--l-accent); outline-offset: 2px; }
@media (max-width: 859.98px) {
  /* Mobile : photo en bandeau, pour que le formulaire de connexion reste proche du haut. */
  .login-photo { margin-top: 1.25rem; }
  .login-photo img { aspect-ratio: 16 / 9; }
}

body.landing-login::before { content: ""; display: block; height: 16px; background: var(--theme-band) repeat-x left center / 32px 16px; }
