/* ═══════════════════════════════════════════════════════════════════════
   Mirubiki — Design System (harmonisé avec landing.html)
   Thème sombre par défaut, thème clair via data-theme="light"
   Police : Open Sans (Google Fonts chargé dans chaque page)
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Thème sombre (par défaut) ─────────────────────────────────────── */

:root {
    /* ajuste fonts pour les navigateurs / OS */
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    font-feature-settings: "kern";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* dark mode */
    --ink: #f8fafc;
    --paper: #0a0b0f;
    --cream: #111827;
    --ecru: #1e293b;
    --accent: #00e6c3;
    --teal: #22d3ee;
    --muted: #94a3b8;
    --card: #1e293b;
    --border: rgba(148, 163, 184, 0.15);
    --overlay: rgba(0, 0, 0, 0.7);
    --error: #e06c6c;
    --success: #4ade80;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    --radius: 8px;
    --radius-lg: 12px;
    --bg: var(--paper);
    --chip: #334155;
}

/* ─── Thème clair (choix manuel) ────────────────────────────────────── */

[data-theme="light"] {
    --ink: #0d0e12;
    --paper: #f5f2eb;
    --cream: #ede9df;
    --ecru: #e4e0d5;
    --accent: #ff4d1c;
    --teal: #0bbfa0;
    --muted: #6b7280;
    --card: #ffffff;
    --border: rgba(13, 14, 18, 0.08);
    --overlay: rgba(0, 0, 0, 0.4);
    --error: #dc2626;
    --success: #16a34a;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --bg: var(--paper);
    --chip: #e4e4e7;
}

/* ─── Reset global ──────────────────────────────────────────────────── */

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

body {
    font-family:
        "Open Sans",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    background: var(--paper);
    color: var(--ink);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ─── Header (sticky, comme landing) ──────────────────────────────────── */

header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(10, 11, 15, 0.82);
    backdrop-filter: blur(18px) saturate(1.4);
    border-bottom: 1px solid var(--border);
    color: var(--ink);
}
[data-theme="light"] header {
    background: rgba(245, 242, 235, 0.82);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
    max-width: none;
    padding-left: 24px;
    padding-right: 24px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

header .logo-img {
    height: 36px;
    width: auto;
}

[data-theme="dark"] header .logo-img {
    filter: brightness(0) invert(1);
}

header .logo-text {
    font-family: "Open Sans", sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.03em;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

header .subtitle {
    color: var(--muted);
    margin-top: 4px;
    font-size: 0.95rem;
}

/* ─── Theme toggle ──────────────────────────────────────────────────── */

#theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--muted);
    cursor: pointer;
    padding: 10px;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        color 0.2s ease-in-out,
        border-color 0.2s ease-in-out;
}

#theme-toggle:hover,
#theme-toggle:focus-visible {
    color: var(--accent);
    border-color: var(--accent);
    outline: none;
}

/* ─── Boutons ───────────────────────────────────────────────────────── */

.btn-orange {
    background: var(--accent);
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition:
        filter 0.2s,
        box-shadow 0.2s;
}
.btn-orange:hover {
    filter: brightness(0.85);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.btn-orange:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}
.btn-primary,
.btn-secondary,
.btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    height: 44px;
    padding: 10px 24px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    line-height: 1.2;
    border: none;
    cursor: pointer;
    transition:
        background 0.2s ease-in-out,
        opacity 0.2s ease-in-out;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
}
.btn-primary:hover {
    background: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(255, 77, 28, 0.28);
}
.btn-primary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

/* ─── Admin tabs (segmented pills) ──────────────────────────────────── */
.admin-tabs {
    display: inline-flex;
    gap: 0.25rem;
    background: var(--paper);
    padding: 0.25rem;
    border-radius: 10px;
    border: 1px solid var(--border);
}
.admin-tabs a,
.admin-tabs span {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 7px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    line-height: 1.3;
    color: var(--muted);
}
.admin-tabs a:hover {
    background: var(--card);
    color: var(--ink);
}
.admin-tabs span.active {
    background: var(--accent);
    color: var(--paper);
    cursor: default;
}
/* Accent pill (Mes sondages) — inside the tabs container */
.admin-tabs .pill-accent,
.admin-tabs a.pill-accent {
    background: var(--accent);
    color: var(--paper);
}
.admin-tabs a.pill-accent:hover {
    background: var(--accent);
    opacity: 0.9;
    color: var(--paper);
}

/* ─── Bouton-pill (même hauteur que .admin-tabs) ──────────────────── */
.btn-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
    border-radius: 7px;
    background: var(--accent);
    color: #ffffff;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.15s;
}
.btn-pill:hover {
    opacity: 0.9;
    color: #ffffff;
    text-decoration: none;
}

.btn-secondary {
    background: var(--card);
    color: var(--ink);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.btn-secondary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.btn-back {
    background: transparent;
    color: var(--muted);
    font-size: 0.9rem;
    padding: 8px 16px;
}
.btn-back:hover {
    color: var(--ink);
}
.btn-back:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.btn-remove {
    background: none;
    border: none;
    color: var(--error);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px 8px;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    transition: background 0.2s ease-in-out;
}
.btn-remove:hover {
    background: var(--card);
}
.btn-remove:focus-visible {
    outline: 2px solid var(--error);
    outline-offset: -2px;
}

/* Loading spinner dans les boutons */
.btn-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ─── Sections ──────────────────────────────────────────────────────── */

main.container {
    padding: 32px 0;
}
section {
    margin-bottom: 32px;
}

h2 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
}

