/* Pryysm — écran d'accès anticipé et page 404.
   Reproduction du héros de la landing de la maquette (pryysm-web/src/pages/Landing.jsx, commit 563bf6d) :
   mêmes jetons (src/index.css), mêmes valeurs Tailwind converties en CSS (la CSP interdit le style inline,
   et la feuille compilée de la maquette reste derrière la porte). */

:root {
  color-scheme: dark;

  --color-ink: #0b0b0f;
  --color-ink-raised: #141419;
  --color-label: #f5f5f7;
  --color-label-tertiary: #9a9aa2;
  --color-accent: #635bff;
  --color-accent-strong: #544bf2;
  --color-critical: #ff453a;

  --ease-apple: cubic-bezier(0.32, 0.72, 0, 1);
  --shadow-float: 0 24px 64px -16px rgb(0 0 0 / 0.28), 0 4px 12px rgb(0 0 0 / 0.06), 0 0 0 1px rgb(0 0 0 / 0.05);

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background-color: var(--color-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-label);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.005em;
}

h1, h2, p { margin: 0; font: inherit; }

/* Comme le preflight Tailwind de la maquette : un lien hérite couleur et décoration. */
a { color: inherit; text-decoration: inherit; }

::selection { background: color-mix(in srgb, var(--color-accent) 28%, transparent); }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ——— Page : min-h-dvh overflow-x-clip bg-ink text-white ——— */

.page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  overflow-x: clip;
  background: var(--color-ink);
  color: #fff;
}

.page__main { flex: 1; }

/* ——— Logo : inline-flex items-baseline gap-[0.15em] font-display font-semibold tracking-[-0.03em] ——— */

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.15em;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #fff;
  text-decoration: none;
}

.logo__mark {
  display: block;
  flex-shrink: 0;
  width: 1.424em;
  height: 1.233em;
}

.logo__word { line-height: 1; }

/* ——— Barre de navigation (LandingNav) ——— */

.nav {
  position: fixed;
  top: 16px;
  right: 16px;
  left: 16px;
  z-index: 40;
}

.nav__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  height: 64px;
  margin: 0 auto;
  padding: 0 20px;
  border-radius: 20px;
  background: rgb(20 20 25 / 0.75);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.06), var(--shadow-float);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
}

.nav .logo { font-size: 17px; }

.nav__note {
  font-size: 13.5px;
  color: rgb(255 255 255 / 0.6);
}

/* ——— Héros (Hero) ——— */

.hero {
  position: relative;
  padding: 144px 20px 56px;
  text-align: center;
}

.hero__glow {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1200px;
  height: 640px;
  translate: -50% 0;
  pointer-events: none;
  background: radial-gradient(closest-side, rgb(99 91 255 / 0.28), transparent);
}

.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 9999px;
  background: rgb(255 255 255 / 0.06);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.1);
  font-size: 13px;
  color: rgb(255 255 255 / 0.7);
}

.pill__badge {
  padding: 2px 8px;
  border-radius: 9999px;
  background: var(--color-accent);
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
}

.display {
  position: relative;
  max-width: 56rem;
  margin: 28px auto 0;
  font-family: var(--font-display);
  font-size: clamp(2.9rem, 7.4vw, 5.75rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.038em;
  text-wrap: balance;
}

.display__muted { color: rgb(255 255 255 / 0.6); }

.lede {
  position: relative;
  max-width: 36rem;
  margin: 28px auto 0;
  font-size: 17px;
  line-height: 1.625;
  text-wrap: pretty;
  color: rgb(255 255 255 / 0.6);
}

/* ——— Saisie du code : Field + inputClasses de la maquette, en 4 cases ——— */

.access {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: 340px;
  margin: 40px auto 0;
}

.access__title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-label);
}

.otp {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
}

.otp__digit {
  width: 56px;
  height: 64px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: rgb(255 255 255 / 0.06);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.14);
  color: var(--color-label);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  text-align: center;
  caret-color: var(--color-accent);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: box-shadow 150ms ease-out, opacity 150ms ease-out, transform 150ms ease-out;
}

.otp__digit:focus { box-shadow: inset 0 0 0 2px var(--color-accent); }
.otp__digit:active { transform: scale(0.97); }

.otp[data-state="busy"] .otp__digit { opacity: 0.4; }
.otp[data-state="success"] .otp__digit { box-shadow: inset 0 0 0 2px var(--color-accent); }
.otp[data-state="error"] { animation: shake 440ms var(--ease-apple); }
.otp[data-state="error"] .otp__digit { box-shadow: inset 0 0 0 2px var(--color-critical); }

@keyframes shake {
  0%, 100% { transform: none; }
  18% { transform: translateX(-10px); }
  38% { transform: translateX(8px); }
  58% { transform: translateX(-5px); }
  78% { transform: translateX(2px); }
}

/* Indication et erreur partagent la même ligne : aucun saut de mise en page. */
.access__msg {
  display: grid;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
}

.access__msg > * {
  grid-area: 1 / 1;
  transition: opacity 150ms ease-out;
}

.access__hint { color: var(--color-label-tertiary); }
.access__error { color: var(--color-critical); font-weight: 500; opacity: 0; }
.access.has-error .access__hint { opacity: 0; }
.access.has-error .access__error { opacity: 1; }

/* ——— Bouton primary lg (page 404) ——— */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border-radius: 9999px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  transition: background-color 150ms ease-out, box-shadow 150ms ease-out, transform 150ms ease-out;
}

.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.4), inset 0 1px 0 rgb(255 255 255 / 0.2);
}

.btn--primary:hover { background: var(--color-accent-strong); }

.hero__actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 40px;
}

/* ——— Pied de page ——— */

.foot { border-top: 1px solid rgb(255 255 255 / 0.07); }

.foot__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 20px;
  font-size: 13px;
  color: rgb(255 255 255 / 0.6);
}

.foot .logo { font-size: 15px; color: rgb(255 255 255 / 0.8); }

/* ——— Apparition : rise de la maquette (opacity 0, y 14 → ressort sans rebond, 0,7 s, +70 ms par élément) ——— */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.rise { animation: rise 700ms var(--ease-apple) 50ms both; }
.rise--1 { animation-delay: 120ms; }
.rise--2 { animation-delay: 190ms; }
.rise--3 { animation-delay: 260ms; }

/* ——— Largeurs (sm: 640px) ——— */

@media (min-width: 640px) {
  .nav__bar { padding: 0 32px; }
  .hero { padding-top: 176px; }
  .lede { font-size: 19px; }
  .foot__inner { padding: 32px; }
  .otp { gap: 14px; }
  .otp__digit { width: 60px; height: 68px; }
}

/* ——— Accessibilité ——— */

@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; }
  .otp[data-state="error"] { animation: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .nav__bar {
    background: var(--color-ink-raised);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
