/* ============================================================
   Brizimmo — App CSS (dark premium, cohérent avec la landing)
   ============================================================ */

:root {
  --bg: #070a14;
  --bg-soft: #0d1220;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-soft: #64748b;
  --text-dim: #475569;

  --primary: #dc2626;
  --primary-2: #f97316;
  --primary-soft: rgba(220, 38, 38, 0.15);
  --primary-gradient: linear-gradient(135deg, #dc2626 0%, #f97316 100%);
  --primary-glow: rgba(220, 38, 38, 0.4);

  --accent: #0f172a;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #dc2626;
  --info: #3b82f6;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 18px;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 8px 24px var(--primary-glow);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}
body {
  min-height: 100dvh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 15px;
  overflow-x: hidden;
  position: relative;
}

/* ===== Ambient background (orbes globaux) ===== */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
}
body::before {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #dc2626 0%, transparent 70%);
  top: -200px; left: -200px;
  opacity: 0.18;
  animation: orb-1 24s ease-in-out infinite;
}
body::after {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #f97316 0%, transparent 70%);
  bottom: -150px; right: -150px;
  opacity: 0.15;
  animation: orb-2 30s ease-in-out infinite;
}
@keyframes orb-1 {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(80px, 60px); }
}
@keyframes orb-2 {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(-80px, -50px); }
}

/* ===== TOPBAR ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 10, 20, 0.7);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
/* Brand logo — image PNG (logo officiel Brizimmo) */
.brand-logo {
  width: 36px; height: 36px;
  display: inline-block;
  background-image: url('/assets/logo.png?v=3');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  font-size: 0; /* masque le "B" texte HTML fallback */
  color: transparent;
  flex-shrink: 0;
}
.brand-name {
  font-weight: 800;
  letter-spacing: -.02em;
  font-size: 17px;
  background: linear-gradient(180deg, #fff, #cbd5e1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.topnav {
  display: flex;
  gap: 4px;
  align-items: center;
}
.topnav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all .2s;
}
.topnav a:hover {
  background: var(--surface);
  color: var(--text);
}
.topnav a.cta {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.topnav a.cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--primary-glow);
}
.topnav a span { display: none; }
@media (min-width: 640px) {
  .topnav a span { display: inline; }
}

/* ===== PAGE ===== */
.page {
  position: relative;
  z-index: 1;
  padding: 24px 16px 80px;
  max-width: 1100px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .page { padding: 36px 24px 80px; }
}

/* ===== FLASH ===== */
.flash {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  backdrop-filter: blur(20px);
  border: 1px solid;
}
.flash-success { background: rgba(16,185,129,.12); color: #34d399; border-color: rgba(16,185,129,.3); }
.flash-error   { background: rgba(220,38,38,.12); color: #f87171; border-color: rgba(220,38,38,.3); }
.flash-info    { background: rgba(59,130,246,.12); color: #60a5fa; border-color: rgba(59,130,246,.3); }
.flash-warning { background: rgba(245,158,11,.12); color: #fbbf24; border-color: rgba(245,158,11,.3); }

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.04) 0%, transparent 40%);
  pointer-events: none;
  border-radius: var(--radius);
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  letter-spacing: -.01em;
  position: relative;
}
.card-title i { color: var(--primary); font-size: 16px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 11px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all .25s cubic-bezier(.16,1,.3,1);
  font-family: var(--font);
  letter-spacing: -.01em;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 8px 24px var(--primary-glow), inset 0 1px 0 rgba(255,255,255,.2);
}
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.25) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform .8s;
}
.btn-primary:hover::before { transform: translateX(100%); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px var(--primary-glow); }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--surface-2);
  border-color: rgba(255,255,255,.2);
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: var(--surface);
  color: var(--text);
}
.btn-block { width: 100%; }
.btn-lg { padding: 15px 28px; font-size: 15px; border-radius: 12px; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 9px; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.form-label .req { color: var(--primary); }
.form-help { font-size: 12px; color: var(--text-soft); margin-top: 6px; }

.form-control {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(0,0,0,.25);
  font-size: 15px;
  font-family: var(--font);
  color: var(--text);
  transition: all .25s;
  -webkit-appearance: none;
  appearance: none;
  font-weight: 500;
}
.form-control:focus {
  outline: 0;
  border-color: var(--primary);
  background: rgba(220,38,38,.04);
  box-shadow: 0 0 0 4px rgba(220,38,38,.12);
}
.form-control::placeholder { color: var(--text-dim); font-weight: 400; }
.form-control:disabled {
  background: rgba(0,0,0,.15);
  color: var(--text-soft);
  cursor: not-allowed;
}

/* ===== Chrome / Edge / Safari autofill override =====
   Le navigateur force un background jaune ou blanc sur les champs auto-remplis.
   Le hack box-shadow inset masque ce fond et garde notre texte clair. */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus,
.form-control:-webkit-autofill:active,
input:-webkit-autofill,
select:-webkit-autofill,
textarea:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #0d1220 inset !important;
  -webkit-text-fill-color: #f8fafc !important;
  caret-color: #f8fafc !important;
  border-color: rgba(255,255,255,.14) !important;
  transition: background-color 9999s ease-in-out 0s, color 9999s ease-in-out 0s;
}

/* Select natif customisé */
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  background-color: rgba(0,0,0,.25);
  color: #f8fafc;
}

