/* ══════════════════════════════════════════════════════
   FINANCEMENT - Styles specifiques
   v5 - Chat = la page, fond clair, marges sombres
   ══════════════════════════════════════════════════════ */

/* ── Corps de page ────────────────────────────── */
.fin-app-body {
    background:
        radial-gradient(ellipse 900px 700px at 5% 10%, rgba(184,32,96,0.12) 0%, transparent 70%),
        radial-gradient(ellipse 800px 600px at 95% 90%, rgba(24,136,136,0.10) 0%, transparent 70%),
        #1A1A18;
    overflow-x: hidden;
}

/* ── L'application prend tout le viewport ─────── */
.fin-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 9rem 2rem 2rem;
    max-width: 860px;
    margin: 0 auto;
    box-sizing: border-box;
    background: transparent;
}

/* Sur grand ecran : la bande centrale claire,
   les cotes sombres (via le body) font le cadre */

/* ── H1 discret mais lisible ─────────────────── */
.fin-app-h1 {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Zone de chat - element principal ──────────── */
.fin-chat {
    display: flex;
    flex-direction: column;
    background: #F5F2ED;
    border: 1px solid rgba(42, 42, 42, 0.10);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
    /* Hauteur calculee : viewport - nav - h1 - liens - legal - marges */
    height: calc(100vh - 10rem);
    height: calc(100dvh - 10rem);
    max-height: 680px;
    min-height: 380px;
}

.fin-chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    min-height: 0;
}

/* ── Bulle d'accueil ─────────────────────────── */
.fin-welcome {
    align-self: flex-start;
    max-width: 88%;
    animation: welcomeAppear 0.5s ease;
}

.fin-welcome-bubble {
    background: linear-gradient(135deg, #E8DDD0 0%, #F0EBE3 100%);
    border: 1px solid rgba(212, 164, 76, 0.2);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    padding: 1.3rem 1.5rem;
}

.fin-welcome-greeting {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2A2A2A;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.fin-welcome-text {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1.12rem;
    color: #4A4A46;
    line-height: 1.7;
    font-weight: 300;
    margin-bottom: 0.5rem;
}

.fin-welcome-fun {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1rem;
    color: #8A8A84;
    font-style: italic;
    line-height: 1.5;
}

.fun-accent {
    color: var(--or);
    font-style: italic;
    font-weight: 600;
}

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

/* ── Suggestions internes au chat ──────────────── */
.fin-chat-suggestions {
    align-self: flex-end;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.45rem;
    max-width: 88%;
    animation: suggestAppear 0.5s ease 0.3s both;
}

.fin-chat-suggestions-label {
    font-family: 'Instrument Sans', sans-serif;
    font-size: 0.85rem;
    color: #8A8A84;
    margin-bottom: 0.2rem;
    letter-spacing: 0.02em;
    text-align: right;
    width: 100%;
}

.fin-chat-suggestion {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1rem;
    color: var(--noir);
    background: rgba(0, 128, 128, 0.15);
    border: 1px solid rgba(0, 128, 128, 0.25);
    padding: 0.7rem 1.1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s;
    line-height: 1.4;
    text-align: right;
    display: block;
    width: fit-content;
}

.fin-chat-suggestion:hover {
    background: rgba(0, 128, 128, 0.25);
    border-color: rgba(0, 128, 128, 0.4);
    transform: translateX(-3px);
}

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

/* ── Messages de conversation ─────────────────── */
.fin-msg {
    max-width: 82%;
    padding: 1rem 1.3rem;
    border-radius: 12px;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1.12rem;
    line-height: 1.75;
    animation: msgAppear 0.3s ease;
}

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

.fin-msg-user {
    align-self: flex-end;
    background: rgba(0, 128, 128, 0.15);
    color: var(--noir);
    border: 1px solid rgba(0, 128, 128, 0.25);
    border-bottom-right-radius: 4px;
    font-weight: 400;
}

/* Curseur clignotant pendant le streaming */
.fin-msg-streaming p:last-child::after {
    content: '\u2588';
    animation: cursorBlink 0.8s step-end infinite;
    color: #B0AEA6;
    font-weight: 300;
}

.fin-msg-agent {
    align-self: flex-start;
    background: #F0EDE8;
    color: #2A2A2A;
    border: 1px solid rgba(42, 42, 42, 0.06);
    border-bottom-left-radius: 4px;
}

.fin-msg-agent p {
    margin-bottom: 0.6rem;
}
.fin-msg-agent p:last-child {
    margin-bottom: 0;
}

/* Indicateur de chargement */
.fin-msg-loading {
    display: flex;
    gap: 6px;
    padding: 1rem 1.4rem;
}

.fin-msg-loading span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #B0AEA6;
    animation: dotPulse 1.4s ease-in-out infinite;
}
.fin-msg-loading span:nth-child(2) { animation-delay: 0.2s; }
.fin-msg-loading span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

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

/* ── Zone de saisie ──────────────────────────── */
.fin-chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.9rem 1.1rem;
    border-top: 1px solid rgba(42, 42, 42, 0.06);
    background: #FAFAF7;
}

