/* === STYLE GLOBAL api.pimentbleu.fr === */

/* --- Variables CSS — Charte Piment Bleu --- */
:root {
    --bleu-fonce: #1a2744;      /* Fond header/footer */
    --bleu-moyen: #2c4a7c;      /* Accents secondaires */
    --bleu-clair: #e8eef6;      /* Fond sections alternées */
    --piment: #e85d3a;          /* Accent chaud — boutons, liens actifs */
    --piment-hover: #d14a28;    /* Accent chaud au survol */
    --texte: #2d2d2d;           /* Texte principal */
    --texte-clair: #6b7280;     /* Texte secondaire */
    --blanc: #ffffff;
    --border: #dde3ec;          /* Bordures légères */
    --radius: 8px;              /* Arrondi global */
    --shadow: 0 2px 12px rgba(26, 39, 68, 0.08); /* Ombre douce */
}

/* --- Reset de base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- Typographie générale --- */
body {
    font-family: 'Source Sans 3', sans-serif;
    color: var(--texte);
    background: var(--blanc);
    line-height: 1.6;
    min-height: 100vh;          /* Hauteur minimum = écran complet */
    display: flex;
    flex-direction: column;     /* Header en haut, footer en bas, contenu entre les deux */
}

h1, h2, h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    line-height: 1.2;
}

a {
    color: var(--bleu-moyen);
    text-decoration: none;
    transition: color 0.2s;     /* Transition douce au survol */
}

a:hover {
    color: var(--piment);
}

/* === HEADER === */
.site-header {
    background: var(--bleu-fonce);
    padding: 0 2rem;
    position: sticky;           /* Le header reste visible en haut lors du scroll */
    top: 0;
    z-index: 100;               /* Au-dessus du contenu */
}

.header-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Logo à gauche, nav à droite */
    height: 64px;
}

/* Logo texte */
.site-logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--blanc);            /* Texte du logo en blanc sur fond sombre */
}

/* Navigation */
.site-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;                /* Espacement entre les liens */
}

.nav-link {
    color: rgba(255, 255, 255, 0.75); /* Blanc semi-transparent */
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.4rem 0;
    border-bottom: 2px solid transparent; /* Bordure invisible par défaut */
    transition: color 0.2s, border-color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--blanc);
    border-bottom-color: var(--piment); /* Souligné en orange au survol/actif */
}

/* Bouton "Espace client" */
.btn-login {
    background: var(--piment);
    color: var(--blanc) !important;
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius);
    border-bottom: none !important; /* Pas de soulignement sur le bouton */
}

.btn-login:hover {
    background: var(--piment-hover);
}

/* Bouton déconnexion */
.nav-logout {
    opacity: 0.6;
}

.nav-logout:hover {
    opacity: 1;
}

/* === CONTENU PRINCIPAL === */
.site-main {
    flex: 1;                    /* Prend tout l'espace restant entre header et footer */
}

/* === HERO (page d'accueil) === */
.hero {
    background: linear-gradient(135deg, var(--bleu-fonce) 0%, var(--bleu-moyen) 100%);
    padding: 5rem 2rem;
    text-align: center;
}

.hero-content {
    max-width: 680px;
    margin: 0 auto;
}

.hero h1 {
    color: var(--blanc);
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    color: var(--piment);
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.hero-actions {
    margin-top: 1rem;
}

/* === BOUTONS === */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: var(--radius);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.15s;
}

.btn:hover {
    transform: translateY(-1px); /* Léger soulèvement au survol */
}

.btn-primary {
    background: var(--piment);
    color: var(--blanc);
}

.btn-primary:hover {
    background: var(--piment-hover);
    color: var(--blanc);
}

.btn-secondary {
    background: var(--bleu-clair);
    color: var(--bleu-fonce);
}

.btn-secondary:hover {
    background: var(--border);
}

/* === SECTION FONCTIONNALITÉS === */
.features {
    padding: 4rem 2rem;
    background: var(--bleu-clair);
}

.features-container {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 colonnes égales */
    gap: 2rem;
}

.feature-card {
    background: var(--blanc);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-4px);  /* Soulèvement au survol */
    box-shadow: 0 8px 24px rgba(26, 39, 68, 0.12); /* Ombre plus marquée */
}

.feature-icon {
    font-size: 2.4rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.15rem;
    color: var(--bleu-fonce);
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--texte-clair);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* === PAGE DE CONNEXION === */
.login-page {
    display: flex;
    justify-content: center;    /* Centrage horizontal */
    padding: 4rem 2rem;
}

.login-box {
    width: 100%;
    max-width: 420px;           /* Largeur max du formulaire */
    background: var(--blanc);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.login-box h1 {
    font-size: 1.6rem;
    color: var(--bleu-fonce);
    margin-bottom: 0.25rem;
    text-align: center;
}

.login-subtitle {
    color: var(--texte-clair);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* Bouton pleine largeur */
.btn-full {
    width: 100%;
    text-align: center;
    margin-top: 0.5rem;
}

/* Lien mot de passe oublié */
.forgot-password-link {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.9rem;
}

.forgot-password-link a {
    color: var(--texte-clair);
    transition: color 0.2s;
}

.forgot-password-link a:hover {
    color: var(--piment);
}

/* === ÉLÉMENTS PARTAGÉS PAGES INTERNES === */

/* Sous-titre de page */
.page-subtitle {
    color: var(--texte-clair);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

/* Carte / bloc de contenu */
.card {
    background: var(--blanc);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.card h2 {
    font-size: 1.25rem;
    color: var(--bleu-fonce);
    margin-bottom: 1.5rem;
}

/* Ligne de formulaire côte à côte */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Deux colonnes égales */
    gap: 1rem;
}

/* Texte atténué */
.text-muted {
    color: var(--texte-clair);
    font-size: 0.95rem;
}

/* Texte d'avertissement */
.text-warning {
    color: #d97706;             /* Orange foncé */
    font-weight: 600;
}

/* État vide (aucune donnée) */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--texte-clair);
}

.empty-state p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Badges de statut */
.badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;        /* Forme arrondie "pilule" */
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background: #ecfdf5;
    color: #065f46;
}