/* Options natives (dropdown ouvert) — fond foncé forcé */
select.form-control option,
select option {
  background-color: #0d1220 !important;
  color: #f8fafc !important;
  padding: 8px;
}
select.form-control option:checked,
select option:checked {
  background: linear-gradient(0deg, rgba(220,38,38,.3), rgba(220,38,38,.3)) #0d1220 !important;
  color: #fff !important;
}

textarea.form-control { min-height: 100px; resize: vertical; }

.form-row { display: grid; gap: 12px; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 480px) {
  .form-row-2 { grid-template-columns: 1fr; }
}

/* ===== AUTH PAGES ===== */
.auth-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  position: relative;
  z-index: 1;
}
.auth-card {
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: 24px;
  padding: 36px 28px;
  width: 100%;
  max-width: 440px;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,.02) inset;
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: '';
  position: absolute;
  top: -100px; left: 50%;
  transform: translateX(-50%);
  width: 400px; height: 200px;
  background: radial-gradient(ellipse at center, var(--primary-glow), transparent 70%);
  pointer-events: none;
  z-index: -1;
  filter: blur(40px);
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
  position: relative;
}
.auth-logo .brand-logo {
  margin: 0 auto 16px;
  width: 56px; height: 56px;
  border-radius: 14px;
  font-size: 28px;
  box-shadow: 0 12px 32px var(--primary-glow);
}
.auth-logo h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.025em;
  margin-bottom: 6px;
  background: linear-gradient(180deg, #fff, #cbd5e1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.auth-logo p {
  color: var(--text-muted);
  font-size: 14px;
}
.auth-foot {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
}
.auth-foot a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  transition: color .2s;
}
.auth-foot a:hover { color: var(--primary-2); }

/* Mobile: padding réduit pour utiliser l'espace */
@media (max-width: 480px) {
  .auth-wrap { padding: 16px 12px; }
  .auth-card { padding: 28px 22px; border-radius: 20px; }
  .auth-logo h1 { font-size: 22px; }
  .auth-logo .brand-logo { width: 52px; height: 52px; font-size: 26px; }
}

/* ===== HERO (legacy/landing fallback) ===== */
.hero {
  text-align: center;
  padding: 60px 0 40px;
  position: relative;
  z-index: 1;
}
.hero h1 {
  font-size: clamp(32px, 6vw, 48px);
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: 1.1;
  margin-bottom: 16px;
  background: linear-gradient(180deg, #fff, #cbd5e1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero h1 .accent {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 28px;
  line-height: 1.6;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.features {
  display: grid;
  gap: 16px;
  margin: 32px 0;
}
@media (min-width: 640px) { .features { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 960px) { .features { grid-template-columns: repeat(3,1fr); } }
.feature {
  background: var(--surface);
  backdrop-filter: blur(20px);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--border);
}
.feature i { font-size: 24px; color: var(--primary); margin-bottom: 12px; display: block; }
.feature h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.feature p { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  border: 1px solid;
}
.badge-green  { background: rgba(16,185,129,.12);  color: #34d399; border-color: rgba(16,185,129,.3); }
.badge-amber  { background: rgba(245,158,11,.12);  color: #fbbf24; border-color: rgba(245,158,11,.3); }
.badge-red    { background: rgba(220,38,38,.12);   color: #f87171; border-color: rgba(220,38,38,.3); }
.badge-gray   { background: rgba(148,163,184,.12); color: #cbd5e1; border-color: rgba(148,163,184,.25); }
.badge-blue   { background: rgba(59,130,246,.12);  color: #60a5fa; border-color: rgba(59,130,246,.3); }

/* ===== EMPTY / LOADING ===== */
.empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
}
.empty i {
  font-size: 48px;
  color: var(--text-soft);
  margin-bottom: 16px;
  display: block;
}
.empty h3 {
  font-size: 17px;
  color: var(--text);
  margin-bottom: 6px;
  font-weight: 700;
}
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
  vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== STATS ===== */
.stats {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2,1fr);
  margin-bottom: 24px;
}
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4,1fr); } }
.stat {
  background: var(--surface);
  backdrop-filter: blur(20px);
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity .3s;
}
.stat:hover::before { opacity: 1; }
.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}
.stat-value {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -.03em;
  background: linear-gradient(180deg, #fff, #94a3b8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

/* ===== TABLES ===== */
table { border-collapse: collapse; width: 100%; }
th {
  text-align: left;
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
tr:hover td { background: var(--surface); }

/* ===== LEGAL / CONTENT PAGES ===== */
.legal {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  margin: 24px auto;
  max-width: 800px;
}
.legal h1 {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -.03em;
  margin-bottom: 8px;
  background: linear-gradient(180deg, #fff, #cbd5e1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.legal .legal-update {
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.legal h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 32px 0 12px;
  color: var(--text);
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.legal h2::before {
  content: '';
  width: 4px; height: 18px;
  background: var(--primary-gradient);
  border-radius: 2px;
}
.legal p, .legal li {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.legal ul { padding-left: 20px; margin-bottom: 16px; }
.legal li::marker { color: var(--primary); }
.legal strong { color: var(--text); font-weight: 600; }
.legal a { color: var(--primary); text-decoration: none; }
.legal a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .legal { padding: 28px 20px; margin: 16px 0; }
  .legal h1 { font-size: 26px; }
}

/* ===== MISC UTILITIES ===== */
.muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }

/* ===== TEXT GRADIENTS ===== */
.accent-gradient {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}

/* ===== FOOTER (logged-in pages) ===== */
footer {
  position: relative;
  z-index: 1;
}
footer a { color: var(--text-muted); transition: color .2s; }
footer a:hover { color: var(--primary); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 100px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }
