/* Compte, offres, essai Pro, administration */
body.guest .sidebar, body.guest main { display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Connexion */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); background: var(--bg-soft); }
.auth-box { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 28px; }
.auth-brand { padding: 0 0 18px; }
.auth-box h1 { margin-bottom: 4px; }
.auth-box form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.full-btn { width: 100%; padding: 12px; font-size: 15px; }
.auth-switch { text-align: center; font-size: 14px; margin: 18px 0 0; }

/* Pastille d'offre et bandeau */
.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.plan-chip { margin: -4px 10px 10px; align-self: flex-start; }
.plan-chip:hover { text-decoration: none; filter: brightness(.97); }
.plan-chip.free { background: var(--bg-soft); color: var(--muted); }
.plan-chip.trial { background: var(--warn-soft); color: var(--warn); }
.banner { background: var(--accent-soft); color: var(--text); border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; font-size: 14px; }

/* Fenêtre d'offre */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); display: flex; align-items: center; justify-content: center; z-index: 30; padding: 16px; }
.modal-box { position: relative; width: 100%; max-width: 440px; background: var(--surface); border-radius: 18px; padding: 26px; border: 1px solid var(--border); }
.modal-box h2 { font-size: 20px; margin: 12px 0 6px; }
.modal-box ul.clean { margin: 10px 0 4px; padding-left: 0; list-style: none; }
.modal-box ul.clean li { padding-left: 24px; position: relative; margin-bottom: 6px; font-size: 14px; }
.modal-box ul.clean li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.modal-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 0; background: var(--bg-soft); }

/* Fuites verrouillées */
.post.locked .lock-fig { display: flex; align-items: center; justify-content: center; background: repeating-linear-gradient(45deg, var(--bg-soft), var(--bg-soft) 10px, var(--border) 10px, var(--border) 11px); }
.lock-box { text-align: center; font-size: 13px; color: var(--muted); padding: 12px; }
.lock-box b { color: var(--text); }

/* Mon offre */
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.plan-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.plan-head h2 { font-size: 24px; margin: 4px 0; }
.plan-price { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.plan-price small { font-size: 14px; font-weight: 500; color: var(--muted); }
.meters { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; margin-top: 18px; }
.meter-top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.meter-top b { font-variant-numeric: tabular-nums; }
.meter-track { height: 6px; background: var(--bg-soft); border-radius: 3px; overflow: hidden; }
.meter-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.meter-fill.full { background: var(--danger); }
.section-title { margin-top: 26px; }
.plans-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.plan-card { border: 1px solid var(--border); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); min-width: 0; }
.plan-card.featured { border-color: var(--accent); }
.plan-card.current { background: var(--accent-soft); }
.plan-card .plan-name { font-weight: 800; font-size: 16px; }
.plan-card .plan-price { font-size: 22px; }
.plan-card ul.clean { margin: 0; padding-left: 18px; font-size: 13px; flex: 1; }
.plan-card ul.clean li { margin-bottom: 4px; }
.plan-card button { width: 100%; }
.small-note { font-size: 13px; margin-top: 12px; }
.plan-card.soon { border-style: dashed; }
.plan-card.soon .plan-price, .plan-card.soon ul { opacity: .7; }
.plan-card.soon .soon-note { font-size: 13px; margin: 0; }

/* Bandeaux, mot de passe oublié, choix mensuel / annuel */
.ok-banner { background: var(--ok-soft); }
.warn-banner { background: var(--warn-soft); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.warn-banner.hidden { display: none; }
.forgot-link { font-size: 13px; align-self: flex-end; margin-top: -6px; }
.plans-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.plans-head .section-title { margin: 0; }
.toggle { display: inline-flex; background: var(--bg-soft); border-radius: 999px; padding: 3px; gap: 2px; }
.toggle-btn { border: 0; background: transparent; padding: 7px 14px; font-size: 13px; }
.toggle-btn.active { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.toggle-btn .chip { font-size: 11px; padding: 1px 7px; margin-left: 4px; }
#plan-current .row { margin-top: 16px; flex-wrap: wrap; }

/* Vidéo en cours d'analyse */
.tile-processing { background: var(--bg-soft); }
.tile-wait { position: absolute; inset: 0 0 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 12px; font-size: 13px; font-weight: 600; color: var(--muted); gap: 6px; }
.tile-wait small { font-weight: 400; }
.tile-error .tile-wait { color: var(--danger); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* Profil */
.danger-zone { border-color: var(--danger-soft); }
.danger-zone h2 { color: var(--danger); }

/* Admin */
.scroll-x { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
#admin-table { min-width: 860px; }
#admin-table select, #admin-table input { width: auto; padding: 6px 8px; font-size: 13px; }

/* Mise en page : menu à gauche, contenu centré, colonne de résumé à droite sur grand écran */
.shell { margin-left: var(--sidebar); display: flex; justify-content: center; min-height: 100vh; }
.shell main { margin-left: 0; flex: 1 1 auto; max-width: 900px; min-width: 0; border-left: 1px solid var(--border); }
.rail { display: none; width: 330px; flex-shrink: 0; padding: 24px 20px 40px; position: sticky; top: 0; align-self: flex-start; max-height: 100vh; overflow-y: auto; }
.rail-card { border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; margin-bottom: 14px; background: var(--surface); }
.rail-card:empty { display: none; }
.rail-card h3 { margin: 0 0 8px; font-size: 15px; }
.rail-card p { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.rail-card .btn { width: 100%; }
.rail-card .meter + .meter { margin-top: 12px; }
.rail-plan-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.rail-plan-top b { font-size: 18px; }
.rail-help ul.clean { margin: 0; padding-left: 18px; font-size: 13px; }
.rail-help ul.clean li { margin-bottom: 8px; }
.rail-status { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.rail-status .led { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.rail-status .led.on { background: var(--ok); }
.rail-status .led.run { background: var(--accent); animation: pulse 1.2s infinite; }
@media (min-width: 1240px) { .rail { display: block; } .shell main { border-right: 1px solid var(--border); } }

@media (max-width: 860px) {
  .shell { margin-left: 0; }
  .shell main { border-left: 0; }
  .plan-chip { display: none; }
  .meters { grid-template-columns: 1fr; }
  .plans-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) { .plans-grid { grid-template-columns: 1fr; } }
