/* ============================================
   PhotoFamille - Feuille de style unique
   Chargée par header.php via BASE_URL
   ============================================ */
:root {
    --bleu-fonce: #1b2a4a;
    --bleu: #2e4a7d;
    --or: #d4a94e;
    --or-clair: #e8c97a;
    --fond: #f5f2ec;
    --texte: #2b2b2b;
    --blanc: #ffffff;
    --erreur: #c0392b;
    --succes: #0a7d32;
    --ombre: 0 4px 16px rgba(27, 42, 74, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--fond);
    color: var(--texte);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- En-tête + navigation ---------- */
.site-header {
    background: var(--bleu-fonce);
    color: var(--blanc);
    box-shadow: var(--ombre);
    position: sticky;
    top: 0;
    z-index: 10;
}
.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.8rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem;
}
.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--blanc);
    text-decoration: none;
    letter-spacing: 0.5px;
}
.logo span { color: var(--or); }
.logo-ico { margin-right: 0.3rem; }

.main-nav { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.nav-form { display: inline; }
.nav-link {
    color: #dfe6f2;
    text-decoration: none;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s;
}
.nav-link:hover { background: var(--bleu); color: var(--blanc); }
.nav-link.actif { background: var(--or); color: var(--bleu-fonce); font-weight: 600; }
.nav-deconnexion { border: 1px solid rgba(255,255,255,0.25); font-size: 0.85rem; }

/* ---------- Structure ---------- */
.conteneur { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.2rem 3rem; }

.site-footer {
    background: var(--bleu-fonce);
    color: #b8c2d8;
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
}

/* ---------- Hero accueil ---------- */
.hero { text-align: center; padding: 3rem 1rem 2rem; }
.hero h1 { font-size: 2.2rem; color: var(--bleu-fonce); line-height: 1.25; }
.hero h1 span { color: var(--or); }
.hero-texte { max-width: 640px; margin: 1rem auto 0; color: #555; font-size: 1.05rem; }

/* ---------- Cartes accueil ---------- */
.accueil-grille {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.2rem;
    margin: 2rem 0;
}
.carte {
    background: var(--blanc);
    border-radius: 14px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--ombre);
}
.carte-ico { font-size: 2.4rem; margin-bottom: 0.6rem; }
.carte h3 { color: var(--bleu-fonce); margin-bottom: 0.5rem; }
.carte p { color: #666; font-size: 0.95rem; }

/* ---------- Connexion ---------- */
.section-connexion { display: flex; justify-content: center; margin: 2rem 0; }
.boite-connexion {
    background: var(--blanc);
    padding: 2rem;
    border-radius: 14px;
    box-shadow: var(--ombre);
    width: 100%;
    max-width: 400px;
}
.boite-connexion h2 { color: var(--bleu-fonce); margin-bottom: 1rem; text-align: center; }
.note { text-align: center; font-size: 0.85rem; color: #888; margin-top: 1rem; }
.note a { color: var(--or); font-weight: 600; text-decoration: underline; }
.note a:hover { color: var(--bleu-fonce); }
.email-contact { text-align: center; margin: 1.2rem 0; }
.retour-index { text-align: center; margin: 1.5rem 0; }
.retour-index a { color: var(--bleu-fonce); text-decoration: underline; }

/* ---------- Boîtes / formulaires ---------- */
.boite {
    background: var(--blanc);
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: var(--ombre);
    margin: 1.5rem 0;
}
.boite h2 { color: var(--bleu-fonce); margin-bottom: 1rem; font-size: 1.2rem; }

.formulaire { display: flex; flex-direction: column; gap: 0.5rem; }
.formulaire label { font-weight: 600; color: var(--bleu-fonce); font-size: 0.9rem; margin-top: 0.5rem; }
.formulaire input, .formulaire select, .formulaire textarea {
    padding: 0.65rem 0.8rem;
    border: 1.5px solid #d8d3c8;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
}
.formulaire input:focus, .formulaire select:focus, .formulaire textarea:focus {
    outline: none;
    border-color: var(--or);
}
.form-colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.8rem; }
.recherche-boutons { display: flex; gap: 0.7rem; align-items: center; }
.recherche-boutons .btn-principal { margin-top: 0.6rem; }
.btn-upload { margin-bottom: 1rem; }

/* ---------- Pop-up (fenêtre modale) ---------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal[hidden] { display: none; }
.modal-fond {
    position: absolute;
    inset: 0;
    background: rgba(27, 42, 74, 0.55); /* voile bleu foncé semi-transparent */
}
.modal-boite {
    position: relative;
    background: var(--blanc);
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto; /* scroll si l'écran est petit */
    margin: 0;
}
.modal-entete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}
.modal-entete h2 { margin: 0; font-size: 1.2rem; color: var(--bleu-fonce); }
.modal-fermer {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #999;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
}
.modal-fermer:hover { background: #f0ece4; color: var(--erreur); }
.modal-boutons { display: flex; gap: 0.7rem; justify-content: flex-end; margin-top: 1rem; }
.modal-boutons .btn-principal { margin-top: 0; }

/* ---------- Diaporama (visionneuse plein écran) ---------- */
.diaporama {
    position: fixed;
    inset: 0;
    z-index: 150; /* au-dessus de la pop-up d'upload */
    background: rgba(10, 15, 30, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 4.5rem;
}
.diaporama[hidden] { display: none; }
.diapo-cadre {
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.diapo-cadre img {
    max-width: 100%;
    max-height: calc(100vh - 9rem);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.6);
}
#diapo-legende {
    color: #fff;
    text-align: center;
    margin-top: 0.8rem;
    font-size: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.diapo-nav, .diapo-fermer {
    position: absolute;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 2.4rem;
    line-height: 1;
    width: 3rem;
    height: 3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.diapo-nav:hover, .diapo-fermer:hover { background: rgba(255, 255, 255, 0.28); }
.diapo-precedent { left: 1rem; top: 50%; transform: translateY(-50%); }
.diapo-suivant   { right: 1rem; top: 50%; transform: translateY(-50%); }
.diapo-fermer    { top: 1rem; right: 1rem; font-size: 1.4rem; width: 2.4rem; height: 2.4rem; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: inherit;
    text-decoration: none;
    text-align: center;
    transition: filter 0.2s;
    background: #e4e0d8;
    color: var(--bleu-fonce);
}
.btn:hover { filter: brightness(0.95); }
.btn-principal { background: var(--or); color: var(--bleu-fonce); font-weight: 600; margin-top: 1rem; }
.btn-succes { background: var(--succes); color: #fff; }
.btn-danger { background: var(--erreur); color: #fff; }
.btn-mini { padding: 0.3rem 0.7rem; font-size: 0.8rem; }

/* ---------- Titres ---------- */
.titre-page { color: var(--bleu-fonce); font-size: 1.7rem; margin-bottom: 0.3rem; }
.sous-titre { color: #777; margin-bottom: 1.5rem; }
.titre-section { color: var(--bleu-fonce); margin: 2rem 0 1rem; font-size: 1.25rem; }

/* ---------- Galerie ---------- */
.grille-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.carte-photo {
    background: var(--blanc);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--ombre);
}
.carte-photo img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    transition: transform 0.25s;
}
.carte-photo:hover img { transform: scale(1.04); }
.carte-photo figcaption { padding: 0.7rem 0.9rem 0.9rem; font-size: 0.88rem; }
.carte-photo .meta { display: block; color: #888; margin: 0.25rem 0; font-size: 0.8rem; }
.photo-description {
    display: block;
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px dashed #e0dcd2;
    color: #555;
    font-size: 0.83rem;
    line-height: 1.4;
}

/* ---------- Tableaux ---------- */.tableau {
    width: 100%;
    border-collapse: collapse;
    background: var(--blanc);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--ombre);
}
.tableau th, .tableau td { padding: 0.75rem 1rem; text-align: left; font-size: 0.92rem; }
.tableau thead { background: var(--bleu); color: #fff; }
.tableau tbody tr { border-top: 1px solid #eee; }

.actions-cell { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.form-suppr { display: inline-flex; gap: 0.4rem; align-items: center; }
.input-mini { padding: 0.3rem 0.5rem; border: 1px solid #ccc; border-radius: 6px; font-size: 0.8rem; width: 150px; }

/* ---------- Badges / alertes ---------- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    background: #eee;
}
.badge-admin { background: #fdeccd; color: #8a6d1a; }
.badge-famille { background: #d8e8fd; color: #1c4e8f; }
.badge-parrain { background: #dbf3dd; color: #1b6b2c; }
.badge-en_attente { background: #fdeccd; color: #8a6d1a; }
.badge-acceptee { background: #dbf3dd; color: #1b6b2c; }
.badge-refusee { background: #f8d7da; color: #8b1a1a; }

.alerte { padding: 0.9rem 1.1rem; border-radius: 10px; margin-bottom: 1rem; font-size: 0.95rem; }
.alerte-succes { background: #dbf3dd; color: #14521f; }
.alerte-erreur { background: #f8d7da; color: #7a1a1a; }

/* ---------- Divers ---------- */
.vide { color: #999; font-style: italic; padding: 1rem 0; }
.stats-grille {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.carte-stat {
    background: var(--blanc);
    border-left: 5px solid var(--or);
    border-radius: 12px;
    padding: 1.1rem 1.3rem;
    box-shadow: var(--ombre);
    font-size: 0.95rem;
    color: #666;
}
.stat-nb { display: block; font-size: 2rem; font-weight: 700; color: var(--bleu-fonce); }

.menu-admin { display: flex; gap: 0.7rem; flex-wrap: wrap; margin: 1.5rem 0; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .header-inner { flex-direction: column; align-items: flex-start; }
    .hero h1 { font-size: 1.6rem; }
    .tableau { display: block; overflow-x: auto; }
}