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

:root {
    /* Ajustement du bleu pour correspondre à l'image (plus corporate) */
    --blue: #0066cc;
    --blue-hover: #0052a3;
    --blue-bg: #f0f7ff;
    --blue-border: #cce0ff;

    --white: #ffffff;
    --gray-50: #fafafa;
    --gray-100: #f4f4f5;
    --gray-200: #e4e4e7;
    --gray-300: #d1d1d6;
    --gray-500: #71717a;
    --gray-700: #3f3f46;
    --gray-900: #18181b;

    --green: #16a34a;
    --green-bg: #f0fdf4;
    --red: #dc2626;
    --red-bg: #fef2f2;

    /* Nouvelles typos */
    --font: 'Inter', system-ui, sans-serif;
    --font-heading: 'Montserrat', system-ui, sans-serif;

    --radius: 8px; /* Un peu plus arrondi */
    --radius-lg: 14px; /* Un peu plus arrondi pour le widget */
    --max: 920px; /* On élargit l'interface */
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    font-size: 15px;
    color: var(--gray-900);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
}

/* ─── SECTIONS WRAPPER ─── */
.page {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 24px;
}

/* ─── HERO ─── */
.hero {
    padding: 56px 0 48px;
    border-bottom: 1px solid var(--gray-200);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: 20px;
}

.hero-tag span {
    width: 16px; height: 1px;
    background: var(--blue);
    display: inline-block;
}

.hero h1 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: clamp(32px, 5vw, 48px);
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--gray-900);
    margin: 0 auto 20px auto;
    max-width: 650px;
}

.hero-desc {
    font-size: 16px;
    line-height: 1.7;
    color: var(--gray-500);
    margin: 0 auto 36px auto;
    max-width: 580px;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 12px 24px;
    font-family: var(--font);
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s;
}

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

.hero-note {
    font-size: 13px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 6px;
}

.hero-note i { color: var(--green); font-size: 12px; }

/* ─── FEATURES ─── */
.features {
    padding: 48px 0;
    border-bottom: 1px solid var(--gray-200);
}

.section-label {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gray-500);
    margin-bottom: 6px;
    text-align: center;
}

.section-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 28px;
    color: var(--gray-900);
    margin-bottom: 40px;
    letter-spacing: -0.01em;
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--gray-200);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.feature {
    background: var(--white);
    padding: 28px 28px;
}

.feature-icon {
    width: 32px; height: 32px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    color: var(--gray-700);
    margin-bottom: 14px;
}

.feature h3 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 6px;
}

.feature p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-500);
}

/* ─── HOW IT WORKS ─── */
.how {
    padding: 48px 0;
    border-bottom: 1px solid var(--gray-200);
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 24px 28px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--white);
}

.step:last-child { border-bottom: none; }

.step-num {
    width: 24px; height: 24px;
    min-width: 24px;
    border: 1.5px solid var(--gray-300);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    display: flex; align-items: center; justify-content: center;
    margin-top: 1px;
}

.step-content strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.step-content span {
    font-size: 14px;
    color: var(--gray-500);
    line-height: 1.55;
}

/* ─── DEMO SECTION ─── */
.demo-section {
    padding: 48px 0 64px;
}

.demo-header {
    margin-bottom: 32px;
    text-align: center;
}

.demo-header .section-title { margin-bottom: 12px; }

.demo-header p {
    font-size: 18px;
    color: var(--gray-500);
    line-height: 1.6;
    margin: 0 auto;
    max-width: 600px;
}

/* Session counters */
.session-counters {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.s-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--gray-700);
    background: var(--white);
}

.s-counter i { color: var(--blue); font-size: 12px; }
.s-counter strong { color: var(--gray-900); font-weight: 600; }

/* Quota banner */
.quota-banner {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--red-bg);
    border: 1px solid rgba(220,38,38,.15);
    border-radius: var(--radius);
    font-size: 13.5px;
    color: var(--red);
    margin-bottom: 20px;
}

/* ─── CHAT WIDGET ─── */
.chat-widget {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 600px; /* Légèrement plus haut */
    /* Ombre plus douce, large et légèrement bleutée */
    box-shadow: 0 12px 40px -8px rgba(0, 102, 204, 0.08), 0 4px 12px -2px rgba(0, 0, 0, 0.03);
}

.chat-topbar {
    flex-shrink: 0;
    padding: 0 20px;
    height: 56px; /* Légèrement plus aéré */
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    background: var(--white);
    z-index: 2; /* Pour passer au-dessus du fond grisé */
    box-shadow: 0 2px 10px rgba(0,0,0,0.02); /* Ombre sous la topbar */
}

/* Chat area */
.chat-area {
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Dégradé très subtil pour donner de la profondeur derrière les bulles blanches */
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--green);
}

.topbar-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
}

.topbar-sub {
    font-size: 12px;
    color: var(--gray-500);
    padding-left: 10px;
    border-left: 1px solid var(--gray-200);
    margin-left: 2px;
}

.session-tag {
    font-size: 12px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 6px;
}

.session-tag i { color: var(--green); font-size: 11px; }



/* Overlay */
.chat-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: rgba(250,250,250,.92);
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-inner {
    text-align: center;
    max-width: 320px;
}

.overlay-inner h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.overlay-inner p {
    font-size: 14px;
    color: var(--gray-500);
    line-height: 1.55;
    margin-bottom: 20px;
}

.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--blue);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 10px 20px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s;
}