.help {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 8px;
}

/* ─── Stats grid ────────────────────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.stat-card .stat-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--muted);
}

.stat-card.loading {
    opacity: 0.5;
}

/* ─── Steps ─────────────────────────────────────────────────────────── */

/* ─── Formulaires ───────────────────────────────────────────────────── */

.form-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

textarea,
input[type="text"],
input[type="number"],
select {
    width: 100%;
    min-height: 44px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--paper);
    color: var(--ink);
    transition:
        border-color 0.2s ease-in-out,
        box-shadow 0.2s ease-in-out;
}

textarea:focus,
input:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.params-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.params-grid label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 4px;
    color: var(--muted);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

/* ─── Questions custom ──────────────────────────────────────────────── */

.question-custom {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    padding: 8px;
    background: var(--card);
    border-radius: var(--radius);
}

.question-custom select {
    width: auto;
    min-width: 120px;
}

/* ─── Thèmes ────────────────────────────────────────────────────────── */

.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.theme-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    cursor: pointer;
    transition:
        border-color 0.2s ease-in-out,
        background 0.2s ease-in-out;
    user-select: none;
    background: var(--card);
}

.theme-card:hover {
    border-color: var(--accent);
}
.theme-card.selected {
    border-color: var(--accent);
    background: var(--card);
}
.theme-card h4 {
    font-size: 0.9rem;
    margin-bottom: 4px;
}
.theme-card p {
    font-size: 0.8rem;
    color: var(--muted);
}
.theme-card .question-count {
    font-size: 0.75rem;
    color: var(--accent);
    margin-top: 4px;
}

/* ─── Progress ──────────────────────────────────────────────────────── */

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    margin: 16px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.5s;
    border-radius: 4px;
}

/* ─── Résultats ─────────────────────────────────────────────────────── */

.result-header {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}

.result-meta {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 4px;
}

.result-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}

.synthese-content {
    line-height: 1.8;
}
.synthese-content h3 {
    margin-top: 20px;
    margin-bottom: 8px;
    color: var(--ink);
    font-size: 1.05rem;
}
.synthese-content p {
    margin-bottom: 8px;
}

.verbatim-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.verbatim-filters select {
    width: auto;
}

.verbatim-item {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    background: var(--card);
}

.verbatim-item .persona-info {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.verbatim-item .qa {
    margin-bottom: 4px;
}
.verbatim-item .q {
    font-weight: 600;
    font-size: 0.85rem;
}
.verbatim-item .r {
    font-size: 0.9rem;
    margin-left: 12px;
}
.verbatim-item .r .hl {
    background: var(--accent);
    color: #fff;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 600;
}

.result-actions {
    text-align: center;
    margin-top: 16px;
}

/* ─── Graphiques ──────────────────────────────────────────────────── */

#stats-section {
    overflow: visible;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.summary-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
}

.summary-q {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 4px;
}
.summary-answer {
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 2px;
}
.summary-pct {
    font-size: 0.85rem;
    color: var(--success);
    font-weight: 600;
}

#charts-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.chart-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    overflow: hidden;
    margin-top: 8px;
    margin-bottom: 8px;
}

.chart-box h3 {
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: var(--ink);
}

.chart-wrap {
    position: relative;
    width: 100%;
    height: 280px;
}

.chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    min-width: 0;
}

.chart-row > div {
    min-height: 300px;
    overflow: hidden;
}
.chart-row .chart-wrap {
    height: 240px;
}

#demographics-charts h3 {
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: var(--ink);
}

/* ─── Toasts ────────────────────────────────────────────────────────── */

#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius);
    color: #ffffff;
    font-size: 0.9rem;
    animation: toast-in 0.3s ease-out;
    max-width: 360px;
    pointer-events: auto;
    box-shadow: var(--shadow);
}

.toast-error {
    background: var(--error);
}
.toast-success {
    background: var(--success);
}
.toast-info {
    background: var(--accent);
}
.toast-warning {
    background: #f59e0b;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
}

/* ─── Utilitaires ───────────────────────────────────────────────────── */

.hidden {
    display: none !important;
}

.loading {
    color: var(--muted);
    font-style: italic;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 16px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 0.4;
    }
    50% {
        opacity: 1;
    }
}

/* ─── Login page ─────────────────────────────────────────────────────── */

.login-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.login-page main {
    flex: 1;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50vh;
}

.login-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 440px;
    width: 100%;
    text-align: center;
}

.login-card h2 {
    justify-content: center;
    margin-bottom: 8px;
}
.login-card .help {
    margin-bottom: 20px;
}
.login-card form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.login-card input {
    text-align: center;
    min-height: 56px;
    font-size: 1.1rem;
    padding: 14px 16px;
}

.login-success {
    color: var(--success);
    font-size: 0.9rem;
    margin-top: 12px;
}

.login-error {
    color: var(--error);
    font-size: 0.9rem;
    margin-top: 12px;
}

/* ─── Header right / User badges ─────────────────────────────────────── */

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 8px;
}

