:root {
    --bg: #f6f7fb;
    --surface: #ffffff;
    --surface-muted: #f1f5f9;
    --text: #0f172a;
    --text-muted: #64748b;
    --primary: #5b5cff;
    --primary-600: #4a4de6;
    --primary-100: #eef2ff;
    --accent: #f97316;
    --success: #22c55e;
    --border: #e2e8f0;
    --shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.08);
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: min(1200px, 100% - 32px);
    margin: 0 auto;
}

.text-muted {
    color: var(--text-muted);
}

.section {
    padding: 80px 0;
}

.section__header {
    display: grid;
    gap: 10px;
    text-align: center;
    margin-bottom: 40px;
}

.section__title {
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    font-weight: 800;
}

.section__subtitle {
    color: var(--text-muted);
    max-width: 640px;
    margin: 0 auto;
}

.grid {
    display: grid;
    gap: 24px;
}

.grid--2 {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid--3 {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--primary-100);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.75rem;
    border: 1px solid rgba(91, 92, 255, 0.2);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.btn--primary {
    background: var(--primary);
    color: #fff;
}

.btn--primary:hover {
    background: var(--primary-600);
}

.btn--outline {
    background: transparent;
    border: 1px solid rgba(91, 92, 255, 0.5);
    color: var(--primary);
}

.btn--ghost {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}

.btn--lg {
    padding: 14px 24px;
    font-size: 1rem;
}

body.theme-dark {
    --bg: #0b1120;
    --surface: #111827;
    --surface-muted: #1f2937;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #1f2937;
    --shadow: 0 24px 60px rgba(2, 6, 23, 0.7);
    --shadow-soft: 0 16px 32px rgba(2, 6, 23, 0.45);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1120;
        --surface: #111827;
        --surface-muted: #1f2937;
        --text: #f8fafc;
        --text-muted: #94a3b8;
        --border: #1f2937;
        --shadow: 0 24px 60px rgba(2, 6, 23, 0.7);
        --shadow-soft: 0 16px 32px rgba(2, 6, 23, 0.45);
    }

    body {
        background: var(--bg);
        color: var(--text);
    }
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface-muted);
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.6);
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.9);
}

/* Navigation */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(246, 247, 251, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.nav__container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    gap: 16px;
}

.brand {
    font-size: 1.35rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav__menu {
    display: flex;
    align-items: center;
    gap: 22px;
    color: var(--text-muted);
    font-weight: 500;
}

.nav__menu a:hover {
    color: var(--text);
}

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

.nav__toggle {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 1.1rem;
    cursor: pointer;
}

/* Hero */
.hero {
    padding: 96px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(91, 92, 255, 0.15), transparent 55%),
                radial-gradient(circle at 80% 0%, rgba(249, 115, 22, 0.15), transparent 45%);
    z-index: 0;
}

.hero__layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 48px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero__title {
    font-size: clamp(2.5rem, 4vw, 3.75rem);
    font-weight: 900;
    line-height: 1.1;
    margin: 18px 0;
}

.hero__subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 520px;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 24px 0 12px;
}

.hero__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 24px;
}

.hero__stat {
    background: var(--surface);
    padding: 12px 18px;
    border-radius: 999px;
    font-size: 0.9rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.hero__card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.hero__preview {
    display: grid;
    gap: 16px;
}

.preview-item {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
}

.preview-pill {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(91, 92, 255, 0.12);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.75rem;
}

/* Features */
.feature-card {
    padding: 26px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.feature-card__icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary-100);
    color: var(--primary);
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.feature-card__title {
    font-weight: 700;
    margin-bottom: 8px;
}

.feature-card__text {
    color: var(--text-muted);
}

/* Steps */
.steps {
    display: grid;
    gap: 20px;
}

.step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
}

.step__index {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
}

/* Pricing */
.pricing-card {
    border-radius: var(--radius-lg);
    padding: 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    display: grid;
    gap: 18px;
}

.pricing-card--featured {
    border: 2px solid var(--primary);
    box-shadow: 0 24px 60px rgba(91, 92, 255, 0.25);
    position: relative;
    overflow: hidden;
}

.pricing-card--featured::after {
    content: "Populaire";
    position: absolute;
    top: 18px;
    right: -38px;
    background: var(--primary);
    color: #fff;
    padding: 6px 44px;
    transform: rotate(45deg);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.pricing-price {
    font-size: 2.6rem;
    font-weight: 800;
}

.pricing-list {
    list-style: none;
    display: grid;
    gap: 10px;
    color: var(--text-muted);
}

/* Testimonials */
.testimonial-card {
    padding: 26px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.testimonial-card__name {
    font-weight: 700;
    margin-top: 18px;
}

/* FAQ */
.faq {
    display: grid;
    gap: 16px;
}

.faq__item {
    padding: 20px 24px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
}

.faq__question {
    font-weight: 700;
    margin-bottom: 8px;
}

.faq__answer {
    color: var(--text-muted);
}

/* CTA */
.cta {
    background: linear-gradient(120deg, rgba(91, 92, 255, 0.15), rgba(249, 115, 22, 0.15));
    border-radius: var(--radius-xl);
    padding: 64px;
    text-align: center;
    border: 1px solid var(--border);
}

/* Footer */
.footer {
    padding: 48px 0;
    color: var(--text-muted);
}

.footer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 32px;
}

.footer__title {
    font-weight: 700;
    margin-bottom: 12px;
}

.footer__links {
    display: grid;
    gap: 8px;
    color: var(--text-muted);
}

/* Forms */
.form-group {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
}

.input,
.textarea,
.select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 1rem;
}

