/* ========================================
   QONTINUITY - INTERFACE CONVERSATIONNELLE
   La marque EST l'IA
   ======================================== */

/* Variables locales chat */
:root {
    --sidebar-bg: #F5F5F5; /* Gris clair neutre */
    --sidebar-text: #2D2D2D; /* Texte sombre */
    --sidebar-text-muted: #6B6B6B; /* Texte secondaire */
    --sidebar-border: rgba(0,0,0,0.08); /* Bordures subtiles */
}

/* ========================================
   ACCESSIBILITÉ WCAG
   ======================================== */

.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    background: var(--noir);
    color: var(--blanc);
    padding: 12px 24px;
    z-index: 9999;
    text-decoration: none;
    font-size: 14px;
    border-radius: 2px;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 16px;
}

/* ========================================
   BODY CHAT MODE
   ======================================== */

body.chat-interface {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--blanc);
    overflow-y: auto;
    cursor: auto !important;
}

body.chat-interface.sidebar-open {
    padding-left: 280px;
}

@media (max-width: 768px) {
    body.chat-interface.sidebar-open {
        padding-left: 0;
    }

    /* Sidebar fermée par défaut sur mobile */
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Bouton toggle toujours visible sur mobile */
    .sidebar-toggle {
        right: -56px;
    }
}

body.chat-interface * {
    cursor: auto;
}

body.chat-interface .custom-cursor {
    display: none !important;
}

/* ========================================
   HEADER LOGO CENTRÉ
   ======================================== */

.chat-header {
    padding: 16px 0;
    text-align: center;
    width: 100%;
}

.logo-center {
    display: inline-block;
}

.logo-center-img {
    height: 80px;
    width: auto;
    transition: opacity 0.3s ease;
}

.logo-center:hover .logo-center-img {
    opacity: 0.8;
}

.logo-center:focus-visible {
    outline: 2px solid var(--or-champagne);
    outline-offset: 4px;
}

/* ========================================
   ZONE PRINCIPALE DE CHAT
   ======================================== */

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 40px 24px 40px;
    min-height: 100vh;
}

.chat-container {
    width: 100%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
}

/* ========================================
   ZONE DES MESSAGES
   ======================================== */

.chat-messages {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow-y: visible;
    padding: 10px 0;
}

/* État initial : centré */
.chat-messages.has-conversation {
    justify-content: flex-start;
    align-items: stretch;
}

/* ========================================
   MESSAGE D'ACCUEIL
   ======================================== */

.welcome-message {
    text-align: center;
}

