/* ============================
   VARIABLES : LIGHT MODE
   ============================ */
:root {
    --bg-primary: #f2f2f7;
    --bg-secondary: #ffffff;

    --text-primary: #222;
    --text-secondary: #444;

    --accent: #3483fa;

    /* Bordures / Ombres */
    --border: #ddd;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);

    /* Champs / Formulaires */
    --input-bg: #fff;
    --input-border: #ccc;
    --input-text: #222;

    /* Messages */
    --msg-error-bg: #ffefef;
    --msg-error-text: #b30000;

    --msg-success-bg: #e9ffe9;
    --msg-success-text: #006600;
}

/* ============================
   VARIABLES : DARK MODE
   ============================ */
.dark-mode {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;

    --text-primary: #e8e8e8;
    --text-secondary: #b3b3b3;

    --accent: #4ca3ff;

    --border: #333;
    --shadow: 0 2px 8px rgba(0,0,0,0.4);

    --input-bg: #2a2a2a;
    --input-border: #555;
    --input-text: #eee;

    --msg-error-bg: #3b0000;
    --msg-error-text: #ff6b6b;

    --msg-success-bg: #0b2e0b;
    --msg-success-text: #8aff8a;
}




/* ================================================================= */
/* =========================== GLOBAL ============================== */
/* ================================================================= */

* {
    box-sizing: border-box;
}

body {
    background-color: #f5f5f5;
    color: #222;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;

    /* Transition douce pour les changements de thème */
    /*transition: background-color 0.3s ease, color 0.3s ease;*/
}

main {
    padding: 20px;
}


/* ================================================================= */
/* ============================= HEADER ============================= */
/* ================================================================= */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    padding: 10px 20px;
    border-bottom: 2px solid #ddd;
}

header h1 {
    margin: 0;
    font-size: 1.6em;
}

header h1 a {
    text-decoration: none;
    color: inherit;
}

.right-zone {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-info {
    display: flex;
    align-items: center; /* Centrage VERTICAL parfait */
    gap: 12px;           /* Espacement propre entre avatar / nom / bouton */
}


.status {
    font-size: 0.9em;
    opacity: 0.85;
}


/* ================================================================= */
/* ========================== BUTTONS =============================== */
/* ================================================================= */

.btn {
    background: #0078ff;
    color: white;
    padding: 8px 14px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.95em;
    display: inline-block;
    transition: background-color 0.2s ease;
}

.btn:hover {
    background: #005fcc;
}

.theme-btn {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 5px;
}


/* ================================================================= */
/* ======================== FORMS / INPUTS ========================== */
/* ================================================================= */

/* Form container */
form {
    max-width: 400px;
    margin: 30px auto;
    background: #ffffff;
    padding: 25px 30px;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

/* Labels */
form label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
}

/* Tous les champs de saisie */
form input[type="text"],
form input[type="password"],
form input[type="email"],
form select,
form textarea {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
}

/* Focus sur les champs */
form input:focus,
form select:focus,
form textarea:focus {
    border-color: #0078ff;
    outline: none;
}

/* Bouton principal (Créer le compte / Se connecter) */
form input[type="submit"],
form button.submit-btn {
    width: 100%;
    background: #0078ff;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
}

/* Hover / effet au survol */
form input[type="submit"]:hover,
form button.submit-btn:hover {
    background: #005fcc;
    transform: translateY(-1px);
}

/* Active / click */
form input[type="submit"]:active,
form button.submit-btn:active {
    transform: translateY(0);
}

/* Message d'erreur / succès */
form .form-message {
    margin-bottom: 12px;
    font-size: 0.9em;
    color: red;
}


/* ================================================================= */
/* ============================ DARK MODE =========================== */
/* ================================================================= */

.dark-mode body {
    background-color: #121212;
    color: #e6e6e6;
}

.dark-mode body header {
    background: #1f1f1f;
    border-bottom-color: #333;
}

.dark-mode body .btn {
    background: #3399ff;
    color: black;
}

.dark-mode body .btn:hover {
    background: #62b3ff;
}

.dark-mode body .theme-btn {
    color: #e6e6e6;
}

.dark-mode body a {
    color: #7ab8ff;
}

/* FORM dark mode */

.dark-mode body form {
    background: #1e1e1e;
    border-color: #333;
    color: #e6e6e6;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.dark-mode body form input[type="text"],
.dark-mode body form input[type="password"],
.dark-mode body form input[type="email"],
.dark-mode body form select,
.dark-mode body form textarea {
    background: #2b2b2b;
    color: #eaeaea;
    border: 1px solid #555;
}

.dark-mode body form input[type="submit"],
.dark-mode body form button.submit-btn {
    background: #3399ff;
    color: black;
}

.dark-mode body form input[type="submit"]:hover,
.dark-mode body form button.submit-btn:hover {
    background: #62b3ff;
}


/* ================================================================= */
/* ============================ PROFIL =========================== */
/* ================================================================= */

.profile-box {
	background: var(--bg-secondary);
	padding: 20px;
	border-radius: 10px;
	box-shadow: var(--shadow);
	}
	
.profile-box p {
	margin: 10px 0;
	}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--text);
}

.avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
}

.profile-container {
    max-width: 600px;
    margin: auto;
    text-align: center;
    padding: 20px;
}

.avatar-section {
    margin-bottom: 20px;
}

.avatar-large {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--text-secondary);
}

.avatar-form {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.card-block {
    max-width: 600px;          /* même largeur que l’encart profil */
    margin: 20px auto;         /* centré */
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 10px;
    text-align: center;
}

.avatar-form input[type="file"] {
    width: 100%;
}

.avatar-form button {
    margin-top: 10px;
}


.profile-info {
    margin-top: 20px;
    text-align: left;
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 10px;
}

.btn {
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

.btn-secondary {
    background: var(--bg-secondary);
}

.btn:hover {
    opacity: 0.85;
}

/* --- PROFILE CARD v2 --- */
/* Toutes les classes sont préfixées pc- pour éviter tout conflit */

.pc-card {
    max-width: 480px;
    margin: 40px auto;
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: 18px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    text-align: center;
    transition: background 0.3s, color 0.3s;
}

/* Avatar */
.pc-avatar-wrapper {
    margin-bottom: 15px;
}

.pc-avatar-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--text-secondary);
}

/* Username + Role */
.pc-username {
    font-size: 1.8rem;
    margin-bottom: 2px;
}

.pc-role {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* Section informations */
.pc-section {
    background: var(--bg-primary);
    padding: 18px;
    border-radius: 12px;
    text-align: left;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* Formulaire avatar */
.pc-avatar-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

/* Input fichier custom */
.pc-file-label {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 10px;
    width: 100%;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    border: 1px solid var(--text-secondary);
    transition: 0.3s;
}

.pc-file-label:hover {
    background: var(--bg-secondary);
    border-color: var(--text-primary);
}

.pc-file-label input {
    display: none;
}

/* Boutons */
.pc-btn-main {
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: opacity 0.2s;
    width: 100%;
}

.pc-btn-main:hover {
    opacity: 0.9;
}

.pc-btn-secondary {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 14px;
    border: 1px solid var(--text-secondary);
    color: var(--text-primary);
    border-radius: 10px;
    transition: border-color 0.3s;
}

.pc-btn-secondary:hover {
    border-color: var(--text-primary);
}

/* --- Bouton Retour moderne --- */

.pc-btn-return {
    display: inline-block;
    padding: 10px 18px;
    margin-top: 15px;
    border-radius: 12px;
    background: none;
    border: 2px solid var(--text-secondary);
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
    transition: 0.25s ease;
    cursor: pointer;
}

.pc-btn-return:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    transform: translateY(-2px);
}

/* Formulaire édition profil */

.pc-edit-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pc-input, .pc-textarea {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--text-secondary);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: 0.2s;
}

.pc-input:focus, .pc-textarea:focus {
    border-color: var(--text-primary);
    outline: none;
}

.pc-textarea {
    min-height: 80px;
    resize: vertical;
}
