/* Portail compte nullbot — monochrome strict, aligné sur la charte du site. */
:root {
  --black: #09090b;
  --white: #ffffff;
  --gray-50: #fafafa;
  --gray-100: #f4f4f5;
  --gray-200: #e4e4e7;
  --gray-300: #d4d4d8;
  --gray-400: #a1a1aa;
  --gray-500: #71717a;
  --gray-600: #52525b;
  --radius: 10px;
}

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

html, body { height: 100%; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--black);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ─────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}

.wordmark {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--black);
  text-decoration: none;
}
.wordmark .dot { color: var(--gray-400); }

.topbar-right { display: flex; align-items: center; gap: 0.75rem; }
.topbar-email { font-size: 0.85rem; color: var(--gray-500); }
.topbar-logo {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  object-fit: cover;
  border: 1px solid var(--gray-200);
  background: var(--white);
}

/* ── Layout ─────────────────────────────────────────────────────── */
.shell {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.view[hidden] { display: none; }

.center { text-align: center; }
.muted { color: var(--gray-500); font-size: 0.95rem; line-height: 1.55; }

.page-head { margin-bottom: 1.75rem; }
.kicker {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 0.35rem;
}
.page-head h1 { font-size: 1.9rem; letter-spacing: -0.02em; margin-bottom: 0.4rem; }

/* ── Cartes (repliables via <details>) ──────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.card-title { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }

/* Sommaire cliquable = bouton ouvrir/fermer */
.card-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.5rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.card-summary::-webkit-details-marker { display: none; }
.card-summary:hover { background: var(--gray-50); }
.card-summary:focus-visible { outline: 2px solid var(--black); outline-offset: -2px; }
.chev { color: var(--gray-500); transition: transform 0.2s ease; flex-shrink: 0; }
details[open] > .card-summary .chev { transform: rotate(180deg); }

.card-body { padding: 0 1.5rem 1.5rem; }

.card-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.5rem;
}
.card-cta h2 { margin-bottom: 0.25rem; }

.row-between {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Formulaires ────────────────────────────────────────────────── */
.field { margin-bottom: 0.9rem; }
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.field input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font: inherit;
  font-size: 0.95rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--white);
  color: var(--black);
}
.field input:focus { outline: 2px solid var(--black); outline-offset: 1px; border-color: var(--black); }
.field input:disabled { background: var(--gray-100); color: var(--gray-500); }

.hint { font-size: 0.8rem; color: var(--gray-500); margin-top: 0.3rem; line-height: 1.5; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }

.form-error {
  font-size: 0.85rem;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  margin: 0.6rem 0;
}
.form-ok {
  font-size: 0.85rem;
  color: var(--gray-600);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  margin: 0.6rem 0;
}

/* ── Boutons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--black);
  background: var(--white);
  color: var(--black);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
}
.btn:hover { background: var(--gray-100); }
.btn-primary { background: var(--black); color: var(--white); }
.btn-primary:hover { background: #27272a; }
.btn-ghost { border-color: var(--gray-200); }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.82rem; }
.btn-block { width: 100%; margin-top: 0.4rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.linklike {
  background: none;
  border: none;
  font: inherit;
  font-weight: 600;
  color: var(--black);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ── Auth ───────────────────────────────────────────────────────── */
.auth-card {
  max-width: 420px;
  margin: 3rem auto 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 2rem;
}
.auth-card h1 { font-size: 1.4rem; margin-bottom: 0.4rem; letter-spacing: -0.02em; }
.auth-card .muted { margin-bottom: 1.25rem; }
.auth-switch { margin-top: 1.1rem; font-size: 0.88rem; color: var(--gray-500); text-align: center; }

/* ── Abonnement ─────────────────────────────────────────────────── */
.sub-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 0.75rem;
}
.sub-plan { font-size: 1.25rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }

.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--gray-200);
  background: var(--gray-100);
  color: var(--gray-600);
}
.badge.on { background: var(--black); border-color: var(--black); color: var(--white); }

/* Cartes de tarifs — design repris du site vitrine nullbot.ai */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
  margin-top: 1.25rem;
}
@media (max-width: 680px) { .pricing-grid { grid-template-columns: 1fr; max-width: 420px; margin-inline: auto; } }

.tier-card {
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--white);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.tier-card:hover { transform: translateY(-4px); box-shadow: 0 20px 60px rgba(0,0,0,0.08); }

.tier-card--featured {
  border: 1.5px solid var(--black);
  transform: scale(1.02);
  box-shadow: 0 22px 64px rgba(0,0,0,0.12);
}
.tier-card--featured:hover { transform: scale(1.02) translateY(-4px); box-shadow: 0 30px 80px rgba(0,0,0,0.16); }
.tier-card--current { border-color: var(--black); }

.tier-badge {
  position: absolute;
  top: -0.8rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--black);
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  border: 1px solid var(--black);
  white-space: nowrap;
}