.fin-chat-input {
    flex: 1;
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1.1rem;
    color: #2A2A2A;
    background: transparent;
    border: none;
    resize: none;
    line-height: 1.5;
    padding: 0.5rem 0.2rem;
    max-height: 120px;
    overflow-y: auto;
}

.fin-chat-input::placeholder {
    color: #B0AEA6;
    font-style: italic;
}

.fin-chat-input:focus {
    outline: none;
}

.fin-chat-send {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--or);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s;
    color: var(--noir);
}

.fin-chat-send:hover {
    background: var(--or-clair);
    transform: scale(1.05);
}

.fin-chat-send:disabled {
    opacity: 0.4;
    cursor: default;
    transform: none;
}

.fin-chat-send svg {
    width: 18px;
    height: 18px;
}

/* ── Liens sous le chat (3 liens) ────────────── */
.fin-app-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0 0.15rem;
    flex-shrink: 0;
}

.fin-app-nav-link {
    font-family: 'Instrument Sans', sans-serif;
    font-size: 0.82rem;
    color: #7A7A72;
    text-decoration: none;
    transition: color 0.3s;
    letter-spacing: 0.01em;
}

.fin-app-nav-link:hover {
    color: var(--or-sombre);
}

.fin-app-nav-sep {
    color: #C0BEB8;
    font-size: 0.7rem;
}

/* ── Mention legale ──────────────────────────── */
.fin-agent-legal {
    font-family: 'Instrument Sans', sans-serif;
    font-size: 0.7rem;
    color: #A0A098;
    text-align: center;
    line-height: 1.5;
    max-width: 560px;
    margin: 0.2rem auto 0.8rem;
    padding: 0 1rem;
}

/* ══════════════════════════════════════════════════
   PANNEAU SEO - Contenu sous le chat
   Fond clair, structure epuree
   ══════════════════════════════════════════════════ */
.fin-seo-panel {
    background: #F5F2ED;
    max-width: 796px;
    margin: 1.5rem auto 0;
    padding: 0 0 0.5rem;
    border-radius: 14px;
    border: 1px solid rgba(42, 42, 42, 0.10);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* Trait decoratif de separation (accent de couleur) */
.fin-seo-panel::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(
        to right,
        var(--bleu) 0%,
        var(--sarcelle) 25%,
        var(--or) 50%,
        var(--orange) 75%,
        var(--magenta) 100%
    );
    margin: 0;
    border-radius: 0;
    opacity: 0.6;
}

.fin-panel-section {
    max-width: 680px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    border-bottom: 1px solid rgba(42, 42, 42, 0.06);
}

.fin-panel-section:last-of-type {
    border-bottom: none;
}

.fin-panel-section p {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1.1rem;
    color: #4A4A46;
    line-height: 1.85;
    font-weight: 300;
    margin-bottom: 1rem;
}

.fin-panel-title {
    font-family: 'Big Shoulders Display', sans-serif;
    font-weight: 700;
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    color: #2A2A2A;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.fin-panel-subtitle {
    font-family: 'Instrument Sans', sans-serif;
    font-size: 0.92rem !important;
    color: #7A7A72 !important;
    letter-spacing: 0.04em;
    margin-bottom: 0.8rem !important;
}

.fin-panel-accent {
    color: var(--or-sombre) !important;
    font-weight: 500 !important;
    font-size: 1.1rem !important;
    margin-top: 0.5rem;
}

.fin-panel-muted {
    font-style: italic;
    font-size: 1rem !important;
    color: #7A7A72 !important;
}

.fin-gratuit {
    color: var(--or-sombre) !important;
    font-weight: 500 !important;
    font-size: 1.1rem !important;
}

/* ── FAQ ─────────────────────────────────────── */
.fin-panel-faq .fin-panel-title {
    text-align: center;
    margin-bottom: 2rem;
}

.fin-faq-list {
    max-width: 680px;
    margin: 0 auto;
}

.fin-faq-item {
    border-bottom: 1px solid rgba(42, 42, 42, 0.08);
}

.fin-faq-item:first-child {
    border-top: 1px solid rgba(42, 42, 42, 0.08);
}