.user-badge {
    font-size: 0.8rem;
    color: var(--muted);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.plan-badge {
    font-size: 0.8rem;
    padding: 2px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition:
        border-color 0.2s,
        box-shadow 0.2s,
        background 0.2s;
}
.plan-badge:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

/* Plan status-based backgrounds */
.plan-badge.plan-active {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.3);
    background: rgba(74, 222, 128, 0.08);
}
.plan-badge.plan-inactive {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
    background: rgba(248, 113, 113, 0.08);
}
.plan-badge.plan-admin {
    color: #fbbf24;
    border-color: rgba(251, 191, 54, 0.3);
    background: rgba(251, 191, 54, 0.1);
}
.plan-badge.plan-admin:hover {
    border-color: #fbbf24;
    box-shadow: 0 0 0 1px #fbbf24;
}

.plan-badge.plan-starter {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.3);
    background: rgba(74, 222, 128, 0.08);
}

.plan-badge.plan-pro {
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.3);
    background: rgba(96, 165, 250, 0.08);
}

.plan-badge.plan-enterprise {
    color: #c084fc;
    border-color: rgba(192, 132, 252, 0.3);
    background: rgba(192, 132, 252, 0.08);
}

.plan-badge.plan-admin {
    color: #fbbf24;
    border-color: rgba(251, 191, 54, 0.3);
    background: rgba(251, 191, 54, 0.1);
}

.btn-sm {
    font-size: 0.8rem;
    padding: 6px 14px;
    min-height: 32px;
    height: auto;
}

/* Spinner pour les focus groups en cours */
.survey-status.status-running svg {
    animation: focusSpin 1.2s linear infinite;
    transform-origin: center;
}
@keyframes focusSpin {
    to { transform: rotate(360deg); }
}

/* ─── Dashboard / Survey cards ───────────────────────────────────────── */

.surveys-list {
    margin-top: 0;
    padding-top: 0;
}

.surveys-list h2 {
    margin-bottom: 16px;
}

/* ─── Package editor ─────────────────────────────────────────────────── */

.package-editor-box {
    background: var(--card);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 12px;
}

.package-editor-box h3 {
    font-size: 1rem;
    margin-bottom: 12px;
}
.package-editor-box input[type="text"],
.package-editor-box textarea {
    width: 100%;
    margin-bottom: 8px;
}

.pkg-add-question-form {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: start;
    margin: 12px 0;
}

.pkg-add-question-form > * {
    margin-bottom: 0;
}
#pkg-q-options-container {
    grid-column: 1 / -1;
}

.pkg-editor-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.pkg-question-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.pkg-question-item .q-info {
    flex: 1;
    display: flex;
    gap: 8px;
    align-items: center;
}

.pkg-question-item .q-type-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    white-space: nowrap;
}

.pkg-question-item .q-options-preview {
    font-size: 0.75rem;
    color: var(--muted);
    margin-left: 8px;
}

.pkg-question-item .btn-remove {
    font-size: 1rem;
    padding: 2px 6px;
    min-height: 28px;
    min-width: 28px;
}

/* ─── Tags (options de questions) ────────────────────────────────────── */

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
    min-height: 32px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    font-size: 0.8rem;
}

.tag .tag-remove {
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.7;
    background: none;
    border: none;
    color: #fff;
    padding: 0 2px;
}
.tag .tag-remove:hover {
    opacity: 1;
}

/* ─── Package cards dans survey ──────────────────────────────────────── */

.pkg-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 8px;
    background: var(--card);
    cursor: pointer;
    transition: border-color 0.2s;
}

.pkg-card:hover {
    border-color: var(--accent);
}
.pkg-card.selected {
    border-color: var(--accent);
    background: var(--card);
}

.pkg-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pkg-card-header h4 {
    font-size: 0.95rem;
}

.pkg-card .pkg-meta {
    font-size: 0.8rem;
    color: var(--muted);
}

.pkg-card .pkg-actions {
    display: flex;
    gap: 6px;
}

.pkg-card .pkg-questions-preview {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--muted);
}

.pkg-card .pkg-questions-preview li {
    margin-left: 16px;
    margin-bottom: 2px;
}

/* ─── Options input inline dans questions perso ──────────────────────── */

.q-options-inline {
    grid-column: 1 / -1;
    padding: 8px;
    margin-top: 4px;
    background: var(--paper);
    border-radius: var(--radius);
}

.q-options-inline input {
    min-height: 36px;
    font-size: 0.85rem;
}

/* ─── Status badges sondages ─────────────────────────────────────────── */

.survey-status {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.survey-status.status-completed {
    background: #22c55e22;
    color: #22c55e;
}
.survey-status.status-running {
    background: #f59e0b22;
    color: #f59e0b;
}
.survey-status.status-draft {
    background: #6366f122;
    color: #6366f1;
}

/* ─── Template badges ──────────────────────────────────────────── */
.survey-status.badge-user {
    background: #0ea5e922;
    color: #0ea5e9;
}
.survey-status.badge-system {
    background: #8b5cf622;
    color: #8b5cf6;
}

.survey-card.card-disabled {
    cursor: default;
    opacity: 0.7;
}
.survey-card.card-disabled:hover {
    border-color: var(--border);
}

/* ─── Survey toolbar (search + filter chips) ────────────────────── */
.survey-toolbar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.survey-search-wrap {
    position: relative;
    width: 100%;
}
.survey-search-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s;
}
.survey-search-input:focus {
    border-color: var(--accent);
}
.survey-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.chip {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    transition:
        background 0.15s,
        color 0.15s,
        border-color 0.15s;
}
.chip:hover {
    border-color: var(--accent);
    color: var(--ink);
}
.chip-active {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}
.chip-active:hover {
    color: #ffffff;
}

