/* --- Charte Graphique Gemini Dark --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Google Sans', 'Roboto', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

:root {
    --bg-main: #131314;
    --bg-surface: #1e1f20;
    --bg-hover: #2b2c2f;
    --border-color: #3c4043;
    --text-primary: #e3e3e3;
    --text-secondary: #9aa0a6;
    --accent-blue: #4285f4;
    --accent-blue-hover: #3367d6;
    --status-green: #00e676;
    --status-orange: #ff9100;
    --status-red: #ff5252;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

/* --- Navigation et Barre Supérieure --- */
.auth-nav {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 15px;
    font-size: 14px;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--accent-blue);
}

.user-info {
    color: var(--text-primary);
    font-size: 14px;
}

/* --- Conteneur Principal du Chat --- */
.main-container {
    width: 100%;
    max-width: 850px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 55px);
}

/* Zone de défilement des messages */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Style des bulles de message */
.message {
    max-width: 85%;
    font-size: 15px;
    line-height: 1.6;
    word-break: break-word;
}

.user-message {
    align-self: flex-end;
    background-color: var(--bg-hover);
    padding: 12px 20px;
    border-radius: 24px;
    color: #ffffff;
}

.ai-message {
    align-self: flex-start;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

/* Avatar IA sobre ✨ */
.ai-icon {
    width: 32px;
    height: 32px;
    background: #2a2b2d;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

/* Pulsation douce de l'avatar */
.pulsing {
    animation: softPulse 2s infinite ease-in-out;
}

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

/* --- Clignotement simple des points de chargement --- */
@keyframes simpleBlink {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

.loading-dots span {
    display: inline-block;
    animation: simpleBlink 1.2s infinite ease-in-out;
    margin-left: 2px;
    font-weight: bold;
}

.loading-dots span:nth-child(1) { animation-delay: 0.0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
.loading-dots span:nth-child(4) { animation-delay: 0.6s; }
.loading-dots span:nth-child(5) { animation-delay: 0.8s; }
.loading-dots span:nth-child(6) { animation-delay: 1.0s; }

/* --- Barre d'Exécution et Saisie --- */
.input-container {
    padding: 16px 16px 24px 16px;
    background: var(--bg-main);
}

.input-wrapper {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 4px 18px;
    display: flex;
    align-items: center;
    transition: background 0.2s, border-color 0.2s;
}

.input-wrapper:focus-within {
    background: var(--bg-hover);
    border-color: var(--accent-blue);
}

#userInput {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
    font-size: 15px;
    padding: 12px 0;
}

#sendBtn {
    cursor: pointer;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    margin-left: 12px;
    transition: color 0.2s ease;
}

#sendBtn:hover {
    color: var(--accent-blue);
}

/* --- Voyants Lumineux de Sécurité --- */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
    animation: glow 2s infinite alternate;
}

.status-vert { background-color: var(--status-green); box-shadow: 0 0 8px var(--status-green); }
.status-orange { background-color: var(--status-orange); box-shadow: 0 0 8px var(--status-orange); }
.status-rouge { background-color: var(--status-red); box-shadow: 0 0 8px var(--status-red); }

@keyframes glow {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

/* --- Chips de Suggestion --- */
.suggestions-container {
    margin-bottom: 12px;
    text-align: center;
}

.suggestion-title {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.suggestion-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.suggestion-chips button {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 18px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-chips button:hover {
    background: var(--bg-hover);
    border-color: var(--accent-blue);
}

/* --- Formulaires d'Authentification --- */
.auth-container {
    width: 100%;
    max-width: 400px;
    margin: 40px auto;
    padding: 28px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.auth-container h2 {
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 20px;
    font-weight: 500;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-size: 13px;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #ffffff;
    font-size: 14px;
}

.form-group input:focus {
    border-color: var(--accent-blue);
    outline: none;
}

.auth-btn, .btn-primary {
    width: 100%;
    padding: 10px 16px;
    background-color: var(--accent-blue);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
}

.auth-btn:hover, .btn-primary:hover {
    background-color: var(--accent-blue-hover);
}

.legal-box {
    background-color: #2a2518;
    border-left: 4px solid #ffc107;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 20px 0;
    text-align: left;
    color: #d1d5db;
    font-size: 0.82rem;
    line-height: 1.5;
}


/* --- Adaptations Mobile --- */
@media (max-width: 600px) {
    .main-container { height: 100vh; }
    .message { max-width: 95%; }
    .auth-container { margin: 20px 15px; width: auto; }
}

/* Scrollbar Custom pour Webkit */
.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }