/* =========================================================
   COMPOSANTS : boutons, formulaires, avatars, badges, toasts
   ========================================================= */

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 56px;
    padding: 14px 20px;
    font-size: 18px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: transform 0.08s ease, background 0.2s;
    user-select: none;
    cursor: pointer;
    text-align: center;
}
.btn:active     { transform: scale(0.98); }
.btn-primary    { background: var(--primary); color: #FFF; }
.btn-primary:hover  { background: var(--primary-dark); }
.btn-accent     { background: var(--accent); color: #FFF; }
.btn-accent:hover   { background: var(--accent-dark); }
.btn-secondary  { background: var(--bg-muted); color: var(--text); }
.btn-ghost      { background: transparent; color: var(--primary); }
.btn-danger     { background: var(--danger); color: #FFF; }

/* ---------- Bouton icône (rond) ---------- */
.icon-btn {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 22px;
    position: relative;
    color: #FFF;
    transition: background 0.2s;
}
.icon-btn:hover,
.icon-btn:active { background: rgba(255,255,255,0.15); }

/* ---------- Badge notifications ---------- */
.notif-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--accent);
    color: #FFF;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid var(--primary);
}

/* ---------- Avatar ---------- */
.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

/* ---------- Champs de formulaire ---------- */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 16px 18px;
    font-size: 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: #FFF;
    transition: border-color 0.2s;
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
}
.form-textarea {
    min-height: 140px;
    resize: vertical;
    font-family: inherit;
}

/* Boutons d'action de formulaire (Annuler / Publier) */
.form-actions {
    display: flex;
    gap: 10px;
    padding: 12px 0 24px;
}

/* ---------- Message d'erreur ---------- */
.error-message {
    color: var(--danger);
    font-size: 15px;
    margin: 4px 0 12px;
    padding: 10px 12px;
    background: rgba(192, 57, 43, 0.08);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--danger);
}

/* ---------- Toast (notification fugace en haut) ---------- */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: #FFF;
    padding: 12px 20px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---------- Menu items (page profil) ---------- */
.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    width: 100%;
    text-align: left;
    font-size: 17px;
    color: var(--text);
}
.menu-item:active { background: var(--bg-muted); }
.menu-item-icon {
    font-size: 22px;
    width: 28px;
    text-align: center;
}
.menu-item-chevron {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 22px;
}

/* Variante : menu item contenant un formulaire (changer prénom) */
.menu-item-form {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}
.menu-item-form .form-input {
    flex: 1;
    padding: 12px 14px;
    font-size: 16px;
}
.menu-item-form .btn {
    width: auto;
    min-height: 44px;
    padding: 8px 14px;
    font-size: 15px;
}
