:root {
    --bg1: #eaffc6;
    --bg2: #fc8fb0;
    --beige: #fc8fb0;
    --text: #2b2112;
    --muted: rgba(43, 33, 18, 0.68);
    --card: rgba(255, 255, 255, 0.68);
    --border: rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    :root {
    --bg1: #8D4D61;
    --bg2: #6C7A53;
    --beige: #6C7A53;
    --text: #2b2112;
    --muted: rgba(43, 33, 18, 0.68);
    --card: rgba(255, 255, 255, 0.68);
    --border: rgba(0, 0, 0, 0.1); 
    }
}

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

body {
    min-height: 100vh;
    font-family: "Poppins", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 16%, rgba(252, 143, 176, 0.25) 0%, transparent 30%),
        radial-gradient(circle at 86% 84%, rgba(234, 255, 198, 0.65) 0%, transparent 34%),
        linear-gradient(120deg, var(--bg1) 0%, #f6ffd9 55%, var(--bg2) 100%);
    padding-top: 64px;
}

.tarifs-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.4rem 1rem 2.2rem;
}

.tarifs-hero {
    margin-bottom: 1.4rem;
}

.tarifs-kicker {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

h1 {
    color: var(--beige);
    margin-top: 0.25rem;
    margin-bottom: 0.45rem;
    font-size: clamp(2rem, 4vw, 3rem);
}

.tarifs-subtitle,
.section-intro {
    color: var(--muted);
}

.pricing-section {
    margin-top: 1.2rem;
    margin-bottom: 1.4rem;
}

.pricing-section h2 {
    margin-bottom: 0.9rem;
    color: var(--text);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
}

.price-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: 2.5rem 1.5rem;
    box-shadow: 0 24px 80px rgba(0,0,0,0.08);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), border-color 0.4s ease;
}

.price-card:hover {
    transform: translateY(-12px);
    border-color: var(--beige);
    box-shadow: 0 32px 90px rgba(0,0,0,0.12);
}

.price-card.featured {
    border-color: var(--beige);
    border-width: 2px;
    transform: scale(1.05);
}

.price-card.special {
    background: linear-gradient(145deg, rgba(252, 143, 176, 0.2), var(--card));
}

.plan-tag {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--beige);
    color: white;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.price-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    text-align: center;
}

.price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--beige);
    text-align: center;
}

.price span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--muted);
    margin-left: 0.25rem;
}

.note {
    margin-top: 0.45rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.plan-features {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    font-size: 0.95rem;
    color: var(--muted);
}

.plan-button {
    margin-top: auto;
    padding: 0.8rem;
    text-align: center;
    border-radius: 12px;
    background: var(--beige);
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.plan-button:hover {
    opacity: 0.9;
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(252, 143, 176, 0.3);
}

.pricing-section.alt .price-card {
    margin-top: 1.5rem; /* Ajoute un espace au-dessus des cartes de paiement par sortie */
}

.pricing-grid.two-cols {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Ajuste la largeur des colonnes pour qu'elles ne soient pas trop grandes */
    max-width: 600px; /* Limite la largeur du conteneur de la grille pour permettre le centrage */
    margin-left: auto; /* Centre la grille horizontalement */
    margin-right: auto; /* Centre la grille horizontalement */
    justify-content: center; /* Centre les éléments à l'intérieur de la grille si l'espace le permet */
}

@media (max-width: 1200px) {
    .pricing-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

.pay-per-release {
    margin-top: 4rem;
    text-align: center;
    color: var(--muted);
}

.pay-per-release span {
    font-weight: 600;
    color: var(--text);
}

@media (max-width: 980px) {
    .pricing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}

/* --- CHAT LITUAL AI --- */
#chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: -1; /* Placé derrière la fenêtre de chat mais devant le reste de la page */
    display: none;
    opacity: 0;
    cursor: pointer;
}

#litual-chat-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

#chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--beige);
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(252, 143, 176, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0; /* Réinitialise le padding pour un contrôle précis de la largeur */
    transition: width 0.3s ease, border-radius 0.3s ease, transform 0.3s ease, padding 0.3s ease;
}

#chat-toggle:hover { 
    width: 300px; /* Largeur étendue pour le texte */
    border-radius: 30px; /* Forme de pilule */
    transform: scale(1.05); /* Léger agrandissement */
    justify-content: flex-start; /* Aligne le contenu à gauche */
    padding-left: 12px; /* Padding à gauche */
    padding-right: 12px; /* Padding à droite */
}

#chat-toggle .chat-toggle-text {
    opacity: 0;
    max-width: 0; /* Initialement masqué */
    overflow: hidden;
    white-space: nowrap;
    font-size: 0.9rem;
    color: white;
    margin-left: 0; /* Pas de marge initiale */
    transition: opacity 0.3s ease, max-width 0.3s ease, margin-left 0.3s ease;
}