/* ─── Chips plus petits (catégories) ───────────────────────────── */
.chip-sm {
    font-size: 0.72rem;
    padding: 2px 10px;
}

/* ─── Survey temporal groups ────────────────────────────────────── */
.survey-group {
    margin-bottom: 12px;
}
.survey-group-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--muted);
    margin-bottom: 8px;
    padding: 0;
}

/* ─── Survey card (dense) ────────────────────────────────────────── */
.survey-card {
    display: block;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 4px;
    text-decoration: none;
    color: var(--ink);
    transition:
        border-color 0.2s ease-in-out,
        background 0.2s ease-in-out;
}
.survey-card:hover {
    border-color: var(--accent);
    background: var(--card);
}
.survey-card .survey-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.survey-card .survey-card-left {
    flex: 1;
    min-width: 0;
}
.survey-card .survey-card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.survey-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
}
.survey-meta {
    font-size: 0.75rem;
    color: var(--muted);
}
.survey-date {
    float: right;
}
.survey-status {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
    max-height: 22px;
    overflow: hidden;
}
.survey-status svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.survey-status.status-completed {
    background: #22c55e22;
    color: #22c55e;
}
.survey-status.status-running {
    background: #f59e0b22;
    color: #f59e0b;
}
.survey-status.status-draft {
    background: #6366f122;
    color: #6366f1;
}
.survey-status.status-cancelled {
    background: #f8717122;
    color: #f87171;
}
.survey-status.status-failed {
    background: #ef444422;
    color: #ef4444;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    flex-shrink: 0;
    transition:
        color 0.15s,
        background 0.15s,
        border-color 0.15s;
}
.btn-icon:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-cancel {
    color: #e06c6c;
    animation: pulse-cancel 2s ease-in-out infinite;
}
.btn-cancel:hover {
    color: #fff;
    background: #e06c6c;
    animation: none;
}

@keyframes pulse-cancel {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
.spinner {
    animation: spin 1s linear infinite;
    transform-origin: center;
}
.survey-status svg {
    width: 14px;
    height: 14px;
}

.survey-card .survey-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.survey-card .survey-date {
    color: var(--muted);
    font-size: 0.75rem;
}

/* ─── Question en édition ────────────────────────────────────────────── */

.pkg-question-item.editing {
    border-color: var(--accent);
    background: var(--accent-bg, rgba(99, 102, 241, 0.08));
    box-shadow: 0 0 0 1px var(--accent);
}

.pkg-question-item:hover {
    cursor: pointer;
    border-color: var(--accent);
}

.pkg-question-item.editing {
    border-color: var(--accent);
    background: var(--accent-bg, rgba(99, 102, 241, 0.08));
    box-shadow: 0 0 0 1px var(--accent);
}

/* ─── Question editor in-place ───────────────────────────────────────── */

.pkg-question-editor {
    padding: 10px;
    border: 2px solid var(--accent);
    border-radius: 8px;
    background: var(--card-bg);
    margin-bottom: 6px;
}

.pkg-question-editor .qe-text {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--txt);
    font-size: 0.875rem;
    box-sizing: border-box;
    margin-bottom: 6px;
}

.pkg-question-editor .qe-type {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--txt);
    font-size: 0.825rem;
    margin-bottom: 6px;
}

.pkg-question-editor .qe-options-container {
    margin-bottom: 6px;
}

.pkg-question-editor .qe-options-container label {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 4px;
}

.pkg-question-editor .qe-options-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--txt);
    font-size: 0.825rem;
    box-sizing: border-box;
    margin-top: 4px;
}

.pkg-question-editor .qe-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 6px;
}

/* ─── Form actions (save draft + launch) ─────────────────────────────── */

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    justify-content: flex-end;
}

.form-actions .btn-primary,
.form-actions .btn-secondary {
    min-width: 200px;
    justify-content: center;
}

/* ─── Package editor in-place ───────────────────────────────────────── */

.pkg-card.pkg-editing {
    border-color: var(--accent);
    background: var(--card-bg);
}

.pkg-editor-box {
    padding: 12px;
}

.pkg-editor-box h4 {
    margin: 0 0 12px;
    font-size: 1rem;
}

.pkg-edit-nom,
.pkg-edit-desc {
    width: 100%;
    margin-bottom: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--txt);
    font-size: 0.875rem;
    box-sizing: border-box;
}

.pkg-editor-questions {
    margin: 8px 0;
}

.pkg-add-question-form {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin: 8px 0;
    padding: 8px;
    border: 1px dashed var(--border);
    border-radius: 6px;
}

.pkg-edit-q-text {
    flex: 1;
    min-width: 150px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--txt);
    font-size: 0.825rem;
}

.pkg-edit-q-type {
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--txt);
    font-size: 0.825rem;
}

.pkg-edit-q-options-container {
    width: 100%;
    margin-top: 4px;
}

.pkg-edit-q-options-container label {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 4px;
}

.pkg-edit-q-options-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--txt);
    font-size: 0.825rem;
    box-sizing: border-box;
}