.input:focus,
.textarea:focus,
.select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(91, 92, 255, 0.15);
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
}

.modal.is-open {
    display: flex;
}

.modal__content {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 32px;
    width: min(420px, 100%);
    position: relative;
    box-shadow: var(--shadow);
}

.modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    border: none;
    background: var(--surface-muted);
    border-radius: 10px;
    width: 34px;
    height: 34px;
    cursor: pointer;
}

.form-switch {
    text-align: center;
    color: var(--text-muted);
    margin-top: 16px;
}

/* Dashboard */
.app-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 28px 22px;
    display: grid;
    gap: 24px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.2rem;
}

.sidebar__profile {
    background: var(--surface-muted);
    padding: 14px;
    border-radius: 16px;
    display: grid;
    gap: 6px;
}

.sidebar__avatar {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.sidebar__nav {
    display: grid;
    gap: 6px;
}

.sidebar__link {
    padding: 12px 14px;
    border-radius: 14px;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.sidebar__link.is-active,
.sidebar__link:hover {
    background: var(--primary-100);
    color: var(--primary);
}

.app-main {
    padding: 32px 36px 48px;
    background: var(--bg);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.topbar__title {
    font-size: 1.6rem;
    font-weight: 800;
}

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

.search {
    background: var(--surface);
    border-radius: 999px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.search input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.95rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

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

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

.stat-card__value {
    font-size: 1.8rem;
    font-weight: 800;
    margin-top: 6px;
}

.panel {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    margin-bottom: 24px;
}

.card {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.panel__title {
    font-size: 1.2rem;
    font-weight: 700;
}

.link-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-muted);
    margin-bottom: 12px;
}

.link-row__title {
    font-weight: 600;
}

.link-row__url {
    color: var(--text-muted);
    font-size: 0.85rem;
    word-break: break-all;
}

.link-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--border);
}

.icon-btn:hover {
    color: var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary);
}

.sidebar__toggle {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 12px;
    cursor: pointer;
}

/* Public profile */
.public-page {
    background: linear-gradient(135deg, #eef2ff, #fff7ed);
}

.public-layout {
    padding: 64px 0 48px;
}

.public-hero {
    text-align: center;
    padding: 32px;
    border-radius: var(--radius-xl);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin-bottom: 32px;
}

.public-avatar {
    width: 90px;
    height: 90px;
    border-radius: 24px;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 2rem;
    margin: 0 auto 16px;
}

.public-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 24px;
    object-fit: cover;
}

.public-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.public-links {
    display: grid;
    gap: 14px;
}

.public-link {
    background: var(--surface);
    border-radius: 16px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.public-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
    border-color: rgba(91, 92, 255, 0.4);
}

.public-link__meta {
    display: grid;
    gap: 6px;
}

.public-link__desc {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.public-empty {
    text-align: center;
}

.public-empty__text {
    color: var(--text-muted);
}

.public-error {
    margin: 40px auto 0;
}

.public-error__message {
    color: var(--text-muted);
    margin-top: 12px;
}

.public-error__cta {
    margin-top: 20px;
}

.public-link__url {
    font-size: 0.8rem;
    color: var(--text-muted);
    word-break: break-all;
}

.public-footer {
    text-align: center;
    color: var(--text-muted);
    margin-top: 36px;
}

/* Guide */
.guide-page {
    background: linear-gradient(135deg, #eef2ff, #ffffff);
}

.guide-hero {
    background: var(--surface);
    padding: 36px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 32px;
    text-align: center;
}

.guide-card {
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    margin-bottom: 28px;
}

.guide-step {
    background: var(--surface-muted);
    border-radius: 14px;
    padding: 18px;
    border-left: 4px solid var(--primary);
    margin: 16px 0;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

/* 404 */
.error-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #eef2ff, #fff7ed);
}

.error-card {
    text-align: center;
    padding: 48px;
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    max-width: 520px;
}

.error-code {
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary);
}

/* Responsive */
@media (max-width: 1024px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        width: 280px;
        z-index: 200;
        transition: left 0.3s ease;
    }

    .sidebar.is-open {
        left: 0;
    }

    .sidebar__toggle {
        display: inline-flex;
    }
}

@media (max-width: 900px) {
    .nav__menu {
        position: absolute;
        top: 70px;
        left: 16px;
        right: 16px;
        background: var(--surface);
        border-radius: 18px;
        padding: 18px;
        flex-direction: column;
        gap: 14px;
        border: 1px solid var(--border);
        box-shadow: var(--shadow);
        display: none;
    }

    .nav__menu.is-open {
        display: flex;
    }

    .nav__toggle {
        display: inline-flex;
    }
}

@media (max-width: 700px) {
    .hero {
        padding: 80px 0 60px;
    }

    .cta {
        padding: 48px 24px;
    }

    .app-main {
        padding: 24px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .nav__actions .btn {
        display: none;
    }

    .hero__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .card,
    .panel,
    .pricing-card {
        padding: 22px;
    }
}