.tier-name {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  color: var(--gray-500);
}
.tier-price { display: flex; align-items: baseline; gap: 0.25rem; margin-bottom: 0.35rem; flex-wrap: wrap; }
.tier-price .amount { font-size: 1.95rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.tier-price .period { font-size: 0.85rem; color: var(--gray-500); }
.tier-desc { font-size: 0.88rem; color: var(--gray-500); margin: 0.5rem 0 1.1rem; line-height: 1.6; }

.tier-features {
  list-style: none;
  margin: 0 0 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}
.tier-features li { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.88rem; line-height: 1.5; }
.tier-features .check {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  margin-top: 2px;
}
.tier-divider { height: 1px; background: var(--gray-100); margin: 0 0 1rem; }

.tier-cta {
  display: block;
  width: 100%;
  text-align: center;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  border: 1px solid var(--gray-300);
  background: transparent;
  color: var(--black);
}
.tier-cta:hover:not([disabled]) { opacity: 0.85; transform: translateY(-1px); }
.tier-cta--primary { background: var(--black); color: var(--white); border-color: var(--black); }
.tier-cta[disabled] { opacity: 1; cursor: default; color: var(--gray-500); background: var(--gray-100); border-color: var(--gray-200); }

/* ── Crédit IA ──────────────────────────────────────────────────── */
.usage {
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin: 0.9rem 0;
}
.usage-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  padding: 0.3rem 0;
  color: var(--gray-600);
}
.usage-row strong { color: var(--black); }
.usage-total { border-top: 1px solid var(--gray-100); margin-top: 0.3rem; padding-top: 0.55rem; font-weight: 600; color: var(--black); }

.topup { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* ── Bannière checkout ──────────────────────────────────────────── */
.banner {
  border: 1px solid var(--gray-200);
  background: var(--white);
  border-left: 4px solid var(--black);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

/* ── Logo entreprise (profil) ───────────────────────────────────── */
.logo-field {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  flex-wrap: wrap;
}
.logo-preview {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  background: var(--gray-50) center/cover no-repeat;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 1.5rem;
  font-weight: 800;
}
.logo-actions { min-width: 0; }
.logo-actions .data-title { margin-bottom: 0.1rem; }
.logo-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.6rem; }
.logo-buttons label.btn { cursor: pointer; }

/* ── Factures ───────────────────────────────────────────────────── */
.invoices { list-style: none; margin: 0.75rem 0 0; }
.invoice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--gray-100);
  flex-wrap: wrap;
}
.invoice:first-child { border-top: none; }
.invoice-main { min-width: 0; }
.invoice-title { font-weight: 600; font-size: 0.92rem; display: flex; align-items: center; gap: 0.5rem; }
.invoice-meta { font-size: 0.8rem; color: var(--gray-500); margin-top: 0.15rem; }
.invoice-amount { font-weight: 700; font-size: 0.95rem; white-space: nowrap; }
.invoice-right { display: flex; align-items: center; gap: 0.75rem; }

/* ── Appareils & sessions ───────────────────────────────────────── */
.sessions { list-style: none; margin: 0.5rem 0 0; }
.session {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--gray-100);
}
.session:first-child { border-top: none; }
.session-info { min-width: 0; }
.session-device { font-weight: 600; font-size: 0.92rem; display: flex; align-items: center; gap: 0.5rem; }
.session-meta { font-size: 0.8rem; color: var(--gray-500); margin-top: 0.15rem; }
.session-current {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: var(--black);
  color: var(--white);
}

/* ── Mes données (RGPD) ─────────────────────────────────────────── */
.card-danger { border-color: var(--gray-200); }
.data-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 0;
  border-top: 1px solid var(--gray-100);
}
.data-row:first-of-type { border-top: none; }
.data-title { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.15rem; }
.data-row-danger .data-title { color: #b91c1c; }

.btn-danger {
  border-color: #dc2626;
  color: #dc2626;
  background: var(--white);
}
.btn-danger:hover { background: #fef2f2; }
.btn-danger[disabled] { opacity: 0.45; }

/* ── Modal de confirmation ──────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 11, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 50;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--white);
  border-radius: 14px;
  padding: 1.75rem;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(9, 9, 11, 0.25);
}
.modal h2 { font-size: 1.2rem; margin-bottom: 0.5rem; letter-spacing: -0.01em; }
.modal .muted { margin-bottom: 1.1rem; }
.modal .field { margin-top: 0.9rem; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.4rem;
}

/* ── Footer ─────────────────────────────────────────────────────── */
.footer {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  padding: 1.25rem;
  font-size: 0.8rem;
  color: var(--gray-400);
  border-top: 1px solid var(--gray-200);
  background: var(--white);
}
.footer a { color: var(--gray-500); text-decoration: none; }
.footer a:hover { color: var(--black); }
