/* ============================================================
   VARIABLES & RESET
   ============================================================ */
:root {
    --color-primary: #111827;
    --color-secondary: #4b5563;
    --color-text: #1b1b1b;
    --color-cta: #000000;
    --color-bg: #f7f7f7;
    --color-danger: #ef4444;
    --color-warning: #f97316;
    --color-success: #10b981;

    --font-base: system-ui, -apple-system, "Segoe UI", sans-serif;
    --radius-pill: 9999px;
    --radius-sm: 6px;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.1);
    --transition: 160ms ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-base);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img {
    display: block;
    max-width: 100%;
}
a {
    color: inherit;
    text-decoration: none;
}
ul {
    list-style: none;
}

/* Hide all templates by default — Edge Function unhides the active one */
.tpl {
    display: none;
}
.tpl.is-active {
    display: block;
}

/* ============================================================
   SHARED: BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2.25rem;
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    cursor: pointer;
    border: none;
    transition:
        opacity var(--transition),
        transform var(--transition);
    text-transform: uppercase;
}
.btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}
.btn:active {
    opacity: 1;
    transform: translateY(0);
}

.btn--pill {
    border-radius: var(--radius-pill);
}
.btn--rect {
    border-radius: var(--radius-sm);
}

.btn--dark {
    background: var(--color-cta);
    color: #fff;
}
.btn--orange {
    background: var(--color-warning);
    color: #fff;
}
.btn--primary {
    background: var(--color-primary);
    color: #fff;
}

/* ============================================================
   SHARED: BRAND LOGO
   ============================================================ */
.brand-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.fallback-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 1rem;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    border-radius: var(--radius-sm);
}

.fallback-mockup {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 12px;
    background: linear-gradient(
        135deg,
        var(--color-primary) 0%,
        var(--color-secondary) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ============================================================
   SHARED: PAGE FOOTER
   ============================================================ */
.page-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #9ca3af;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.page-footer nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.page-footer a:hover {
    text-decoration: underline;
}
.page-footer--dark {
    background: #0f172a;
    border-top-color: #1e293b;
    color: #475569;
}
.page-footer--dark a {
    color: #64748b;
}

/* ============================================================
   TEMPLATE: AMBITION
   ============================================================ */
#tpl-ambition {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.amb-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: center;
    border-bottom: 1px solid #f3f4f6;
}

.amb-logo-wrap {
    display: flex;
    align-items: center;
}

.amb-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 2rem 1.5rem;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

.amb-eyebrow {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--color-secondary);
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.amb-headline {
    font-size: clamp(2.5rem, 5.5vw, 4.25rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--color-primary);
    margin-bottom: 1.25rem;
    white-space: nowrap;
}

.amb-sub {
    font-size: 1.0625rem;
    color: var(--color-secondary);
    max-width: 520px;
    margin-bottom: 2.5rem;
}

/* Partner logos row */
.partner-logos {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 3rem;
    filter: grayscale(1);
    opacity: 0.35;
}

.partner-logo-item {
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    color: #374151;
}

/* Mockup */
.amb-mockup-wrap {
    width: 100%;
    max-width: 600px;
    margin-bottom: 2rem;
}

.amb-mockup {
    width: 100%;
    max-height: 340px;
    object-fit: contain;
}

/* ============================================================
   TEMPLATE: PEUR
   ============================================================ */
#tpl-peur {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #0f172a;
    color: #e2e8f0;
}

.peur-header {
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #1e293b;
}

.peur-scan-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--color-danger);
    text-transform: uppercase;
    animation: blink 1.2s step-start infinite;
}

@keyframes blink {
    50% {
        opacity: 0.3;
    }
}

.peur-main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 3.5rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.peur-domain-label {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 1rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.peur-headline {
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 900;
    letter-spacing: -0.01em;
    line-height: 1.1;
    color: #f8fafc;
    margin-bottom: 1rem;
}

.peur-sub {
    font-size: 1rem;
    color: #94a3b8;
    margin-bottom: 2rem;
    max-width: 420px;
}

/* Bullets */
.peur-bullets {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-bottom: 2rem;
}

.peur-bullet {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-sm);
    padding: 0.875rem 1rem;
}

.peur-bullet-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.peur-bullet-label {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--color-danger);
    display: block;
}

.peur-bullet-detail {
    font-size: 0.8125rem;
    color: #94a3b8;
}

/* Urgency bar */
.peur-urgency {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #f97316;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.peur-reassurance {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #475569;
}