.pkg-editor-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}

/* ─── Section header (titre + bouton à droite) ──────────────────────── */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h2 {
    margin: 0;
    font-size: 1rem;
}

/* ─── Footer (harmonisé avec landing) ─────────────────────────────────── */

footer {
    border-top: 1px solid var(--border);
    padding: 48px 0 24px;
    color: var(--muted);
    font-size: 0.83rem;
}

.footer-brand .logo-img {
    height: 32px;
    width: 32px;
    filter: brightness(0) invert(1);
}
[data-theme="light"] .footer-brand .logo-img {
    filter: none;
}
.footer-brand p {
    color: var(--muted);
    font-size: 0.92rem;
    max-width: 260px;
    margin-top: 14px;
    font-weight: 300;
}

.footer-col a {
    display: block;
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 10px;
    font-weight: 400;
    transition: color 0.2s;
    text-decoration: none;
}
.footer-col a:hover {
    color: var(--ink);
}

/* ─── Responsive ────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .steps,
    .params-grid {
        grid-template-columns: 1fr;
    }
    .themes-grid {
        grid-template-columns: 1fr;
    }
    .verbatim-filters {
        flex-direction: column;
    }
    .verbatim-filters select {
        width: 100%;
    }
    .chart-row {
        grid-template-columns: 1fr;
    }
}

/* ─── HERO ─── */

.hero {
    padding: 96px 0 0;
    position: relative;
    overflow: hidden;
}
.hero {
    padding-bottom: 0;
}

.hero-orb {
    position: absolute;
    top: -120px;
    right: -180px;
    width: 640px;
    height: 640px;
    border-radius: 50%;
    background: radial-gradient(
        circle at 40% 40%,
        rgba(11, 191, 160, 0.18) 0%,
        rgba(255, 77, 28, 0.08) 55%,
        transparent 75%
    );
    pointer-events: none;
    animation: orb-drift 8s ease-in-out infinite alternate;
}

@keyframes orb-drift {
    from {
        transform: translate(0, 0) scale(1);
    }
    to {
        transform: translate(-24px, 32px) scale(1.04);
    }
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px 8px 10px;
    border-radius: 999px;
    border: 1.5px solid rgba(11, 191, 160, 0.3);
    background: rgba(11, 191, 160, 0.08);
    font-size: 0.8rem;
    font-weight: 600;
    color: #059980;
    letter-spacing: 0.04em;
    margin-bottom: 30px;
}
.hero-eyebrow span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--teal);
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(11, 191, 160, 0.5);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(11, 191, 160, 0);
    }
}

h1 {
    font-family: "Open Sans", sans-serif !important;
    font-size: clamp(3rem, 7.5vw, 5.6rem);
    font-weight: 800;
    line-height: 0.97;
    letter-spacing: -0.05em;
    color: var(--ink);
    margin-bottom: 28px;
}

h1 .outline {
    -webkit-text-stroke: 2px var(--ink);
    color: transparent;
}

h1 .accent-word {
    color: var(--accent);
}

.hero-sub {
    font-size: 1.08rem;
    color: var(--muted);
    line-height: 1.7;
    max-width: 480px;
    margin-bottom: 40px;
    font-weight: 300;
}

.hero-btns {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: start;
}

/* ─── PHOTO CARD ─── */

.photo-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 8px;
    box-shadow: 0 32px 72px rgba(13, 14, 18, 0.1);
    position: relative;
    overflow: hidden;
    animation: float 5s ease-in-out infinite alternate;
    animation-delay: -2.5s;
}
.photo-card img {
    border-radius: 18px;
    max-width: 100%;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* ─── MARQUEE STRIP ─── */

.marquee-strip {
    margin: 80px 0 0;
    overflow: hidden;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    background: var(--cream);
}
.marquee-track {
    display: flex;
    gap: 56px;
    white-space: nowrap;
    animation: marquee 22s linear infinite;
}
.marquee-track:hover {
    animation-play-state: paused;
}
@keyframes marquee {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}
.marquee-item {
    font-family: "Open Sans", sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 16px;
}
.marquee-item::after {
    content: "✦";
    font-size: 0.6rem;
    color: var(--accent);
}

/* ─── SECTIONS ─── */

section {
    padding: 110px 0;
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 20px;
}
.section-label::before {
    content: "";
    display: block;
    width: 24px;
    height: 2px;
    background: var(--accent);
}

h2 {
    font-family: "Open Sans", sans-serif;
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.08;
    color: var(--ink);
    margin-bottom: 18px;
}
h2 .teal {
    color: var(--teal);
}

h3 {
    font-family: "Open Sans", sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

p.body {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.75;
    font-weight: 300;
}

/* ─── POSITIONING BANNER ─── */

.positioning-wrap {
    background: var(--ink);
    border-radius: 28px;
    padding: 52px 56px;
    margin-bottom: 60px;
    position: relative;
    overflow: hidden;
    color: var(--paper);
}
[data-theme="dark"] .positioning-wrap {
    background: #1e293b;
}
.positioning-wrap::before {
    content: "";
    position: absolute;
    top: -80px;
    right: -80px;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(11, 191, 160, 0.2) 0%,
        transparent 65%
    );
    pointer-events: none;
}
.positioning-wrap::after {
    content: "";
    position: absolute;
    bottom: -60px;
    left: 40%;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(255, 77, 28, 0.15) 0%,
        transparent 65%
    );
    pointer-events: none;
}
.positioning-wrap p.body {
    color: rgba(245, 242, 235, 0.65);
}
.positioning-wrap h2 {
    color: var(--paper);
    margin-bottom: 14px;
}