.welcome-avatar {
    width: 600px;
    height: auto;
    margin-bottom: 8px;
    opacity: 0;
    transform: scale(0.9);
    animation: avatarFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes avatarFadeIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.welcome-line {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    color: var(--noir);
    margin: 0;
    opacity: 0;
    transform: translateY(20px);
    animation: welcomeFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.welcome-line-1 {
    font-size: 42px;
    animation-delay: 0.3s;
}

.welcome-line-2 {
    font-size: 28px;
    color: var(--gris-taupe);
    margin-top: 16px;
    animation-delay: 0.6s;
}

@keyframes welcomeFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   MESSAGES DE CONVERSATION
   ======================================== */

.message {
    max-width: 85%;
    padding: 20px 24px;
    margin-bottom: 16px;
    border-radius: 2px;
    font-size: 16px;
    line-height: 1.7;
    font-weight: 300;
    opacity: 0;
    transform: translateY(10px);
    animation: messageFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes messageFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-user {
    align-self: flex-end;
    background: var(--noir);
    color: var(--blanc);
    margin-left: auto;
}

.message-assistant {
    align-self: flex-start;
    background: var(--blanc-casse);
    color: var(--noir);
    border: 1px solid var(--gris-perle);
}

.message-assistant .message-sender {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--or-champagne);
    margin-bottom: 8px;
    font-weight: 500;
}

/* Indicateur de frappe */
.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 20px 24px;
    background: var(--blanc-casse);
    border: 1px solid var(--gris-perle);
    align-self: flex-start;
    border-radius: 2px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--gris-taupe);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

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

/* ========================================
   ZONE DE SAISIE
   ======================================== */

.chat-input-zone {
    padding-top: 8px;
}

.chat-input-container {
    display: flex;
    align-items: flex-end;
    gap: 0;
    border: 1px solid var(--gris-perle);
    background: var(--blanc);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-input-container:focus-within {
    border-color: var(--or-champagne);
    box-shadow: 0 8px 32px rgba(212, 175, 55, 0.1);
}

.chat-input {
    flex: 1;
    padding: 20px 24px;
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    color: var(--noir);
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    min-height: 60px;
    max-height: 150px;
    line-height: 1.5;
}

.chat-input::placeholder {
    color: #767676; /* WCAG AA : ratio 4.5:1 sur blanc */
}

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

.chat-mic {
    padding: 20px 16px;
    background: transparent;
    color: #595959; /* WCAG AA : ratio 7:1 sur blanc */
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-mic:hover {
    color: #B8962E; /* Or foncé WCAG AA : ratio 3.5:1 */
}

.chat-mic:focus-visible {
    outline: 2px solid var(--or-champagne);
    outline-offset: 2px;
}

.chat-mic.recording {
    color: #c62828; /* Rouge foncé WCAG AA */
    animation: pulse 1.5s infinite;
}

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

.chat-send {
    padding: 20px 24px;
    background: var(--noir);
    color: var(--blanc);
    border: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
}

.chat-send:hover {
    background: var(--or-champagne);
}

.chat-send:focus-visible {
    outline: 2px solid var(--or-champagne);
    outline-offset: 2px;
}

.chat-send:disabled {
    background: var(--gris-perle);
    cursor: not-allowed;
}

.chat-send svg {
    transition: transform 0.3s ease;
}

.chat-send:hover svg {
    transform: translateX(2px);
}

/* ========================================
   SUGGESTIONS
   ======================================== */

.chat-suggestions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.suggestion-btn {
    padding: 12px 24px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--noir);
    background: transparent;
    border: 1px solid var(--gris-perle);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.suggestion-btn:hover {
    border-color: var(--or-champagne);
    color: var(--or-champagne);
}

.suggestion-btn:focus-visible {
    outline: 2px solid var(--or-champagne);
    outline-offset: 2px;
}

/* Bouton primaire "Aidez-moi" - Design distinct */
.suggestion-btn--primary {
    background: var(--noir);
    color: var(--blanc);
    border-color: var(--noir);
    font-weight: 500;
}

.suggestion-btn--primary:hover {
    background: var(--or-champagne);
    border-color: var(--or-champagne);
    color: var(--noir);
}

/* Masquer les suggestions après le premier message */
.chat-suggestions.hidden {
    display: none;
}

/* Lien navigation classique */
.classic-nav-link {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--gris-taupe);
}

.classic-nav-link a {
    color: var(--or-champagne);
    text-decoration: none;
    transition: color 0.3s ease;
}

.classic-nav-link a:hover {
    color: var(--noir);
    text-decoration: underline;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .chat-main {
        padding: 40px 16px 24px;
    }

    .logo-center-img {
        height: 60px;
    }

    .welcome-avatar {
        width: 280px;
    }

    .welcome-line-1 {
        font-size: 28px;
    }

    .welcome-line-2 {
        font-size: 20px;
    }

    .chat-input {
        padding: 16px 20px;
        font-size: 16px;
    }

    .chat-send {
        padding: 16px 20px;
    }

    .chat-suggestions {
        gap: 8px;
    }

    .suggestion-btn {
        padding: 10px 16px;
        font-size: 12px;
    }

    .message {
        max-width: 90%;
        padding: 16px 20px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .welcome-avatar {
        width: 200px;
    }

    .welcome-line-1 {
        font-size: 24px;
    }

    .welcome-line-2 {
        font-size: 16px;
    }

    .suggestion-btn {
        flex: 1 1 auto;
        text-align: center;
        padding: 8px 12px;
        font-size: 11px;
    }

    .logo-center-img {
        height: 48px;
    }
}

/* ========================================
   SIDEBAR RÉTRACTABLE
   ======================================== */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: var(--sidebar-bg);
    box-shadow: 2px 0 12px rgba(0,0,0,0.06);
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-toggle {
    position: absolute;
    top: 24px;
    right: -56px;
    width: 44px;
    height: 44px;
    background: var(--sidebar-bg);
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 12px;
    transition: background 0.3s ease;
}

.sidebar-toggle:hover {
    background: var(--or-champagne);
}

.sidebar-toggle:hover span {
    background: var(--noir);
}

.sidebar-toggle:focus-visible {
    outline: 2px solid var(--or-champagne);
    outline-offset: 2px;
}

.sidebar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--sidebar-text);
    transition: all 0.3s ease;
}

.sidebar.open .sidebar-toggle span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.sidebar.open .sidebar-toggle span:nth-child(2) {
    opacity: 0;
}

.sidebar.open .sidebar-toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.sidebar-content {
    padding: 80px 24px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar-btn.new-chat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--or-champagne);
    border: none;
    color: var(--noir);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 32px;
    border-radius: 2px;
}

.sidebar-btn.new-chat:hover {
    background: var(--blanc);
}

