@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;600;700&display=swap');

:root {
    --primary: #4361ee;
    --primary-hover: #3f37c9;
    --accent: #4cc9f0;
    --bg-gradient: linear-gradient(135deg, #f8f9ff 0%, #e2e8f0 100%);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.6);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
    --radius: 16px;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: linear-gradient(-45deg, #f1f5f9, #e0e7ff, #f8fafc, #e2e8f0);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    margin: 0;
    color: var(--text-main);
    min-height: 100vh;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow-md);
}

/* Menus de l'index */
.menu {
    margin-bottom: 2rem;
}

.menu h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
    padding-left: 0.5rem;
    border-left: 4px solid var(--primary);
}

.menu div {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

button, .btn {
    font-family: inherit;
    font-weight: 600;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(67, 97, 238, 0.2);
}

button:active {
    transform: translateY(0);
}

/* --- Cartes de Formulaires (Login/Register/Profile) --- */
.form-card, .profil-container, .form-change-password-card {
    max-width: 450px;
    margin: 4rem auto;
    padding: 3rem;
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
}

.form-card h1, .profil-container h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--primary);
    text-align: center;
}

.form-card form div, .form-change-password-card form div {
    margin-bottom: 1.2rem;
}

.form-card label, .form-change-password-card label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.form-card input, .form-change-password-card input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.form-card input:focus, .form-change-password-card input:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
    outline: none;
}

.form-link {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-error {
    background: #fff1f2;
    color: #e11d48;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    border-left: 4px solid #e11d48;
}

/* --- Nouveau Style Profil --- */
.profil-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
    align-items: start;
}

.profil-sidebar {
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-hover) 100%);
    padding: 3rem 2rem;
    border-radius: 24px;
    color: white;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.avatar-circle {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
}

.profil-sidebar h1 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
    color: white;
}

.profil-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profil-info-card {
    background: white;
    padding: 2rem;
    border-radius: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #f1f5f9;
}

.info-section {
    margin-bottom: 2rem;
}

.info-section h3 {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .profil-grid { grid-template-columns: 1fr; }
}

@media print {
    thead th:last-child,
    tbody td:last-child,
    .filter-row,
    .fas,
    .add-button,
    header,
    footer {
        display: none !important;
    }
}