/* ─── STEPS ─── */

.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
.step {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 28px 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
}
.step:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 48px rgba(13, 14, 18, 0.08);
    border-color: var(--teal);
}
.step::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--teal), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}
.step:hover::before {
    transform: scaleX(1);
}

.step-num {
    font-family: "Open Sans", sans-serif;
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1;
    color: var(--ecru);
    margin-bottom: 16px;
}

/* ─── Header Responsive ────────────────────────────────────────────────── */

@media (max-width: 768px) {
  header > .container {
    flex-wrap: wrap !important;
    height: auto !important;
    padding: 12px 16px !important;
    gap: 8px;
  }
  .header-center {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
    justify-content: center !important;
    gap: 8px 16px !important;
    padding-top: 4px;
  }
  .header-center a {
    white-space: nowrap;
    font-size: 0.85rem;
  }
}

/* ─── BENTO ─── */

.bento {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto auto;
    gap: 18px;
    margin-top: 44px;
}
.bcard {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 30px;
    min-height: 190px;
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
}
.bcard:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 44px rgba(13, 14, 18, 0.07);
    border-color: var(--accent);
}
.b-6 {
    grid-column: span 6;
}
.b-4 {
    grid-column: span 4;
}
.b-8 {
    grid-column: span 8;
}
.b-teal {
    background: var(--teal);
    color: #fff;
}
[data-theme="dark"] .b-teal {
    background: #0d9488;
}
.b-teal h3 {
    color: #fff;
}
.b-teal p.body {
    color: rgba(255, 255, 255, 0.75);
}
.b-ink {
    background: var(--ink);
    color: var(--paper);
}
.b-ink h3 {
    color: var(--paper);
}
.b-ink p.body {
    color: rgba(245, 242, 235, 0.6);
}
.b-cream {
    background: var(--cream);
}
.b-cream h3 {
    color: var(--ink);
}
.b-cream p.body {
    color: var(--muted);
}
.bcard p.body {
    font-weight: 400;
}

.bcard-inner {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}
.bcard-icon-wrap {
    flex-shrink: 0;
    width: 48px;
    display: flex;
    justify-content: center;
}
.bcard-icon-wrap .bcard-icon {
    font-size: 2.4rem;
    margin-bottom: 0;
    display: inline-flex;
}
.bcard-icon-wrap .bcard-icon svg {
    width: 40px;
    height: 40px;
}
.bcard-content {
    flex: 1;
    min-width: 0;
}
.bcard-content .bcard-number {
    font-size: 2.4rem;
    margin-bottom: 4px;
}
.bcard-content h3 {
    margin-bottom: 8px;
}
.bcard-content p.body {
    margin-bottom: 0;
}

.bcard-icon {
    font-size: 1.8rem;
    margin-bottom: 16px;
    display: block;
}

.bcard-number {
    font-family: "Open Sans", sans-serif;
    font-size: 3.4rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
    letter-spacing: -0.04em;
}

/* ─── PRICING ─── */

/* ═══════════════════════════════════════════
           PRICING — Selected / Unselected system
           ═══════════════════════════════════════════ */

#pricing {
    background: var(--cream);
    border-radius: 40px;
    margin: 0 24px;
}

.pricing-header {
    text-align: center;
    margin-bottom: 52px;
}
.pricing-header h2 {
    display: block;
    text-align: center;
    font-family: "Open Sans", sans-serif;
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.08;
    color: var(--ink);
    margin-bottom: 18px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ── Base card ── */
.price-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 26px;
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition:
        background-color 0.35s ease,
        transform 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease,
        opacity 0.3s ease;
}
.price-card h3 {
    letter-spacing: normal;
}

/* ── SELECTED state (ex-Option 2 / Pro) ── */
.price-card.selected {
    transform: scale(1.04);
    border-color: rgba(34, 211, 238, 0.25);
    box-shadow: 0 28px 64px rgba(13, 14, 18, 0.14);
}
.price-card.selected .price-val {
    color: var(--teal);
}
.price-card.selected .btn {
    background: var(--accent);
    color: #fff;
    border: 1.5px solid var(--accent);
    box-shadow: 0 8px 28px rgba(255, 77, 28, 0.28);
}
[data-theme="dark"] .price-card.selected .btn {
    box-shadow: 0 8px 28px rgba(0, 230, 195, 0.28);
    color: #0a0b0f;
}
.price-card.selected .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(255, 77, 28, 0.36);
}
[data-theme="dark"] .price-card.selected .btn:hover {
    box-shadow: 0 14px 36px rgba(0, 230, 195, 0.36);
}

/* ── UNSELECTED state (ex-Option 1 / Starter) ── */
.price-card.unselected {
    transform: scale(1);
    border-color: var(--border);
    box-shadow: none;
}
.price-card.unselected .price-val {
    color: var(--ink);
}
.price-card.unselected .btn {
    background: transparent;
    color: var(--ink);
    border: 1.5px solid var(--border);
    box-shadow: none;
}
.price-card.unselected .btn:hover {
    border-color: var(--ink);
    background: rgba(13, 14, 18, 0.04);
    transform: translateY(-1px);
}