.sidebar-btn.new-chat:focus-visible {
    outline: 2px solid var(--or-champagne);
    outline-offset: 2px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Accordéons sidebar */
.sidebar-accordion {
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-accordion-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: var(--sidebar-text);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-accordion-toggle:hover {
    background: rgba(0,0,0,0.03);
}

.sidebar-accordion-toggle:focus-visible {
    outline: 2px solid var(--or-champagne);
    outline-offset: -2px;
}

.accordion-chevron {
    transition: transform 0.3s ease;
}

.sidebar-accordion.open .accordion-chevron {
    transform: rotate(180deg);
}

.sidebar-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-accordion.open .sidebar-accordion-content {
    max-height: 300px;
}

.sidebar-accordion-content a {
    display: block;
    padding: 10px 16px 10px 28px;
    color: var(--sidebar-text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s ease;
}

.sidebar-accordion-content a:hover {
    color: var(--or-champagne);
    background: rgba(0,0,0,0.03);
}

.sidebar-accordion-content a:focus-visible {
    outline: 2px solid var(--or-champagne);
    outline-offset: -2px;
}

/* Footer sidebar */
.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-footer-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    text-decoration: none;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.sidebar-footer-btn--primary {
    background: var(--sidebar-text);
    color: var(--blanc);
    font-weight: 500;
}

.sidebar-footer-btn--primary:hover {
    background: var(--noir);
}

.sidebar-footer-btn--primary:focus-visible {
    outline: 2px solid var(--blanc);
    outline-offset: 2px;
}

.sidebar-footer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--sidebar-text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s ease;
}

.sidebar-footer-link:hover {
    color: var(--sidebar-text);
}

.sidebar-footer-link:focus-visible {
    outline: 2px solid var(--or-champagne);
    outline-offset: 2px;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1999;
}

.sidebar-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   FORMATION CARDS
   ======================================== */

.formation-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.formation-card {
    background: var(--blanc);
    border: 1px solid var(--gris-perle);
    border-radius: 2px;
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.formation-card:hover {
    border-color: var(--or-champagne);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.formation-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.formation-card-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--noir);
    margin: 0;
}

.formation-card-price {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--or-champagne);
    white-space: nowrap;
}

.formation-card-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--gris-taupe);
}

.formation-card-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.formation-card-description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--sidebar-text-muted);
    margin-bottom: 16px;
}

.formation-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--noir);
    color: var(--blanc);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.formation-card-cta:hover {
    background: var(--or-champagne);
    color: var(--noir);
}

/* Responsive cards */
@media (max-width: 480px) {
    .formation-card {
        padding: 16px;
    }

    .formation-card-header {
        flex-direction: column;
        gap: 8px;
    }

    .formation-card-title {
        font-size: 18px;
    }

    .formation-card-meta {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* ========================================
   PAGES DYNAMIQUES
   ======================================== */

.page-container {
    display: none;
    flex: 1;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 60px 40px;
}

.page-container.active {
    display: block;
}

.page-content {
    animation: fadeIn 0.3s ease;
}

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

.page-header {
    text-align: center;
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--gris-perle);
}

.page-header h1 {
    font-family: var(--font-heading);
    font-size: 42px;
    font-weight: 300;
    color: var(--noir);
    margin-bottom: 12px;
}

.page-subtitle {
    font-size: 18px;
    color: var(--gris-taupe);
    font-weight: 300;
}

.page-section {
    margin-bottom: 40px;
}

.page-section h2 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 400;
    color: var(--noir);
    margin-bottom: 20px;
}

.page-section p {
    font-size: 16px;
    line-height: 1.8;
    color: var(--gris-anthracite);
}

/* Grille expertise */
.expertise-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 24px;
}

.expertise-card {
    background: var(--blanc);
    border: 1px solid var(--gris-perle);
    border-radius: 2px;
    padding: 28px;
    text-align: center;
    transition: all 0.3s ease;
}

.expertise-card:hover {
    border-color: var(--or-champagne);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.expertise-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gris-perle);
    border-radius: 50%;
    color: var(--noir);
}

.expertise-card h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--noir);
}

.expertise-card p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--gris-taupe);
}

/* Liste valeurs */
.values-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.values-list li {
    padding: 16px 0;
    border-bottom: 1px solid var(--gris-perle);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gris-anthracite);
}

.values-list li:last-child {
    border-bottom: none;
}

.values-list strong {
    color: var(--noir);
}

/* CTA retour chat */
.page-cta {
    text-align: center;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--gris-perle);
}

.btn-back-to-chat {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: var(--noir);
    color: var(--blanc);
    border: none;
    border-radius: 2px;
    font-family: var(--font-body);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-back-to-chat:hover {
    background: var(--or-champagne);
    color: var(--noir);
}

/* Responsive pages */
@media (max-width: 768px) {
    .page-container {
        padding: 40px 24px;
    }

    .page-header h1 {
        font-size: 32px;
    }

    .expertise-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 28px;
    }

    .page-section h2 {
        font-size: 22px;
    }
}