.upload-btn:hover { background: var(--blue-hover); }

/* Messages */
.messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.messages::-webkit-scrollbar { width: 5px; }
.messages::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }

.msg-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: up .16s ease both;
}

.msg-row.user { flex-direction: row-reverse; }

@keyframes up {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}

.msg-av {
    width: 28px; height: 28px;
    min-width: 28px;
    border-radius: 50%;
    border: 1px solid var(--gray-200);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-500);
    background: var(--white);
    flex-shrink: 0;
}

.msg-body { max-width: 75%; display: flex; flex-direction: column; gap: 4px; }
.msg-row.user .msg-body { align-items: flex-end; }

.msg-name { font-size: 11px; font-weight: 500; color: var(--gray-500); }

.msg-bubble {
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    font-size: 14.5px;
    line-height: 1.6;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02); /* Ombre douce sur toutes les bulles */
}

.msg-bubble.ai {
    background: var(--white);
    border: 1px solid rgba(0,0,0,0.05); /* Bordure très discrète */
    color: var(--gray-900);
    border-top-left-radius: 4px; /* Un peu moins cassant */
}

.msg-bubble.user {
    /* Dégradé moderne Apple/SaaS */
    background: linear-gradient(135deg, var(--blue) 0%, #0052a3 100%);
    color: #fff;
    border: none;
    border-top-right-radius: 4px;
    /* Ombre bleutée sous le message utilisateur */
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2); 
}

/* On adoucit aussi les avatars */
.msg-av {
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    border: none;
}

/* Markdown */
.md-p { margin-bottom: 8px; }
.md-p:last-of-type { margin-bottom: 0; }
.md-h1,.md-h2,.md-h3,.md-h4 { font-family: var(--font-heading); font-weight: 600; color: var(--gray-900); margin: 12px 0 6px; }
.md-h1 { font-size: 16px; }
.md-h2 { font-size: 15px; }
.md-h3,.md-h4 { font-size: 14px; }
.md-hr { border: none; border-top: 1px solid var(--gray-200); margin: 12px 0; }
.md-ul,.md-ol { margin: 6px 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.md-ul li { list-style: disc; line-height: 1.55; }
.md-ol li { list-style: decimal; line-height: 1.55; }
.md-pre { background: var(--gray-900); color: #f4f4f5; padding: 12px 16px; border-radius: var(--radius); font-size: 13px; margin: 10px 0; overflow-x: auto; }
.md-code-block { font-family: 'SF Mono', monospace; white-space: pre-wrap; }
.md-code-inline { background: var(--gray-100); color: var(--gray-700); padding: 2px 6px; border-radius: 4px; font-family: 'SF Mono', monospace; font-size: 13px; }

/* Typing */
.typing-dots { display: flex; gap: 4px; padding: 4px 0; }
.typing-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--gray-300); animation: td 1.2s infinite; }
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes td { 0%,80%,100% { opacity:.4; transform:scale(1); } 40% { opacity:1; transform:scale(1.3); } }

/* Input */
.input-area {
    flex-shrink: 0;
    padding: 16px 20px 20px;
    background: var(--white);
    border-top: 1px solid rgba(0,0,0,0.05);
    z-index: 2;
}

.input-box {
    display: flex;
    align-items: center;
    gap: 10px;
    /* On utilise un gris très clair en fond plutôt qu'une grosse bordure */
    background: #f8fafc;
    border: 1px solid transparent;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
    border-radius: 100px; /* Totalement arrondi (style pilule) */
    padding: 8px 10px 8px 16px;
    transition: all .2s ease;
}

.input-box:focus-within {
    background: var(--white);
    box-shadow: inset 0 0 0 1px var(--blue), 0 4px 16px rgba(0, 102, 204, 0.08);
}

.send-btn {
    width: 34px; height: 34px; /* Bouton un peu plus gros */
    border-radius: 50%; /* Rond parfait pour aller avec la barre pilule */
    /* ... le reste du code send-btn reste identique ... */
    background: var(--blue);
    border: none;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s, transform .15s;
}

.send-btn:hover:not(:disabled) { 
    background: var(--blue-hover); 
    transform: scale(1.05); /* Petit effet de survol dynamique */
}

.badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid;
    animation: up .15s ease both;
}

.badge.processing { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-border); }
.badge.ready      { background: var(--green-bg); color: var(--green); border-color: #bbf7d0; }
.badge.error      { background: var(--red-bg); color: var(--red); border-color: #fecaca; }

.attach-btn {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--gray-500);
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
    transition: color .15s, background .15s;
}

.attach-btn:hover { color: var(--blue); background: var(--blue-bg); }

.input-box input[type="text"] {
    flex: 1;
    border: none;
    outline: none;
    font-family: var(--font);
    font-size: 14.5px;
    color: var(--gray-900);
    background: transparent;
    min-height: 30px;
}

.input-box input::placeholder { color: var(--gray-400); }


.send-btn:disabled { background: var(--gray-200); color: var(--gray-300); cursor: not-allowed; }

.input-footer {
    margin-top: 8px;
    font-size: 12px;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    gap: 6px;
}

.input-footer i { color: var(--green); }

/* ─── RESPONSIVE ─── */
@media (max-width: 600px) {
    .hero { padding: 40px 0 36px; }
    .features-grid { grid-template-columns: 1fr; }
    .features,.how,.demo-section { padding: 40px 0; }
    .chat-widget { height: 500px; }
}