/* RIGHT: dark mockup frame */
.peur-right {
    display: flex;
    align-items: center;
}

.peur-mockup-frame {
    width: 100%;
    background: #1e293b;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid #334155;
    position: relative;
}

.peur-mockup-topbar {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    background: #0f172a;
    border-bottom: 1px solid #334155;
}

.peur-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.peur-dot.red {
    background: #ef4444;
}
.peur-dot.yellow {
    background: #f59e0b;
}
.peur-dot.green {
    background: #10b981;
}

.peur-url-bar {
    font-size: 0.625rem;
    color: #475569;
    margin-left: 0.5rem;
    font-family: monospace;
}

.peur-mockup-img {
    width: 100%;
    display: block;
}

.peur-overlay-alerts {
    position: absolute;
    inset: 0;
    padding: 3rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.peur-alert {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    width: fit-content;
}

.peur-alert--critical {
    background: rgba(239, 68, 68, 0.9);
    color: #fff;
}

.peur-alert--warning {
    background: rgba(249, 115, 22, 0.85);
    color: #fff;
}

.peur-chart-wrap {
    margin-top: auto;
    background: rgba(15, 23, 42, 0.85);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    border: 1px solid #334155;
}

.peur-chart-label {
    font-size: 0.625rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.375rem;
}

.peur-chart {
    width: 100%;
    height: 60px;
    display: block;
}

.peur-chart-score {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-danger);
    margin-top: 0.25rem;
}

.peur-chart-score span {
    font-weight: 400;
    color: #64748b;
}

/* ============================================================
   TEMPLATE: DÉSIR
   ============================================================ */
#tpl-desir {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #fafafa;
}

.desir-header {
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.desir-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: var(--radius-pill);
    padding: 0.3rem 0.8rem;
}

/* Marquee */
.marquee-wrap {
    overflow: hidden;
    background: var(--color-primary);
    color: rgba(255, 255, 255, 0.6);
    padding: 0.5rem 0;
    white-space: nowrap;
}

.marquee-track {
    display: inline-flex;
    gap: 2rem;
    animation: marquee 28s linear infinite;
}

@keyframes marquee {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

.marquee-item {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

/* Main layout */
.desir-main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 4rem 4rem 3rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    align-items: center;
}

.desir-eyebrow {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--color-primary);
    text-transform: uppercase;
    margin-bottom: 0.875rem;
    opacity: 0.6;
}

.desir-headline {
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 900;
    letter-spacing: -0.015em;
    line-height: 1.1;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.desir-sub {
    font-size: 1rem;
    color: var(--color-secondary);
    max-width: 420px;
    margin-bottom: 2rem;
}

/* Bullets */
.desir-bullets {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-bottom: 2.25rem;
}

.desir-bullet {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    font-size: 0.9375rem;
    color: var(--color-text);
}

.desir-bullet-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        var(--color-primary),
        var(--color-secondary)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
    color: #fff;
}

/* Avatar stack */
.desir-avatars {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.75rem;
}

.avatar-stack {
    display: flex;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5625rem;
    font-weight: 700;
    color: #fff;
    margin-left: -8px;
}
.avatar:first-child {
    margin-left: 0;
}

.desir-social-count {
    font-size: 0.8125rem;
    color: var(--color-secondary);
}

/* RIGHT: dashboard mockup */
.desir-right {
    display: flex;
    align-items: center;
}

.desir-mockup-frame {
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    border: 1px solid #e5e7eb;
    position: relative;
    background: #fff;
}

.desir-mockup-img {
    width: 100%;
    display: block;
}

.desir-overlay-stats {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.desir-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius-pill);
    padding: 0.35rem 0.75rem;
    backdrop-filter: blur(6px);
}

.desir-stat-value {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--color-primary);
}

.desir-stat-label {
    font-size: 0.6875rem;
    color: var(--color-secondary);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .peur-main,
    .desir-main {
        grid-template-columns: 1fr;
        padding: 2.5rem 1.5rem;
    }

    .peur-right,
    .desir-right {
        order: -1;
    }

    .peur-overlay-alerts {
        padding-top: 2rem;
    }
}

@media (max-width: 600px) {
    .amb-main {
        padding: 2.5rem 1.25rem 2rem;
    }
    .amb-headline {
        white-space: normal;
    }
    .peur-header,
    .desir-header {
        padding: 1rem 1.25rem;
    }
    .page-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    .marquee-track {
        animation-duration: 18s;
    }
}
