/* ============================================================
   AlertIA — Landing page styles (extrait de alertia_landing.html)
   Dark theme emerald. Auto-contenu, pas de dépendance hors Google Fonts.
   ============================================================ */

:root {
  --bg: #0a0f0d;
  --bg-2: #0d1512;
  --bg-3: #121c18;
  --line: rgba(16, 185, 129, 0.12);
  --line-strong: rgba(16, 185, 129, 0.28);
  --fg: #e6f0eb;
  --fg-dim: #8ca49b;
  --fg-faint: #4a5c55;
  --emerald: #10b981;
  --emerald-bright: #34d399;
  --emerald-deep: #047857;
  --red: #ef4444;
  --amber: #f59e0b;
  --display: "Fraunces", "Times New Roman", serif;
  --mono: "JetBrains Mono", "Menlo", monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-weight: 400;
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* grille technique en fond */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at 50% 40%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, black 20%, transparent 75%);
}

/* grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
}

.shell { position: relative; z-index: 2; }

/* ─────────── NAV ─────────── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  background: rgba(10, 15, 13, 0.7);
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.5px;
}
.logo-mark {
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--emerald);
  position: relative;
  transform: rotate(45deg);
}
.logo-mark::before {
  content: "";
  position: absolute;
  inset: 4px;
  background: var(--emerald);
  opacity: 0.4;
  animation: pulse 2.4s ease-in-out infinite;
}
.logo-mark::after {
  content: "";
  position: absolute;
  inset: 8px;
  background: var(--emerald);
}
@keyframes pulse {
  0%, 100% { opacity: 0.25; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.15); }
}
.logo span em {
  color: var(--emerald);
  font-style: normal;
}
.nav-links {
  display: flex;
  gap: 32px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--fg-dim);
}
.nav-links a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--emerald-bright); }
.nav-cta {
  display: flex;
  gap: 12px;
  align-items: center;
}
.btn {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
}
.btn:hover {
  border-color: var(--emerald);
  color: var(--emerald-bright);
}
.btn-primary {
  background: var(--emerald);
  color: #051912;
  border-color: var(--emerald);
  font-weight: 700;
}
.btn-primary:hover {
  background: var(--emerald-bright);
  color: #051912;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.4);
}
.btn-primary::after {
  content: "→";
  margin-left: 8px;
  display: inline-block;
  transition: transform 0.3s;
}
.btn-primary:hover::after {
  transform: translateX(4px);
}

/* ─────────── HERO ─────────── */
.hero {
  padding: 80px 40px 60px;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}

.status-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 48px;
  animation: fadeUp 0.6s ease both;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 12px var(--emerald);
  animation: blink 1.4s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.status-sep { color: var(--fg-faint); }

.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 60px;
  align-items: start;
}

h1 {
  font-family: var(--display);
  font-size: clamp(52px, 7vw, 104px);
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: -3px;
  margin-bottom: 32px;
}
h1 .line {
  display: block;
  opacity: 0;
  animation: slideUp 0.9s cubic-bezier(.2,.7,.2,1) both;
}
h1 .line:nth-child(1) { animation-delay: 0.1s; }
h1 .line:nth-child(2) { animation-delay: 0.25s; }
h1 .line:nth-child(3) { animation-delay: 0.4s; }

h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--emerald);
  position: relative;
}
h1 em::after {
  content: "";
  position: absolute;
  bottom: 0.1em;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--emerald);
  transform: scaleX(0);
  transform-origin: left;
  animation: drawLine 0.8s 1.2s ease forwards;
}
@keyframes drawLine {
  to { transform: scaleX(1); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-sub {
  max-width: 520px;
  font-size: 15px;
  color: var(--fg-dim);
  line-height: 1.65;
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp 0.8s 0.6s ease both;
}
.hero-sub strong {
  color: var(--fg);
  font-weight: 500;
}

.hero-ctas {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.8s 0.75s ease both;
}
.hero-ctas .btn { padding: 14px 24px; font-size: 12px; }
.hero-ctas .secondary-hint {
  font-size: 11px;
  color: var(--fg-faint);
  text-transform: uppercase;
  letter-spacing: 2px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

/* ─────────── LIVE FEED PANEL ─────────── */
.feed-panel {
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(16,185,129,0.03), rgba(16,185,129,0.0));
  padding: 0;
  opacity: 0;
  animation: fadeUp 1s 0.5s ease both;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,0.5),
              inset 0 1px 0 rgba(16,185,129,0.1);
}
.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(16,185,129,0.04);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--fg-dim);
}
.feed-header .title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--emerald-bright);
}
.feed-header .meta {
  font-size: 10px;
  color: var(--fg-faint);
}
.dot-live {
  width: 6px;
  height: 6px;
  background: var(--emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--emerald);
  animation: blink 1.4s infinite;
}

