/* ==========================================================================
   crédIA V2 — l'application en bleu nuit, comme la landing.
   Dernière couche de style, chargée après app.css et v2.css sur toutes les
   pages de l'app : on rebascule les couleurs (variables) puis on recolore
   tout ce qui était écrit en blanc « en dur ». Les sites générés, eux,
   gardent leurs propres couleurs (ils sont dans une iframe).
   ========================================================================== */
html:root{
  color-scheme:dark;
  --ink:#EEF2FF; --ink-hover:#FFFFFF;
  --text-body:#B9C4E4; --text-secondary:#A3B0D6; --text-tertiary:#8391BC; --text-faint:#5D6A94;
  --bg-page:#050A1F; --bg-sidebar:#050A1F; --bg-white:#0B1636; --bg-soft:#0A1430;
  --accent:#5B8BFF; --accent-strong:#5B8BFF; --accent-soft:rgba(47,107,255,.16); --peach:#9DB8FF;
  --success:#34D399; --success-bg:rgba(52,211,153,.14); --pending-bg:rgba(47,107,255,.16);
  --border-06:rgba(130,160,255,.10); --border-07:rgba(130,160,255,.12); --border-08:rgba(130,160,255,.14);
  --border-09:rgba(130,160,255,.15); --border-10:rgba(130,160,255,.17); --border-12:rgba(130,160,255,.2);
  --border-14:rgba(130,160,255,.24); --border-16:rgba(130,160,255,.28);
  --brand:#2F6BFF; --brand-hover:#5B8BFF; --brand-50:rgba(47,107,255,.16); --brand-100:rgba(47,107,255,.28);
  --shadow-soft:0 18px 40px -24px rgba(0,0,0,.8);
  --m-shadow:0 14px 34px -18px rgba(0,0,0,.85);
  --m-bg:rgba(130,160,255,.08);
  --dk-card:#0B1636; --dk-card-2:#0E1B42; --dk-line:rgba(130,160,255,.15); --dk-line-2:rgba(130,160,255,.28);
}

/* Fond général : nuit + grille lumineuse */
html body, html body .app-shell{ background:#050A1F !important; color:var(--ink); }
html body .app-main{
  background:
    radial-gradient(900px 420px at 70% -10%,rgba(47,107,255,.16),transparent 70%),
    linear-gradient(rgba(130,160,255,.045) 1px,transparent 1px) 0 0/40px 40px,
    linear-gradient(90deg,rgba(130,160,255,.045) 1px,transparent 1px) 0 0/40px 40px,
    #050A1F !important;
  color:var(--ink);
}
html body a:hover{ color:#7DE8F7; }
::selection{ background:rgba(47,107,255,.55); color:#fff; }

/* Boutons qui utilisaient l'encre foncée comme fond */
html body .skip-link, html body .auth-submit, html body .url-bar-submit, html body .btn-new-site,
html body .app-topbar .btn-nouveau, html body .showcase-tags .dark, html body .pack-card.is-highlight .credits-pill{
  background:linear-gradient(100deg,#0052FF,#2F6BFF 50%,#22D3EE) !important; color:#fff !important; border:0;
}
html body .auth-submit:hover, html body .url-bar-submit:hover{ filter:brightness(1.08); }
html body .site-card .status.is-published{ background:rgba(52,211,153,.16) !important; color:#34D399 !important; }

/* Cartes et panneaux */
html body .dashboard-panel, html body .site-card, html body .generating-card, html body .preview-stats-inner,
html body .publish-card, html body .invoice-form, html body .history-card, html body .pack-card,
html body .consumption-card, html body .auth-panel, html body .auth-form, html body .showcase-card,
html body .showcase-shot, html body .dashboard-empty, html body .brand-block, html body .included-item,
html body .autopay-note, html body .generating-note{
  background:linear-gradient(180deg,rgba(14,27,66,.92),rgba(11,22,54,.92)) !important;
  border-color:var(--dk-line) !important; color:var(--ink);
  box-shadow:0 24px 50px -32px rgba(0,0,0,.9) !important;
}
html body .dashboard-panel-wrap{ background:transparent !important; }
html body .site-card:hover{ border-color:var(--dk-line-2) !important; box-shadow:0 24px 50px -28px rgba(47,107,255,.6) !important; }
html body .site-card-new, html body .site-card-new:hover{ background:rgba(47,107,255,.06) !important; border-color:rgba(34,211,238,.35) !important; }
html body .pack-card.is-highlight{ border:1.5px solid transparent !important; background:linear-gradient(#0E1B42,#0E1B42) padding-box, linear-gradient(120deg,#0052FF,#22D3EE) border-box !important; }

/* Pastilles, onglets, petits fonds clairs */
html body .sidebar-brand .credits-badge, html body .app-topbar .credits-badge{ background:rgba(34,211,238,.14) !important; color:#7DE8F7 !important; border:1px solid rgba(34,211,238,.35) !important; }
html body .panel-tabs{ background:rgba(130,160,255,.08) !important; border-color:var(--dk-line) !important; }
html body .panel-tabs .tab{ color:var(--text-secondary); }
html body .panel-tabs .tab.is-active{ background:#050A1F !important; color:#fff !important; box-shadow:0 0 0 1px rgba(34,211,238,.35),0 8px 18px -10px rgba(0,82,255,.8) !important; }
html body .site-card .status.is-draft, html body .pill, html body .status-pill.is-pending,
html body .generating-head .eta, html body .pack-card .head .tag, html body .pack-card .credits-pill,
html body .auth-google-note, html body .logo-drop .icon, html body .logo-drop .browse{
  background:rgba(47,107,255,.16) !important; color:#9DB8FF !important; border-color:rgba(47,107,255,.35) !important;
}
html body .status-pill.is-paid, html body .domain-option .tag.is-available, html body .publish-success{ background:rgba(52,211,153,.14) !important; color:#34D399 !important; }
html body .form-notice.is-error{ background:rgba(251,113,133,.12) !important; color:#FDA4AF !important; border-color:rgba(251,113,133,.35) !important; }
html body .gen-step.is-active{ background:rgba(47,107,255,.14) !important; }
html body .generating-track, html body .credit-card .track{ background:rgba(130,160,255,.14) !important; }
html body .domain-option.is-selected{ background:rgba(47,107,255,.12) !important; }

/* Champs de saisie */
html body .field input, html body .field textarea, html body .field select, html body .invoice-line input,
html body .url-field, html body input.input, html body .invoice-form input, html body .invoice-form textarea,
html body .reglages input, html body textarea{
  background:#081232 !important; color:var(--ink) !important; border-color:var(--dk-line-2) !important;
}
html body input::placeholder, html body textarea::placeholder{ color:#5D6A94 !important; }
html body .field input:focus, html body .invoice-line input:focus{ border-color:#22D3EE !important; box-shadow:0 0 0 4px rgba(34,211,238,.16) !important; }
html body .logo-drop, html body .invoice-add-line{ background:rgba(47,107,255,.05) !important; border-color:rgba(130,160,255,.3) !important; color:var(--ink); }
html body .logo-drop:hover, html body .invoice-add-line:hover{ background:rgba(47,107,255,.1) !important; }

/* Barre de lien du tableau de bord : intérieur sombre */
html body .url-bar{
  background:linear-gradient(#081232,#081232) padding-box,
             conic-gradient(from var(--v2-angle),#0052FF,#22D3EE,#8B5CF6,#0052FF) border-box !important;
}
html body .url-bar input{ color:#fff !important; background:transparent !important; }

/* Boutons secondaires */
html body .btn-outline, html body .btn-back, html body .btn-google{
  background:rgba(130,160,255,.06) !important; color:var(--ink) !important; border:1px solid var(--dk-line-2) !important;
}
html body .btn-outline:hover, html body .btn-back:hover, html body .btn-google:hover{ background:rgba(130,160,255,.14) !important; color:#fff !important; }
html body .logout-btn:hover{ background:rgba(130,160,255,.14) !important; color:#fff !important; }

/* Aperçu */
html body .preview-wrap{ background:transparent !important; }
/* Pas de backdrop-filter ici : il casserait la barre d'actions fixée en bas sur téléphone. */
html body .preview-toolbar{ background:rgba(5,10,31,.94) !important; border-color:var(--dk-line) !important; }
html body .preview-toolbar .info .sub{ color:var(--text-secondary); }
html body .viewport-toggle{ background:rgba(130,160,255,.08) !important; }
html body .viewport-toggle button{ color:var(--text-secondary); }
html body .viewport-toggle button.is-active{ background:#0E1B42 !important; color:#fff !important; box-shadow:0 0 0 1px rgba(34,211,238,.35) !important; }
html body .preview-frame{ background:#0B1636 !important; border-color:var(--dk-line-2) !important; box-shadow:0 40px 90px -40px rgba(0,30,140,.9) !important; }
html body .preview-frame-bar{ background:#081232 !important; border-color:var(--dk-line) !important; }
html body .preview-frame-bar .dot{ background:rgba(130,160,255,.3) !important; }
html body .preview-frame-bar .url{ background:#050A1F !important; color:var(--text-secondary) !important; border-color:var(--dk-line) !important; }
html body .preview-stats-inner{ color:var(--text-secondary); }
html body .publish-footer, html body .preview-toolbar .actions{ background:rgba(5,10,31,.9) !important; border-color:var(--dk-line) !important; }

/* Téléphone : barres du haut et du bas */
@media (max-width:860px){
  html body .app-topbar, html body .app-topbar.is-scrolled{ background:rgba(5,10,31,.9) !important; border-bottom:1px solid var(--dk-line) !important; }
  html body .app-tabbar{ background:rgba(5,10,31,.92) !important; border-top:1px solid var(--dk-line) !important; -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px); }
  html body .app-tabbar a{ color:var(--text-tertiary) !important; }
  html body .app-tabbar a.is-active{ color:#fff !important; }
  html body .app-tabbar a.is-active .ic{ background:rgba(47,107,255,.2) !important; color:#7DE8F7 !important; }
  html body .app-sidebar{ background:#050A1F !important; }
  html body .m-logout, html body .logout-btn{ background:rgba(251,113,133,.1) !important; color:#FDA4AF !important; }
  html body .credit-card .fill{ background:linear-gradient(90deg,#2F6BFF,#22D3EE) !important; }
  html body .credit-card .recharge{ background:rgba(34,211,238,.12) !important; color:#7DE8F7 !important; }
  html body .btn-back{ background:rgba(130,160,255,.1) !important; }
  html body .auth-form{ background:#0B1636 !important; }
  html body .auth-brand img.mark{ background:#fff !important; }
}

/* Styles écrits directement dans les pages (attribut style) */
html body .app-main > div[style*="background:#F5F8FF"], html body .app-main > div[style*="background:#f5f8ff"]{ background:transparent !important; }
html body .app-main [style*="background:#fff"], html body .app-main [style*="background:#FFF"]{
  background:linear-gradient(180deg,rgba(14,27,66,.92),rgba(11,22,54,.92)) !important; border-color:var(--dk-line) !important;
}
html body .app-main [style*="color:#0B1533"]{ color:#fff !important; }
html body .app-main input:not([type="file"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]){
  background:#081232 !important; color:var(--ink) !important; border-color:var(--dk-line-2) !important;
}
html body .invoice-line{ background:rgba(130,160,255,.06) !important; border-color:var(--dk-line) !important; }
html body .invoice-line input{ background:#050A1F !important; color:#fff !important; }
html body .today-ask{ background:linear-gradient(100deg,#0052FF,#2F6BFF 50%,#22D3EE) !important; color:#fff !important; }

/* Inscription : panneau de droite en nuit bleue */
html body .auth-shell{ background:#050A1F !important; }
html body .auth-showcase{
  background:radial-gradient(70% 60% at 70% 0%,rgba(47,107,255,.55),transparent 70%),
             radial-gradient(60% 50% at 0% 100%,rgba(34,211,238,.18),transparent 70%),#06102E !important;
  border-left:1px solid var(--dk-line);
}
html body .auth-title{ color:#fff; }
html body .auth-sub, html body .auth-footnote{ color:var(--text-secondary); }
html body .showcase-tags .light{ background:rgba(52,211,153,.16) !important; color:#34D399 !important; }
