/* ===========================================
   KOI Hub — Design System (Style Revolut/Fintech)
   =========================================== */

/* --- Variables CSS --- */
/* On centralise toutes les couleurs ici pour pouvoir les changer facilement */
:root {
    --bg-primary: #0a0a0f;        /* Fond principal — presque noir */
    --bg-card: #12121a;           /* Fond des cartes */
    --bg-card-hover: #1a1a25;     /* Fond carte au survol */
    --bg-input: #0e0e16;          /* Fond des champs de saisie */
    --bg-elevated: #1e1e2a;       /* Éléments surélevés */

    --border: #1f1f2e;            /* Bordures subtiles */
    --border-hover: #2a2a40;      /* Bordures au survol */

    --text-primary: #ffffff;       /* Texte principal — blanc pur */
    --text-secondary: #7a7a8e;     /* Texte secondaire — gris */
    --text-tertiary: #4a4a5e;      /* Texte tertiaire — gris foncé */

    --accent: #4e8cff;             /* Bleu — couleur signature */
    --accent-dim: #3b7aed;         /* Accent atténué */
    --accent-bg: rgba(78, 140, 255, 0.1); /* Fond accent transparent */

    --rouge: #ff4757;              /* Erreur / danger */
    --orange: #ffa502;             /* Attention / moyenne */
    --bleu: #3b82f6;               /* Info / en cours */
    --vert: #2ecc71;               /* Succès / terminé */

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --font: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
    font-family: var(--font);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* --- Import Google Font Inter --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* --- Header --- */
.header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.header-gauche {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.header .sous-titre {
    color: var(--text-tertiary);
    font-size: 0.8rem;
    font-weight: 400;
}

.logo-accent {
    color: var(--accent);
    font-weight: 800;
}

/* --- Contenu principal --- */
.contenu {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* --- Section titre --- */
.section-titre {
    margin-bottom: 1.5rem;
}

.section-titre h2 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.section-titre .sous-texte {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* --- Grille des objectifs --- */
.grille-objectifs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
}

/* --- Carte d'objectif --- */
.carte-objectif {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.carte-objectif::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.25s;
}

.carte-objectif:hover {
    border-color: var(--border-hover);
    background-color: var(--bg-card-hover);
    transform: translateY(-2px);
}

.carte-objectif:hover::before {
    opacity: 1;
}

.carte-objectif h3 {
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 0.4rem;
}

.carte-objectif .description {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

/* --- Stats dans la carte --- */
.carte-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.carte-stat-principal {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text-primary);
}

.carte-stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* --- Barre de progression --- */
.barre-progression-container {
    background-color: var(--bg-elevated);
    border-radius: 100px;
    height: 6px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.barre-progression {
    height: 100%;
    border-radius: 100px;
    transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.barre-progression.faible { background: linear-gradient(90deg, #ff4757, #ff6b81); }
.barre-progression.moyen { background: linear-gradient(90deg, #ffa502, #ffbe33); }
.barre-progression.bon { background: linear-gradient(90deg, #2ecc71, #4edb8b); }

.carte-objectif .stats-ligne {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.carte-objectif .stats-ligne .compteur {
    color: var(--text-secondary);
}

.carte-objectif .stats-ligne .progression-texte {
    font-weight: 700;
    color: var(--accent);
}

/* --- Deadline badge --- */
.deadline {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    padding: 0.3rem 0.7rem;
    border-radius: 100px;
    margin-top: 1rem;
    font-weight: 500;
}

.deadline.a-venir { background-color: rgba(46, 204, 113, 0.1); color: var(--vert); }
.deadline.proche { background-color: rgba(255, 165, 2, 0.15); color: var(--orange); }
.deadline.depasse { background-color: rgba(255, 71, 87, 0.15); color: var(--rouge); }

/* --- Boutons --- */
.btn {
    padding: 0.65rem 1.4rem;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: var(--font);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-principal {
    background-color: var(--accent);
    color: #ffffff;
}

.btn-principal:hover {
    background-color: #6aa0ff;
    transform: scale(1.02);
}

.btn-secondaire {
    background-color: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondaire:hover {
    border-color: var(--border-hover);
    background-color: var(--bg-card-hover);
}

.btn-danger {
    background-color: rgba(255, 71, 87, 0.15);
    color: var(--rouge);
}

.btn-danger:hover {
    background-color: rgba(255, 71, 87, 0.25);
}

/* --- Modal --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    width: 90%;
    max-width: 480px;
    animation: modalIn 0.2s ease;
}

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

.modal h2 {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

/* --- Champs de formulaire --- */
.champ {
    margin-bottom: 1rem;
}

.champ label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.champ input,
.champ textarea,
.champ select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font);
    transition: border-color 0.2s;
}

.champ input:focus,
.champ textarea:focus,
.champ select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

.champ input::placeholder,
.champ textarea::placeholder {
    color: var(--text-tertiary);
}

.champ textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.75rem;
}

/* --- Message vide --- */
.message-vide {
    text-align: center;
    color: var(--text-tertiary);
    padding: 4rem 2rem;
    font-size: 0.95rem;
}

/* --- Section Agenda --- */
.section-agenda {
    margin-bottom: 2rem;
}

.agenda-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.agenda-card-info {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
}

.agenda-card-info p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.liste-evenements {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.carte-evenement {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.15s ease;
}

.carte-evenement:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--border-hover);
    border-left-color: var(--accent);
}

.evenement-date {
    min-width: 70px;
    text-align: center;
}

.evenement-jour {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1;
}

.evenement-mois {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.evenement-heure {
    font-size: 0.72rem;
    color: var(--accent);
    font-weight: 600;
    margin-top: 0.15rem;
}

.evenement-separateur {
    width: 1px;
    height: 36px;
    background-color: var(--border);
}

.evenement-infos {
    flex: 1;
    min-width: 0;
}

.evenement-titre {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.evenement-lieu {
    color: var(--text-tertiary);
    font-size: 0.78rem;
    margin-top: 0.15rem;
}

.badge-journee {
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
    background-color: var(--accent-bg);
    color: var(--accent);
    font-weight: 600;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }
    .contenu {
        padding: 1rem;
    }
    .grille-objectifs {
        grid-template-columns: 1fr;
    }
    .section-titre h2 {
        font-size: 1.4rem;
    }
}