.feed-scroll {
  height: 420px;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(180deg, transparent 0%, black 12%, black 88%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, black 12%, black 88%, transparent 100%);
}
.feed-track {
  animation: scrollFeed 40s linear infinite;
}
@keyframes scrollFeed {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}
.feed-item {
  padding: 16px 18px;
  border-bottom: 1px dashed var(--line);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: start;
  font-size: 12px;
}
.feed-time {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--fg-faint);
  letter-spacing: 0.5px;
  padding-top: 2px;
}
.feed-body .src {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--emerald);
  margin-bottom: 4px;
}
.feed-body .title-txt {
  color: var(--fg);
  font-size: 12.5px;
  line-height: 1.4;
  font-family: var(--mono);
}
.sev {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 3px 7px;
  border: 1px solid;
  align-self: start;
}
.sev-HIGH { color: var(--red); border-color: rgba(239,68,68,0.4); background: rgba(239,68,68,0.08); }
.sev-MEDIUM { color: var(--amber); border-color: rgba(245,158,11,0.4); background: rgba(245,158,11,0.08); }
.sev-LOW { color: var(--emerald); border-color: var(--line-strong); background: rgba(16,185,129,0.06); }

.feed-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--fg-faint);
  text-transform: uppercase;
  letter-spacing: 2px;
  display: flex;
  justify-content: space-between;
}

/* ─────────── METRICS BAND ─────────── */
.metrics {
  padding: 40px 40px;
  max-width: 1400px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.metric {
  padding: 0 32px;
  border-left: 1px solid var(--line);
}
.metric:first-child { border-left: none; padding-left: 0; }
.metric-value {
  font-family: var(--display);
  font-size: 48px;
  font-weight: 300;
  line-height: 1;
  color: var(--fg);
  letter-spacing: -1.5px;
}
.metric-value em {
  color: var(--emerald);
  font-style: normal;
}
.metric-label {
  margin-top: 10px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--fg-dim);
}

/* ─────────── MODULES SECTION ─────────── */
.modules {
  padding: 100px 40px;
  max-width: 1400px;
  margin: 0 auto;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 60px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.section-tag {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--emerald);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-tag::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--emerald);
}
.section-title {
  font-family: var(--display);
  font-size: clamp(36px, 4.5vw, 56px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -1.5px;
  max-width: 700px;
}
.section-title em { color: var(--emerald); font-style: italic; font-weight: 400; }
.section-meta {
  font-size: 11px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: right;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.module {
  background: var(--bg);
  padding: 32px 28px;
  position: relative;
  transition: background 0.3s;
  min-height: 280px;
  display: flex;
  flex-direction: column;
}
.module:hover { background: var(--bg-2); }
.module:hover .module-arrow { transform: translate(4px, -4px); color: var(--emerald-bright); }

.module-main { grid-column: span 6; }
.module-side { grid-column: span 3; }

.module-index {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--fg-faint);
  letter-spacing: 2px;
  margin-bottom: 16px;
}
.module-name {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.module-main .module-name { font-size: 36px; }
.module-tags {
  font-size: 10px;
  color: var(--emerald);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 20px;
}
.module-desc {
  font-size: 13px;
  color: var(--fg-dim);
  line-height: 1.6;
  margin-bottom: auto;
  max-width: 440px;
}
.module-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--fg-dim);
  padding: 6px 10px;
  border: 1px solid var(--line);
  align-self: start;
}
.module-status.live { color: var(--emerald); border-color: var(--line-strong); }
.module-status.soon { color: var(--amber); border-color: rgba(245,158,11,0.3); }
.module-status .s-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.module-status.live .s-dot { animation: blink 1.4s infinite; box-shadow: 0 0 6px currentColor; }

.module-arrow {
  position: absolute;
  top: 28px;
  right: 28px;
  font-family: var(--display);
  font-size: 24px;
  color: var(--fg-faint);
  transition: all 0.3s;
}

/* ─────────── WORKFLOW ─────────── */
.workflow {
  padding: 100px 40px;
  max-width: 1400px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}
.workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 60px;
  border: 1px solid var(--line);
}
.step {
  padding: 40px 32px;
  border-right: 1px solid var(--line);
  position: relative;
}
.step:last-child { border-right: none; }
.step-num {
  font-family: var(--display);
  font-size: 72px;
  font-weight: 300;
  line-height: 1;
  color: var(--emerald);
  opacity: 0.3;
  letter-spacing: -2px;
  margin-bottom: 16px;
}
.step-title {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}
.step-desc {
  font-size: 13px;
  color: var(--fg-dim);
  line-height: 1.6;
}
.step-code {
  margin-top: 20px;
  padding: 10px 12px;
  background: var(--bg-2);
  border-left: 2px solid var(--emerald);
  font-size: 11px;
  color: var(--emerald-bright);
  font-family: var(--mono);
}
.step-code .prompt { color: var(--fg-faint); }