.badge-error {
    background: #fef2f2;
    color: #991b1b;
}

.badge-inactive {
    background: #f3f4f6;
    color: #6b7280;
}

/* === TABLEAU DE BORD === */

/* Cartes de résumé en ligne */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

.dash-card {
    background: var(--blanc);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    text-align: center;
}

.dash-card-value {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--bleu-fonce);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.dash-card-label {
    font-size: 0.9rem;
    color: var(--texte-clair);
}

/* Variantes de couleur pour les cartes */
.dash-card-success {
    border-left: 4px solid #10b981; /* Bordure verte à gauche */
}

.dash-card-warning {
    border-left: 4px solid #f59e0b; /* Bordure orange à gauche */
}

/* Actions du dashboard */
.dashboard-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

/* === PAGE LICENCES === */

/* Liste de cartes licence */
.license-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.license-card {
    background: var(--blanc);
    padding: 1.5rem 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    border-left: 4px solid #10b981; /* Bordure verte par défaut = active */
}

.license-expired {
    border-left-color: #ef4444;  /* Bordure rouge = expirée */
    opacity: 0.75;               /* Légèrement estompée */
}

.license-warning {
    border-left-color: #f59e0b;  /* Bordure orange = expiration proche */
}

.license-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.license-header h3 {
    font-size: 1.1rem;
    color: var(--bleu-fonce);
}

.license-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 colonnes pour les détails */
    gap: 1rem;
    margin-bottom: 1rem;
}

.license-detail {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.8rem;
    color: var(--texte-clair);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-weight: 600;
    color: var(--texte);
}

/* Clé de licence en police monospace */
.license-key {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.license-actions {
    padding-top: 1rem;
    border-top: 1px solid var(--border); /* Séparateur avant les boutons */
}

/* Bouton petit format */
.btn-sm {
    padding: 0.4rem 1.2rem;
    font-size: 0.9rem;
}

/* === PAGE PAIEMENT === */

/* Résumé de commande */
.payment-summary {
    margin-bottom: 2rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.summary-label {
    color: var(--texte-clair);
}

.summary-value {
    font-weight: 600;
}

/* Ligne total mise en avant */
.summary-total {
    border-bottom: none;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 2px solid var(--bleu-fonce); /* Double bordure pour le total */
}

.summary-total .summary-label,
.summary-total .summary-value {
    font-size: 1.1rem;
    color: var(--bleu-fonce);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* Zone bouton PayPal */
.paypal-container {
    text-align: center;
    padding: 2rem;
    background: var(--bleu-clair);
    border-radius: var(--radius);
}

/* === RESPONSIVE PAGES INTERNES === */
@media (max-width: 768px) {
    /* Cartes dashboard en colonne */
    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    /* Détails licence en colonne */
    .license-details {
        grid-template-columns: 1fr;
    }

    /* Formulaires en colonne */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Actions du dashboard empilées */
    .dashboard-actions {
        flex-direction: column;
    }
}

/* === PAGE 404 === */
.page-404 {
    text-align: center;
    padding: 6rem 2rem;
}

.page-404 h1 {
    font-size: 6rem;
    color: var(--bleu-moyen);
    opacity: 0.3;
    margin-bottom: 0.5rem;
}

.page-404 p {
    color: var(--texte-clair);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* === FOOTER === */
.site-footer {
    background: var(--bleu-fonce);
    padding: 1.5rem 2rem;
    text-align: center;
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
}

.site-footer p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

/* Liens dans le footer — blanc par défaut */
.site-footer a {
    color: var(--blanc);            /* Texte du lien en blanc pour rester lisible sur fond sombre */
}

/* Survol des liens dans le footer — accent piment */
.site-footer a:hover {
    color: var(--piment);           /* Orange au survol pour cohérence avec la charte */
}

/* === UTILITAIRES POUR LES FUTURES PAGES === */

/* Container de page standard */
.page-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* Formulaires */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--bleu-fonce);
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--bleu-moyen); /* Bordure bleue au focus */
}

/* Messages d'alerte */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Tableaux */
.table-container {
    overflow-x: auto;           /* Scroll horizontal sur mobile si nécessaire */
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bleu-clair);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--bleu-fonce);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    /* Header mobile */
    .header-container {
        flex-direction: column;
        height: auto;
        padding: 1rem 0;
        gap: 0.75rem;
    }

    .site-nav {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Hero mobile */
    .hero {
        padding: 3rem 1.5rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    /* Fonctionnalités en colonne sur mobile */
    .features-container {
        grid-template-columns: 1fr;
    }
}