/* urb-IA — Front app à la charte (D-2026-07-02-7). Tokens : urbia-tokens.css.
   Règles charte : encre/parchemin, Spectral (titres) / Hanken (UI), cyan réservé à
   l'IA, AUCUN dégradé bleu SaaS, AUCUN border-left coloré, cartes 6px / boutons 4px. */

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

html, body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg-secondary);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; width: 100%; }

/* Hiérarchie charte (ECARTS_VISUELS §2) : H1/H2 Spectral 400 (le contraste vient du
   serif, jamais de gras épais) ; H3/H4 en Hanken Grotesk. */
h1, h2 { font-family: var(--font-display); color: var(--fg); font-weight: 400; letter-spacing: -0.02em; line-height: 1.15; }
h3, h4 { font-family: var(--font-sans); color: var(--fg); font-weight: 600; line-height: 1.25; }

/* ─── Header : encre plein (pas de dégradé) ─── */
.site-header {
  background: var(--urbia-encre-800);
  color: var(--fg-on-dark);
  padding: 1rem 0;
  border-bottom: 1px solid var(--urbia-encre-700);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.logo { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; color: #fff; text-decoration: none; letter-spacing: -0.01em; }
.nav-main { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.nav-main a { color: rgba(255,255,255,0.82); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.nav-main a:hover, .nav-main a.active { color: #fff; }
.quota-pill {
  background: rgba(255,255,255,0.12);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.user-email { font-size: 0.85rem; color: rgba(255,255,255,0.65); }
.inline-form { display: inline-block; }
.link-button { background: none; border: none; color: rgba(255,255,255,0.82); cursor: pointer; font-size: 0.95rem; padding: 0; font-weight: 500; font-family: inherit; }
.link-button:hover { color: #fff; text-decoration: underline; }

/* ─── Main ─── */
main.container { padding: 2rem 1.5rem; flex: 1; }
.hero { margin-bottom: 2rem; text-align: center; }
.hero h1 { font-size: 2rem; margin-bottom: 0.7rem; }
.hero .subtitle { color: var(--fg-muted); font-size: 1.05rem; max-width: 700px; margin: 0 auto; }

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.8rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(13,27,62,0.06), 0 1px 2px rgba(13,27,62,0.04); /* --shadow-sm */
}
.card-narrow { max-width: 520px; margin: 2rem auto; }
.card h1, .card h2 { margin-bottom: 1rem; font-size: 1.35rem; }

/* ─── Forms ─── */
.analysis-form { display: flex; flex-direction: column; gap: 0.7rem; }
.analysis-form label { font-weight: 600; color: var(--fg); }
.analysis-form input[type="text"], .analysis-form input[type="email"] {
  padding: 0.7rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-btn);
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--fg);
}
.analysis-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-ring); }
.hint { color: var(--fg-muted); font-size: 0.85rem; margin: 0.1rem 0 0.5rem; }

/* ─── Buttons ─── (primaire = encre ; boutons 4px) */
.btn {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #fff; color: var(--fg); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--bg-soft); }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.85rem; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

/* ─── Tables ─── */
.data-table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.92rem; }
.data-table th, .data-table td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--border); }
.data-table th {
  background: var(--bg-soft);
  font-weight: 600;
  color: var(--fg-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.14em; /* tracking eyebrow (ECARTS_VISUELS §6) */
}
.data-table td { color: var(--fg-secondary); }
/* chiffres en Fragment Mono (alignement tabulaire) */
.data-table td:nth-child(n) { font-variant-numeric: tabular-nums; }
.data-table-compact th, .data-table-compact td { padding: 0.4rem 0.7rem; }
.data-table-compact th { width: 38%; background: var(--bg-soft); color: var(--fg); text-transform: none; font-size: 0.9rem; letter-spacing: 0; }

/* ─── Badges (ECARTS_VISUELS §6) : 2px 8px, radius 2px, micro uppercase eyebrow ─── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.badge-success { background: var(--urbia-success-100); color: var(--urbia-success-500); }
.badge-danger  { background: var(--urbia-danger-100);  color: var(--urbia-danger-500); }
.badge-info    { background: var(--urbia-cyan-50);     color: var(--urbia-cyan-600); }
.badge-muted   { background: var(--bg-soft);           color: var(--fg-muted); }

/* ─── Alertes (ECARTS_VISUELS §6) : border-left 3px sémantique ASSUMÉ ici
   (différent des cards, où il reste interdit), fond -100, radius 4px ─── */
.alert {
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 1.2rem;
  border-left: 3px solid;
  font-size: 0.95rem;
}
.alert-info    { background: var(--urbia-cyan-50);     border-color: var(--urbia-cyan-500);    color: var(--urbia-cyan-700); }
.alert-success { background: var(--urbia-success-100); border-color: var(--urbia-success-500); color: #1f6b45; }
.alert-danger  { background: var(--urbia-danger-100);  border-color: var(--urbia-danger-500);  color: #8f3535; }
.alert-warning { background: var(--urbia-warning-100); border-color: var(--urbia-warning-500); color: #8a5f1e; }

/* ─── Barre de progression (ECARTS_VISUELS §6) : 6px, fond parchemin, fill cyan IA
   (seul cas où le cyan porte du sémantique) + shimmer 1,8 s — l'unique signature
   animée IA autorisée par la charte ─── */
.progress-bar { background: var(--bg-soft); border-radius: var(--radius-pill); height: 6px; overflow: hidden; margin: 1rem 0; }
.progress-fill {
  background: var(--accent);
  height: 100%;
  transition: width 0.4s ease;
  position: relative;
  overflow: hidden;
}
.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: translateX(-100%);
  animation: urbia-shimmer 1.8s infinite;
}
@keyframes urbia-shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .progress-fill::after { animation: none; } }

.status-row { display: flex; flex-wrap: wrap; gap: 2rem; padding: 0.8rem 0; font-size: 0.95rem; }
.status-row strong { color: var(--fg); }

.detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.detail-header h1 { font-size: 1.5rem; margin-bottom: 0.3rem; }
.detail-header .subtitle { color: var(--fg-muted); }

.report-iframe { width: 100%; height: 80vh; border: 1px solid var(--border); border-radius: var(--radius-card); margin-top: 0.5rem; background: #fff; }

/* ─── Footer ─── */
.site-footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 1.2rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-top: 2rem;
}

@media (max-width: 720px) {
  .hero h1 { font-size: 1.5rem; }
  .nav-main { gap: 0.7rem; font-size: 0.85rem; }
  .user-email { display: none; }
  .data-table { font-size: 0.82rem; }
  .data-table th, .data-table td { padding: 0.4rem 0.5rem; }
  .report-iframe { height: 70vh; }
  /* tables larges : scroll horizontal plutôt que débordement */
  .card { overflow-x: auto; }
}

/* ── État d'attente d'analyse (D-2026-07-07-3) : une barre par étape + barre
   générale. Fill cyan = signature IA (même règle que .progress-fill), shimmer
   réservé à l'étape active et à la barre générale. ─────────────────────────── */
.etapes { margin: 0.5rem 0 1rem; max-width: 560px; }
.etape { margin-bottom: 0.65rem; }
.etape-libelle {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--fg-muted);
  margin-bottom: 0.25rem;
}
.etape-active .etape-libelle { color: var(--fg); }
.etape-etat { font-family: var(--font-mono); font-size: 0.78rem; }
.etape-done .etape-etat { color: var(--success-text); }
.etape-bar { background: var(--bg-soft); border-radius: var(--radius-pill); height: 6px; overflow: hidden; }
.etape-fill {
  background: var(--accent);
  height: 100%;
  transition: width 0.4s ease;
  position: relative;
  overflow: hidden;
}
/* Shimmer uniquement sur l'étape en cours (l'unique signature animée IA de la charte) */
.etape-active .etape-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: translateX(-100%);
  animation: urbia-shimmer 1.8s infinite;
}
@media (prefers-reduced-motion: reduce) { .etape-active .etape-fill::after { animation: none; } }
.etape-globale { margin-top: 1rem; padding-top: 0.8rem; border-top: 1px solid var(--border); }
.etape-globale .etape-libelle { color: var(--fg); font-weight: 600; }
.etape-globale .progress-bar { margin: 0; }

/* ── Confirmation d'unité foncière (D-2026-07-06-8/9) ─────────────────────── */
.uf-carte {
  height: 380px;
  border: 1px solid var(--border);
  border-radius: 4px;
  margin: 1rem 0;
  background: var(--bg-soft);
}
.uf-form .btn { margin-right: 0.6rem; }
.hint-inline { color: var(--fg-muted); font-size: 0.85em; }