/* ── HOVER : via CSS :has() — override les classes de base ── */

/* Quand UNE carte est survolée, toutes passent en "unselected" */
.pricing-grid:has(.price-card:hover) .price-card {
    transform: scale(0.97) !important;
    opacity: 0.85;
    border-color: var(--border) !important;
    box-shadow: none !important;
}
.pricing-grid:has(.price-card:hover) .price-card .price-val {
    color: var(--ink) !important;
}
.pricing-grid:has(.price-card:hover) .price-card .btn {
    background: transparent !important;
    color: var(--ink) !important;
    border: 1.5px solid var(--border) !important;
    box-shadow: none !important;
}

/* La carte survolée redevient "selected" (mais plus grande) */
.pricing-grid:has(.price-card:hover) .price-card:hover {
    transform: translateY(-6px) scale(1.07) !important;
    opacity: 1;
    border-color: var(--teal) !important;
    box-shadow: 0 28px 64px rgba(13, 14, 18, 0.14) !important;
}
.pricing-grid:has(.price-card:hover) .price-card:hover .price-val {
    color: var(--teal) !important;
}
.pricing-grid:has(.price-card:hover) .price-card:hover .btn {
    background: var(--accent) !important;
    color: #fff !important;
    border: 1.5px solid var(--accent) !important;
    box-shadow: 0 8px 28px rgba(255, 77, 28, 0.28) !important;
}
[data-theme="dark"]
    .pricing-grid:has(.price-card:hover)
    .price-card:hover
    .btn {
    box-shadow: 0 8px 28px rgba(0, 230, 195, 0.28) !important;
    color: #0a0b0f !important;
}
.pricing-grid:has(.price-card:hover) .price-card:hover .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(255, 77, 28, 0.36) !important;
}
[data-theme="dark"]
    .pricing-grid:has(.price-card:hover)
    .price-card:hover
    .btn:hover {
    box-shadow: 0 14px 36px rgba(0, 230, 195, 0.36) !important;
}

.price-badge {
    display: inline-block;
    padding: 5px 14px;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    align-self: flex-start;
}

.price-val {
    font-family: "Open Sans", sans-serif;
    font-size: 3.4rem;
    font-weight: 800;
    line-height: 1;
}
.price-val sup {
    font-size: 1.2rem;
    vertical-align: super;
    font-weight: 600;
}
.price-val small {
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.5;
}

.price-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 11px;
}
.price-card li {
    font-size: 0.9rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 10px;
}
.price-card li::before {
    content: "✓";
    font-weight: 700;
    color: var(--teal);
    font-size: 0.8rem;
}

.price-divider {
    height: 1px;
    background: var(--border);
}

.btn-pricing-start {
    border-radius: var(--radius);
    padding: 10px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    min-height: 44px;
    justify-content: center;
}

/* ─── LOGIN MODAL ─── */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay);
    backdrop-filter: blur(6px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.open {
    display: flex;
}

.modal-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 26px;
    padding: 48px 40px 40px;
    max-width: 420px;
    width: 100%;
    position: relative;
    animation: modal-in 0.3s ease;
}
@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.4rem;
    padding: 4px 8px;
    border-radius: 8px;
    transition: color 0.2s;
}
.modal-close:hover {
    color: var(--ink);
}

.modal-box h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}
.modal-box p.help {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

.modal-box input[type="text"],
.modal-box input[type="email"] {
    width: 100%;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1.5px solid var(--border);
    background: var(--paper);
    color: var(--ink);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 16px;
}
.modal-box input:focus {
    border-color: var(--teal);
}

.modal-box .btn {
    width: 100%;
    justify-content: center;
    padding: 14px;
    border-radius: 14px;
    font-size: 0.95rem;
}

.login-status {
    margin-top: 16px;
    font-size: 0.88rem;
    text-align: center;
    padding: 10px 14px;
    border-radius: 12px;
    display: none;
}
.login-status.success {
    display: block;
    background: rgba(11, 191, 160, 0.1);
    color: var(--teal);
}
.login-status.error {
    display: block;
    background: rgba(255, 77, 28, 0.1);
    color: var(--accent);
}
.login-status.loading {
    display: block;
    color: var(--muted);
}

.modal-box .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ─── FOOTER ─── */

footer {
    padding: 32px 0 16px;
    border-top: 1px solid var(--border);
    margin-top: 32px;
}

.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 16px;
}

.footer-brand .logo-img {
    height: 32px;
    width: 32px;
}
.footer-brand p {
    color: var(--muted);
    font-size: 0.92rem;
    max-width: 260px;
    margin-top: 14px;
    font-weight: 300;
}

.footer-col-title {
    font-family: "Open Sans", sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 18px;
}

.footer-col a {
    display: block;
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 10px;
    font-weight: 400;
    transition: color 0.2s;
}
.footer-col a:hover {
    color: var(--ink);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 0.83rem;
    color: var(--muted);
}

/* ─── REVEAL ─── */

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity 0.65s ease,
        transform 0.65s ease;
}
.reveal.in {
    opacity: 1;
    transform: none;
}
.reveal-delay-1 {
    transition-delay: 0.1s;
}
.reveal-delay-2 {
    transition-delay: 0.2s;
}
.reveal-delay-3 {
    transition-delay: 0.3s;
}