/* ─────────── CTA FINAL ─────────── */
.final-cta {
  padding: 120px 40px 100px;
  max-width: 1400px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  text-align: center;
  position: relative;
}
.final-cta::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(16,185,129,0.08), transparent 60%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.final-cta-inner { position: relative; }
.final-cta h2 {
  font-family: var(--display);
  font-size: clamp(44px, 6vw, 80px);
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: -2px;
  margin-bottom: 28px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
.final-cta h2 em { color: var(--emerald); font-style: italic; font-weight: 400; }
.final-cta p {
  color: var(--fg-dim);
  max-width: 540px;
  margin: 0 auto 40px;
  font-size: 14px;
  line-height: 1.7;
}
.final-cta .btn {
  padding: 18px 32px;
  font-size: 12px;
}

/* ─────────── FOOTER ─────────── */
footer {
  border-top: 1px solid var(--line);
  padding: 40px;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--fg-faint);
  text-transform: uppercase;
  letter-spacing: 2px;
  flex-wrap: wrap;
  gap: 20px;
}
footer .version { color: var(--emerald); }

/* ─────────── AUTH FORMS (login / register) ─────────── */
.auth-wrap {
  min-height: calc(100vh - 78px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(16,185,129,0.03), rgba(16,185,129,0.0));
  padding: 36px 32px;
  box-shadow: 0 40px 80px -30px rgba(0,0,0,0.5),
              inset 0 1px 0 rgba(16,185,129,0.08);
}
.auth-card h1 {
  font-size: 32px;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 8px;
}
.auth-card .sub {
  color: var(--fg-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 28px;
}
.auth-card .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.auth-card label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--fg-dim);
}
.auth-card input {
  font-family: var(--mono);
  font-size: 14px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--fg);
  outline: none;
  transition: border-color 0.2s;
}
.auth-card input:focus {
  border-color: var(--emerald);
}
.auth-card button[type="submit"] {
  width: 100%;
  margin-top: 12px;
  padding: 14px;
}
.auth-card .foot {
  margin-top: 22px;
  font-size: 12px;
  color: var(--fg-dim);
  text-align: center;
}
.auth-card .foot a { color: var(--emerald); text-decoration: none; }
.auth-card .foot a:hover { color: var(--emerald-bright); text-decoration: underline; }
.auth-card .error {
  margin-bottom: 16px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.4);
  background: rgba(239,68,68,0.06);
}
.auth-card .hint {
  font-size: 11px;
  color: var(--fg-faint);
}
.auth-card .password-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}
.auth-card .password-wrap input {
  flex: 1;
  width: 100%;
  padding-right: 44px;
}
.auth-card .password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--fg-dim);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.auth-card .password-toggle:hover { color: var(--emerald-bright); }
.auth-card .password-toggle:focus-visible {
  outline: 1px solid var(--emerald);
  outline-offset: -1px;
}
.auth-card .password-toggle svg { width: 18px; height: 18px; }

/* Forgot-password toggle (signin ↔ forgot) sur le même formulaire.
   La machine d'état est portée par data-state sur .auth-card ; les blocs
   "data-only" sont masqués selon l'état courant, et le bloc password
   utilise un collapse animé pour préserver la fluidité. */
.auth-card .success {
  margin-bottom: 16px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--emerald-bright);
  border: 1px solid var(--line-strong);
  background: rgba(16,185,129,0.08);
}
.auth-card[data-state="signin"] [data-only="forgot"],
.auth-card[data-state="forgot"] [data-only="signin"] {
  display: none;
}
.auth-card .forgot-link {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--emerald);
  text-decoration: none;
  align-self: flex-end;
  transition: color 0.15s;
}
.auth-card .forgot-link:hover { color: var(--emerald-bright); }

.auth-card .field--collapsible {
  overflow: hidden;
  transition:
    max-height 240ms cubic-bezier(.4,0,.2,1),
    opacity 200ms ease,
    margin-bottom 240ms ease;
  max-height: 240px;
}
.auth-card[data-state="forgot"] .field--collapsible {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  pointer-events: none;
}

/* ─────────── RESPONSIVE ─────────── */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .metrics { grid-template-columns: repeat(2, 1fr); gap: 40px 0; padding: 32px 20px; }
  .metric { padding: 0 16px; }
  .metric:nth-child(3) { border-left: none; padding-left: 16px; }
  .modules-grid { grid-template-columns: 1fr; }
  .module-main, .module-side { grid-column: span 1; }
  .workflow-grid { grid-template-columns: 1fr; }
  .step { border-right: none; border-bottom: 1px solid var(--line); }
  .step:last-child { border-bottom: none; }
  nav { padding: 16px 20px; }
  .nav-links { display: none; }
  .hero { padding: 48px 20px; }
  .section-header { flex-direction: column; align-items: start; gap: 20px; }
  .section-meta { text-align: left; }
}