#chat-toggle:hover .chat-toggle-text {
    opacity: 1;
    max-width: 230px; /* Rendre le texte visible */
    margin-left: 8px; /* Ajoute un espace entre l'image et le texte */
}

#chat-toggle img { width: 35px; height: auto; }

#chat-window {
    width: 450px;
    height: 500px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 20px;
    margin-bottom: 20px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    transform-origin: bottom right;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

/* La règle #chat-window.is-hidden { display: flex; } a été supprimée car elle entrait en conflit avec l'animation GSAP. */

.chat-header {
    padding: 15px;
    background: var(--beige);
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.chat-header img { height: 25px; width: auto; }
#close-chat { margin-left: auto; background: none; border: none; color: white; font-size: 20px; cursor: pointer; }

#chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.msg { padding: 10px 14px; border-radius: 18px; font-size: 0.9rem; max-width: 95%; line-height: 1.4; }
.msg.ai { background: #f8f8f8; align-self: flex-start; border-bottom-left-radius: 4px; color: #333; overflow-x: auto; border: 1px solid rgba(0,0,0,0.03); }
.msg.user { background: var(--beige); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }

/* Réduction de la taille des titres Markdown dans le chat */
.msg h1, .msg h2, .msg h3 { font-size: 0.95rem; margin: 10px 0 5px; color: var(--beige); font-weight: 700; }
.msg p { margin-bottom: 8px; }
.msg p:last-child { margin-bottom: 0; }

/* Bouton de redirection vers paiement dans le chat */
.msg.ai a[href*="paiement.html"] {
    display: inline-block;
    background: var(--beige);
    color: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 8px;
    font-size: 0.85rem;
    box-shadow: 0 4px 12px rgba(252, 143, 176, 0.2);
    transition: all 0.2s ease;
}
.msg.ai a[href*="paiement.html"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(252, 143, 176, 0.3);
}

/* Styles pour les tableaux Markdown dans le chat */
.msg table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 12px 0;
    font-size: 0.82rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    border: 1.5px solid var(--beige);
    overflow: hidden;
}
.msg th, .msg td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    text-align: left;
}
.msg th:last-child, .msg td:last-child { border-right: none; }
.msg tr:last-child td { border-bottom: none; }
.msg th { 
    background: var(--beige); 
    color: white; 
    font-weight: 600; 
    text-transform: uppercase;
    font-size: 0.75rem;
}

#chat-input-form {
    padding: 15px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
}

#user-input {
    flex: 1;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
    outline: none;
}

#chat-input-form button {
    padding: 0 15px;
    background: var(--beige);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#chat-input-form button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(252, 143, 176, 0.2);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
    .price-card:hover, 
    .plan-button:hover, 
    .msg.ai a[href*="paiement.html"]:hover, 
    #chat-input-form button:hover {
        transform: none !important;
    }
    #chat-toggle:hover {
        width: 60px !important;
        border-radius: 50% !important;
        transform: none !important;
    }
}
