:root {
  --bg: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #ecb536;
  --brand-600: #d29f1f;
  --ghost: #111827;
  --ghost-bg: #f3f4f6;
}

/* -------- Base -------- */
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
  text-decoration: none;
}
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Typography */
.h1 {
  font-size: 44px;
  line-height: 1.15;
  margin: 0 0 12px;
}
.h2 {
  font-size: 32px;
  margin: 0 0 8px;
}
.h3 {
  font-size: 22px;
  margin: 0 0 4px;
}
.lead {
  font-size: 18px;
  color: var(--muted);
  margin: 0 0 16px;
}
.center {
  text-align: center;
}
.sub {
  color: var(--muted);
  margin-top: 6px;
}

/* Utilities */
.muted {
  color: var(--muted);
}
.hidden {
  display: none !important;
}
.visually-hidden {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
  padding: 0;
}

/* -------- Buttons -------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.15s;
}
.btn-sm {
  padding: 8px 12px;
  font-size: 14px;
}
.btn-primary {
  background: var(--brand);
  color: #000;
}
.btn-primary:hover {
  background: var(--brand-600);
}
.btn-muted {
  background: #f3f4f6;
  color: var(--ghost);
}
.btn-muted:hover {
  background: #e5e7eb;
}
.btn-ghost {
  background: var(--ghost-bg);
  color: var(--ghost);
}
.btn-ghost:hover {
  background: #e5e7eb;
}

/* Disabled + Loading */
.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.btn.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.95;
  color: transparent;
}
.btn.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* -------- Header -------- */
/* On masque les actions jusqu’à ce que le cache UI soit appliqué par JS
   → évite le “flash” connecté/déconnecté. */
.header-actions.is-hidden {
  visibility: hidden;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(17, 24, 39, 0.06);
  transition: box-shadow 0.2s ease;
}
.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}
.brand-name {
  font-weight: 800;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-email {
  font-size: 14px;
  color: var(--muted);
  margin-left: 6px;
}

/* -------- Sections -------- */
.section {
  padding: 56px 0;
  border-top: 1px solid transparent;
}
.hero {
  padding-top: 72px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: center;
}
.hero-img {
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
}
.bullets {
  margin: 12px 0 18px;
  padding-left: 18px;
}
.bullets li {
  margin: 6px 0;
  list-style: disc;
  color: #374151;
}
.hero-cta {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

/* Account / key-values */
.kv {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
}
.kv .row {
  display: flex;
  justify-content: space-between;
  padding: 10px 6px;
}
.kv .key {
  color: var(--muted);
}
.kv .val {
  font-weight: 700;
}

/* -------- Features -------- */
.features .grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 24px;
}
.feature {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #fff;
}

/* -------- Pricing -------- */
.pricing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
/* -------- Pricing Toggle (segmented control) -------- */
.toggle {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  background: var(--ghost-bg);
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.02);
}

/* Pastille/bloc qui glisse sous l’option active */
.toggle::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.04);
  transition: transform 0.18s ease;
}
.toggle[data-mode="yearly"]::before {
  transform: translateX(100%);
}

.toggle-btn {
  position: relative;
  z-index: 1;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease;
}
.toggle-btn:hover {
  color: var(--text);
}
.toggle-btn.active {
  color: var(--text);
}
.toggle-btn:focus-visible {
  outline: 2px solid rgba(79, 70, 229, 0.35);
  outline-offset: 2px;
  border-radius: 999px;
}
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  background: #fff;
}
.card-accent {
  border-color: #c7d2fe;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.08);
}
.badge {
  display: inline-block;
  background: #eef2ff;
  color: #3730a3;
  font-weight: 700;
  border-radius: 999px;
  padding: 6px 10px;
  margin-bottom: 8px;
}
.price {
  font-size: 36px;
  font-weight: 800;
  margin: 6px 0;
}
.price .per {
  font-size: 14px;
  color: var(--muted);
}
.list {
  margin: 14px 0 18px;
  padding-left: 18px;
}
.list li {
  margin: 6px 0;
  list-style: disc;
  color: #374151;
}
.pricing-cta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* -------- CTA strip -------- */
.cta .cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  background: #fff;
}

/* -------- Footer -------- */
.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--line);
  margin-top: 40px;
  background: #fff;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 18px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}
.foot-title {
  font-weight: 800;
  margin: 0 0 8px;
}
.foot-links {
  margin: 0;
  padding: 0;
  list-style: none;
}
.foot-links a {
  color: #374151;
}
.foot-links a:hover {
  color: #111827;
}
.foot-meta {
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* -------- Responsive -------- */
@media (max-width: 960px) {
  .header-inner {
    height: 58px;
  }
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  .features .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 600px) {
  .features .grid-3 {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Fix spinners visibility on buttons --- */
/* Le style existant met color: transparent, donc currentColor devient transparent.
   On force la couleur du spinner selon le type de bouton. */
.btn.loading::after {
  border-color: rgba(17, 24, 39, 0.9);
  border-top-color: transparent;
}
.btn-primary.loading::after {
  border-color: rgba(255, 255, 255, 0.95);
  border-top-color: transparent;
}

/* Option UX : verrouillage global “clair” quand disabled */
#acct-actions .btn[disabled] {
  opacity: 0.7;
  filter: saturate(0.8);
}

/* --- Result pages (success / cancel) --- */
.result {
  max-width: 720px;
  margin: 28px auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 22px;
}
.result-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}
.icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
}
.icon-ok {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.icon-warn {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}
.result-title {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
}
.result-body {
  color: #374151;
  margin: 8px 0 16px;
}
.result-cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Alerts harmonisées (si tu utilises #ui-alert) */
.alert {
  padding: 10px 12px;
  border-radius: 10px;
  margin: 8px 0 14px;
  font-weight: 600;
}
.alert-ok {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.alert-warn {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}
.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}