.fin-faq-item summary {
    font-family: 'Big Shoulders Display', sans-serif;
    font-weight: 700;
    font-size: 1.12rem;
    color: #2A2A2A;
    padding: 1rem 2rem 1rem 0;
    cursor: pointer;
    list-style: none;
    position: relative;
    transition: color 0.3s;
    line-height: 1.4;
}

.fin-faq-item summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Instrument Sans', sans-serif;
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--or-sombre);
}

.fin-faq-item[open] summary::after {
    content: '-';
}

.fin-faq-item summary::-webkit-details-marker { display: none; }
.fin-faq-item summary::marker { display: none; content: ''; }

.fin-faq-item summary:hover {
    color: var(--or-sombre);
}

.fin-faq-answer {
    padding: 0 0 1rem;
}

.fin-faq-answer p {
    font-size: 1.08rem;
    color: #4A4A46;
    line-height: 1.85;
    font-weight: 300;
}

.fin-faq-answer a {
    color: var(--or-sombre);
    text-decoration: none;
    transition: opacity 0.3s;
}

.fin-faq-answer a:hover {
    opacity: 0.7;
}

/* ── Exemples ────────────────────────────────── */
.fin-panel-examples {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0 0 1rem;
    padding: 0;
}

.fin-panel-examples li {
    font-size: 1rem;
    color: #4A4A46;
    line-height: 1.7;
    font-weight: 300;
    padding-left: 1rem;
    position: relative;
    font-style: italic;
}

.fin-panel-examples li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--or-sombre);
}

/* ── Sources grid ────────────────────────────── */
.fin-sources-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 1rem 0 1.5rem;
}

.fin-source-tag {
    font-family: 'Instrument Sans', sans-serif;
    font-size: 0.82rem;
    color: #4A4A46;
    background: rgba(42, 42, 42, 0.04);
    border: 1px solid rgba(42, 42, 42, 0.10);
    padding: 0.4rem 0.85rem;
    border-radius: 4px;
    letter-spacing: 0.02em;
    transition: border-color 0.3s;
}

.fin-source-tag:hover {
    border-color: var(--or-sombre);
}

.fin-panel-sources .fin-panel-inner {
    text-align: center;
}

/* ── Lien retour ─────────────────────────────── */
.fin-panel-back {
    text-align: center;
    padding: 1.5rem 0 2rem;
    max-width: 860px;
    margin: 0 auto;
    background: #F5F2ED;
}

.fin-back-link {
    font-family: 'Instrument Sans', sans-serif;
    font-size: 0.88rem;
    color: var(--or-sombre);
    text-decoration: none;
    padding: 0.5rem 1.5rem;
    border: 1px solid rgba(180, 140, 60, 0.3);
    border-radius: 20px;
    transition: all 0.3s;
}

.fin-back-link:hover {
    background: rgba(212, 164, 76, 0.08);
    border-color: var(--or-sombre);
}

/* ── Footer minimal ──────────────────────────── */
.fin-footer {
    background: #1A1A18;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-family: 'Instrument Sans', sans-serif;
    font-size: 0.78rem;
    color: #6A6A64;
}

.fin-footer a {
    color: #8A8A84;
    text-decoration: none;
    transition: color 0.3s;
}

.fin-footer a:hover {
    color: var(--or);
}

.fin-footer-brand {
    color: #8A8A84;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.fin-footer-sep {
    color: #4A4A46;
}

.fin-footer-copy {
    color: #4A4A46;
}

/* ══════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .fin-app {
        padding: 3.8rem 0.5rem 0;
    }

    .fin-app-h1 {
        font-size: 0.82rem;
        margin: 0.3rem 0.5rem 0.4rem;
    }

    .fin-chat {
        border-radius: 10px;
    }

    .fin-chat-messages {
        padding: 1.2rem;
    }

    .fin-welcome-bubble {
        padding: 1rem 1.2rem;
    }

    .fin-welcome-greeting {
        font-size: 1.15rem;
    }

    .fin-welcome-text {
        font-size: 1.05rem;
    }

    .fin-chat-suggestion {
        font-size: 0.95rem;
        padding: 0.6rem 0.9rem;
    }

    .fin-msg {
        max-width: 90%;
        font-size: 1.05rem;
    }

    .fin-app-links {
        gap: 0.4rem;
    }

    .fin-app-nav-link {
        font-size: 0.78rem;
    }

    .fin-chat {
        height: calc(100vh - 9rem);
        height: calc(100dvh - 9rem);
        max-height: none;
    }

    .fin-panel-section {
        padding: 2rem 1.5rem;
    }

    .fin-panel-section p {
        font-size: 1.02rem;
    }

    .fin-faq-answer p {
        font-size: 1rem;
    }

    .fin-footer {
        padding: 0.8rem 1rem;
        gap: 0.6rem;
        font-size: 0.72rem;
    }
}

@media (max-width: 480px) {
    .fin-app {
        padding: 3.5rem 0.3rem 0;
    }

    .fin-chat {
        border-radius: 8px;
    }

    .fin-chat-messages {
        padding: 1rem;
    }

    .fin-chat-suggestion {
        font-size: 0.92rem;
        max-width: 100%;
    }

    .fin-chat-input {
        font-size: 1.02rem;
    }

    .fin-welcome-bubble {
        padding: 0.9rem 1rem;
    }

    .fin-app-links {
        flex-wrap: wrap;
        gap: 0.3rem;
    }
}

/* ── Grand ecran : marges sombres bien visibles */

