/*============================================================+
// File name   : style.css
// Description : Styles globaux pour FIBU
// Author      : Raoul Mengis
// Version     : 2026.02.07
//============================================================+*/

/* Variables CSS pour thèmes */
:root {
    /* Thème Clair (Argent/Gris clair) - Par défaut */
    --bg-primary: #e8e8e8;
    --bg-secondary: #f5f5f5;
    --bg-card: rgba(255, 255, 255, 0.95);
    --text-primary: #2c3e50;
    --text-secondary: #5a6c7d;
    --text-muted: #7f8c8d;
    --border-color: rgba(0, 0, 0, 0.1);
    --accent-color: #3498db;
    --accent-hover: #2980b9;
    --shadow-color: rgba(0, 0, 0, 0.15);
    --input-bg: rgba(255, 255, 255, 0.8);
    --footer-bg: rgba(236, 240, 241, 0.98);
    --overlay-bg: rgba(255, 255, 255, 0.85);
    --danger-bg: rgba(231, 76, 60, 0.1);
    --danger-border: rgba(231, 76, 60, 0.3);
    --danger-text: #c0392b;
}

/* Thème Sombre */
[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-card: rgba(26, 26, 26, 0.95);
    --text-primary: #ecf0f1;
    --text-secondary: #bdc3c7;
    --text-muted: #95a5a6;
    --border-color: rgba(255, 255, 255, 0.1);
    --accent-color: #3b82f6;
    --accent-hover: #60a5fa;
    --shadow-color: rgba(0, 0, 0, 0.8);
    --input-bg: rgba(45, 45, 45, 0.6);
    --footer-bg: rgba(10, 10, 10, 0.98);
    --overlay-bg: rgba(0, 0, 0, 0.85);
    --danger-bg: rgba(220, 53, 69, 0.2);
    --danger-border: rgba(220, 53, 69, 0.3);
    --danger-text: #ff6b6b;
}

/* Reset et Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Image de fond */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/background.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    opacity: 0.4;
    z-index: -2;
    transition: opacity 0.3s ease;
}

[data-theme="dark"] body::before {
    opacity: 0.15;
}

/* Overlay pour lisibilité */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--overlay-bg);
    z-index: -1;
    transition: background 0.3s ease;
}

/* Container principal */
.main-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: calc(100vh - 300px);
}

/* Carte de connexion */
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px var(--shadow-color),
                0 0 0 1px var(--border-color);
    backdrop-filter: blur(10px);
    overflow: hidden;
    width: 100%;
    max-width: 450px;
    animation: slideUp 0.6s ease-out;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

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

.login-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease;
}

.login-header h2 {
    margin: 0;
    font-weight: 300;
    letter-spacing: 2px;
    color: var(--text-primary);
    font-size: 1.8rem;
    transition: color 0.3s ease;
}

.login-header::before {
    content: '\f2bd';
    font-family: 'Font Awesome 7 Free';  /* ← Changé en v7 */
    font-weight: 900;
    display: block;
    font-size: 3rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-body {
    padding: 35px;
}

/* Formulaires */
.form-group {
    margin-bottom: 25px;
    position: relative;
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeIn {
    to { opacity: 1; }
}

.form-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: block;
    transition: color 0.3s ease;
}

.form-control {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    padding: 12px 15px;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
}

.form-control:focus {
    background: var(--bg-secondary);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    color: var(--text-primary);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.input-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    transition: color 0.3s ease;
}

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
    width: 100%;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.5);
    filter: brightness(1.1);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 100%;
    margin-top: 15px;
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* Liens */
.forgot-password {
    text-align: center;
    margin-top: 20px;
}

.forgot-password a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    position: relative;
}

.forgot-password a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.forgot-password a:hover {
    color: var(--accent-color);
}

.forgot-password a:hover::after {
    width: 100%;
}

/* Alertes */
.alert {
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    backdrop-filter: blur(5px);
}

.alert-danger {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger-text);
}

/* Bouton Toggle Mode Jour/Nuit */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--shadow-color);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--shadow-color);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.theme-toggle .icon-sun {
    color: #f39c12;
}

.theme-toggle .icon-moon {
    color: #74b9ff;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    opacity: 0.3;
}

[data-theme="light"] .theme-toggle .icon-moon,
:root:not([data-theme="dark"]) .theme-toggle .icon-moon {
    opacity: 0.3;
}

/* Footer */
.footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--border-color);
    padding: 50px 0 20px;
    margin-top: auto;
    transition: background 0.3s ease;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h4 {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
    transition: color 0.3s ease;
}

.footer-column h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--accent-color);
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column li {
    margin-bottom: 12px;
}

.footer-column a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-column a:hover {
    color: var(--accent-color);
    transform: translateX(5px);
}

.footer-column a::before {
    content: '\f054';
    font-family: 'Font Awesome 7 Free';  /* ← Corrigé pour v7.0.1 */
    font-weight: 900;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.footer-column a:hover::before {
    opacity: 1;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-info {
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.version-badge {
    background: rgba(52, 152, 219, 0.15);
    color: var(--accent-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.social-links a:hover {
    color: white;
    background: var(--accent-color);
    transform: translateY(-3px);
    border-color: var(--accent-color);
}

.alert-success {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: #27ae60;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    backdrop-filter: blur(5px);
}

[data-theme="dark"] .alert-success {
    background: rgba(46, 204, 113, 0.2);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: #58d68d;
}

.btn-exit {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #e74c3c;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-exit:hover {
    background: rgba(231, 76, 60, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

[data-theme="dark"] .btn-exit {
    background: rgba(231, 76, 60, 0.2);
    color: #ec7063;
}

[data-theme="dark"] .btn-exit:hover {
    background: rgba(231, 76, 60, 0.3);
}

/* Responsive Design */
@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .theme-toggle {
        top: 10px;
        right: 10px;
        padding: 6px;
        font-size: 1rem;
    }

    .theme-toggle .icon-sun,
    .theme-toggle .icon-moon {
        width: 20px;
        height: 20px;
    }

    .main-container {
        padding: 15px;
        min-height: calc(100vh - 400px);
    }

    .login-card {
        max-width: 100%;
    }

    .login-header {
        padding: 25px;
    }

    .login-header h2 {
        font-size: 1.5rem;
    }

    .login-body {
        padding: 25px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        text-align: center;
    }

    .footer-column h4::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-column a {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-info {
        flex-direction: column;
        gap: 10px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .login-header::before {
        font-size: 2.5rem;
    }

    .login-header h2 {
        font-size: 1.3rem;
    }

    .btn {
        font-size: 0.85rem;
    }
}