/* ─── MOBILE ─── */

@media (max-width: 900px) {
    .hero-inner {
        grid-template-columns: 1fr;
    }
    .nav-links {
        display: none;
    }
    .steps {
        grid-template-columns: 1fr 1fr;
    }
    .bento {
        grid-template-columns: 1fr;
    }
    .b-6,
    .b-4,
    .b-8 {
        grid-column: span 1;
    }
    .pricing-grid {
        grid-template-columns: 1fr;
    }
    .pricing-grid:has(.price-card:hover) .price-card,
    .pricing-grid:has(.price-card:hover) .price-card:hover {
        transform: none !important;
        opacity: 1 !important;
    }
    .price-card.selected {
        transform: none !important;
    }
    .price-card.unselected {
        transform: none !important;
    }
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    #pricing {
        margin: 0 12px;
        border-radius: 28px;
    }
    .positioning-wrap {
        padding: 36px 28px;
    }
    .hero-orb {
        width: 400px;
        height: 400px;
        top: -80px;
        right: -100px;
    }
}

@media (max-width: 560px) {
    .steps {
        grid-template-columns: 1fr;
    }
    h1 {
        font-size: 2.6rem;
    }
    .modal-box {
        padding: 32px 24px 28px;
    }
}

/* ─── Usage card (dashboard) ────────────────────────────────── */
.usage-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.usage-card-header {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}
.usage-card-body {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 16px;
}
.usage-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.95rem;
}
.usage-label {
    color: var(--muted);
    margin-right: 4px;
}
.usage-value {
    font-weight: 600;
    color: var(--accent);
}
.usage-sep {
    color: var(--muted);
}
.usage-max {
    font-weight: 400;
    color: var(--muted);
}

/* ─── Editor action cards ────────────────────────────────── */
.editor-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
        "sample filters"
        "questions buttons";
    gap: 16px;
    margin-top: 24px;
    align-items: start;
}
.editor-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    min-height: 44px;
}
.sample-card {
    grid-area: sample;
}
.sample-card label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ink);
}
.sample-control {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.sample-value {
    font-size: 0.85rem;
    color: var(--muted);
    white-space: nowrap;
}

.sample-input {
    width: 30%;
    min-height: 32px;
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
    font-size: 0.85rem;
    text-align: center;
    flex: none;
}

#personas-input {
    width: 30%;
}

.filters-card {
    min-height: 120px;
}

.questions-card {
    min-height: 44px;
}

.sample-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(0, 230, 195, 0.15);
}
.questions-card {
    grid-area: questions;
}
.questions-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ink);
}
.questions-value {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.4;
    word-break: break-word;
}
.filters-card {
    grid-area: filters;
}
.buttons-card {
    grid-area: buttons;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
    min-height: 44px;
}

/* ─── Filter Popover ──────────────────────────────────────────── */

.btn-filter-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    min-height: 44px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        background 0.2s ease,
        transform 0.1s ease;
    width: 100%;
    justify-content: center;
}

.btn-filter-trigger:hover {
    background: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(255, 77, 28, 0.28);
}

.filter-popover {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 16px;
    z-index: 100;
    max-height: 500px;
    overflow-y: auto;
}

.filter-popover.hidden {
    display: none;
}

.filter-popover .filters-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-popover select {
    width: 100%;
    min-height: 36px;
    font-size: 0.85rem;
}

.filters-card {
    position: relative;
}

/* Aligner les hauteurs des cartes sample et questions */
.sample-card {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.questions-card {
    min-height: 58px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Cards génériques */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 12px;
    margin-bottom: 12px;
}

/* Citations dans les analyses — bloc avec barre verticale */
.citation-block {
    display: flex;
    gap: 0;
    padding: 8px 12px;
    margin: 12px 0;
    background: var(--bg-secondary, rgba(0,0,0,0.02));
    border-radius: 6px;
    border-left: 3px solid var(--accent, #00e6c3);
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--muted, #6b7280);
}
.citation-content {
    flex: 1;
}
.citation-author {
    display: inline;
    font-style: italic;
    font-size: 0.8rem;
    color: var(--muted-light, #94a3b8);
}

/* ─── Bascule mensuel / annuel ─── */
.billing-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 32px 0 48px;
    padding: 6px 24px;
    background: var(--bg-secondary, rgba(0,0,0,0.03));
    border-radius: 40px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}
.billing-label {
    font-size: 0.95rem;
    padding: 6px 0;
    color: var(--muted);
    cursor: pointer;
    transition: color .2s;
    font-weight: 500;
}
.billing-label.active {
    color: var(--text);
    font-weight: 700;
}
.billing-label small {
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 2px;
}
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border);
    border-radius: 26px;
    transition: .3s;
}
.toggle-slider:before {
    content: '';
    position: absolute;
    height: 20px; width: 20px;
    left: 3px; bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: .3s;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.toggle-switch input:checked + .toggle-slider {
    background: var(--accent);
}
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* ─── Tooltip personnalisé (data-tooltip) ──────────────────────── */
.chart-tooltip {
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    background: var(--card);
    color: var(--ink);
    padding: 6px 10px;
    border-radius: var(--radius);
    font-size: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: none;
    max-width: 320px;
    word-wrap: break-word;
    line-height: 1.4;
    opacity: 0.9;
}