@media (min-width: 900px) {
    .fin-app {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}



/* Eclat dore subtil sur le conteneur chat */
.fin-chat {
    border-top-color: rgba(212, 164, 76, 0.35);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15),
                0 -2px 20px rgba(212, 164, 76, 0.12);
}/* ============================================================
   LEAD CAPTURE FORM - Styles pour le mini-formulaire inline
   À ajouter dans financement.css
   ============================================================ */

.fin-lead-form {
    margin: 12px 0 16px 0;
    padding: 16px 20px;
    background: rgba(42, 42, 42, 0.06);
    border: 1px solid rgba(180, 140, 60, 0.35);
    border-radius: 12px;
    max-width: 480px;
    animation: leadFormAppear 0.4s ease-out;
    transition: opacity 0.3s ease;
}

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

.fin-lead-label {
    font-size: 14px;
    color: var(--or-sombre, #b48c3c);
    margin-bottom: 12px;
    font-weight: 500;
}

.fin-lead-form input[type="text"],
.fin-lead-form input[type="email"],
.fin-lead-form input[type="tel"] {
    display: block;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: #fff;
    border: 1.5px solid rgba(42, 42, 42, 0.4);
    border-radius: 8px;
    color: #2A2A2A;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.fin-lead-form input[type="text"]:focus,
.fin-lead-form input[type="email"]:focus,
.fin-lead-form input[type="tel"]:focus {
    outline: none;
    border-color: var(--or, #e8a838);
    background: #fff;
}

.fin-lead-form input::placeholder {
    color: #7A7872;
}

.fin-lead-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 12px 0;
    cursor: pointer;
}

.fin-lead-consent input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--or, #e8a838);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.fin-lead-consent span {
    font-size: 12px;
    color: #6A6A64;
    line-height: 1.4;
}

.fin-lead-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.fin-lead-submit {
    padding: 8px 20px;
    background: var(--or, #e8a838);
    color: var(--fond, #1a1a18);
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.fin-lead-submit:hover {
    background: #d4962f;
}

.fin-lead-skip {
    padding: 8px 16px;
    background: transparent;
    color: #8A8A84;
    border: 1px solid rgba(42, 42, 42, 0.15);
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.fin-lead-skip:hover {
    color: #4A4A46;
    border-color: rgba(42, 42, 42, 0.3);
}

.fin-lead-status {
    font-size: 12px;
    margin-top: 8px;
    min-height: 16px;
    color: #6A6A64;
}

.fin-lead-error {
    color: #e57373;
}

.fin-lead-success {
    padding: 12px 0;
    color: var(--sarcelle, #4db6ac);
    font-size: 14px;
    font-weight: 500;
}

/* Prompt oui/non avant le formulaire */
.fin-lead-prompt {
    margin: 12px 0 8px 0;
    max-width: 480px;
    animation: leadFormAppear 0.4s ease-out;
    transition: opacity 0.5s ease;
}

.fin-lead-prompt-label {
    font-size: 14px;
    color: var(--or-sombre, #b48c3c);
    margin-bottom: 10px;
    font-weight: 500;
}

.fin-lead-prompt-actions {
    display: flex;
    gap: 8px;
}

.fin-lead-prompt-yes {
    padding: 8px 20px;
    background: var(--or, #e8a838);
    color: var(--fond, #1a1a18);
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.fin-lead-prompt-yes:hover {
    background: #d4962f;
}

.fin-lead-prompt-no {
    padding: 8px 16px;
    background: transparent;
    color: #8A8A84;
    border: 1px solid rgba(42, 42, 42, 0.15);
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.fin-lead-prompt-no:hover {
    color: #4A4A46;
    border-color: rgba(42, 42, 42, 0.3);
}

.fin-lead-prompt-dismissed {
    font-size: 13px;
    color: #8A8A84;
    font-style: italic;
    padding: 4px 0;
}

/* Checkbox newsletter optionnelle */
.fin-lead-newsletter-opt {
    margin-top: 10px;
    opacity: 0.85;
}

.fin-lead-newsletter-opt span {
    font-size: 11.5px;
}
