/**
 * Espace membre ADSB — styles.
 * Couleur principale : #004D1B (vert ADSB) — Couleur hover/accent : #77C043
 */

.adsb-espace-membre {
    --adsb-primary: #004D1B;
    --adsb-accent: #77C043;
    --adsb-bg-soft: #f4f7f4;
    --adsb-border: #d8e0d8;
    --adsb-text-muted: #5a6a5a;
    --adsb-danger: #b3261e;

    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 16px 64px;
    color: #1e2a1e;
    font-size: 16px;
    line-height: 1.5;
    min-height: 77vh;
}

.adsb-espace-membre h1 {
    color: var(--adsb-primary);
    margin-bottom: 24px;
}

.adsb-espace-membre h2 {
    color: var(--adsb-primary);
    border-bottom: 2px solid var(--adsb-accent);
    padding-bottom: 8px;
    margin-top: 40px;
    margin-bottom: 20px;
}

.adsb-espace-membre h3 {
    color: var(--adsb-primary);
    margin-top: 28px;
    margin-bottom: 12px;
}

/* --- Layout sidebar + contenu --- */
.adsb-layout {
    display: flex;
    align-items: flex-start;
    gap: 32px;
}

.adsb-tabs-nav {
    flex: 0 0 220px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--adsb-bg-soft);
    border: 1px solid var(--adsb-border);
    border-radius: 8px;
    padding: 8px;
    position: sticky;
    top: 108px;
    align-self: flex-start;
    max-height: calc(100vh - 40px);
}


body.admin-bar .adsb-tabs-nav {
    top: 140px; 
}

@media screen and (max-width: 782px) {
    body.admin-bar .adsb-tabs-nav {
        top: 66px;
    }
}

.adsb-tabs-nav .adsb-tab-link {
    text-align: left;
    background: transparent;
    border: none;
    color: var(--adsb-primary);
    font-weight: 600;
    font-size: 15px;
    padding: 12px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.adsb-tabs-nav .adsb-tab-link:hover,
.adsb-tabs-nav .adsb-tab-link:focus {
    background: var(--adsb-accent);
}

.adsb-tabs-nav .adsb-tab-link.is-active {
    background: var(--adsb-primary);
    color: #fff;
}

.adsb-tabs-nav .adsb-tab-link.is-active:hover,
.adsb-tabs-nav .adsb-tab-link.is-active:focus {
    background: var(--adsb-accent);
}

.adsb-tabs-content {
    flex: 1 1 auto;
    min-width: 0;
}

.adsb-tab-panel {
    display: none;
}

.adsb-tab-panel.is-active {
    display: block;
}


/* --- Notices (succès / info) --- */
.adsb-notice {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 24px;
    font-weight: 500;
}

.adsb-notice-success {
    background: #eef7ee;
    border-left: 4px solid var(--adsb-accent);
    color: var(--adsb-primary);
}

.adsb-notice-error {
    background: #fdecea;
    border-left: 4px solid var(--adsb-danger);
    color: var(--adsb-danger);
}

/* --- Formulaires --- */
.adsb-form p {
    margin-bottom: 18px;
}

.adsb-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--adsb-primary);
}

.adsb-form fieldset label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    color: #1e2a1e;
    margin-bottom: 4px;
}

.adsb-form input[type="text"],
.adsb-form input[type="email"],
.adsb-form input[type="password"],
.adsb-form input[type="tel"],
.adsb-form input[type="number"],
.adsb-form select,
.adsb-form textarea {
    width: 100%;
    /* max-width: 480px; */
    padding: 10px 12px;
    border: 1px solid var(--adsb-border);
    border-radius: 6px;
    font-size: 15px;
    background: #f5f6f4;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.adsb-form textarea {
    max-width: 100%;
    min-height: 90px;
    resize: vertical;
}

.adsb-form input:focus,
.adsb-form select:focus,
.adsb-form textarea:focus {
    outline: none;
    border-color: var(--adsb-accent);
    box-shadow: 0 0 0 3px rgba(119, 192, 67, 0.25);
}

.adsb-form fieldset {
    border: 1px solid var(--adsb-border);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.adsb-form legend {
    font-weight: 600;
    color: var(--adsb-primary);
    padding: 0 6px;
}

.adsb-form .description {
    display: block;
    font-weight: 400;
    color: var(--adsb-text-muted);
    font-size: 13px;
    margin-top: 4px;
}

.adsb-form h2 {
    color: var(--adsb-primary);
    margin-bottom: 6px;
}

.adsb-form__subtitle {
    font-size: 17px;
    font-weight: 500;
    color: var(--adsb-primary);
    margin-bottom: 14px;
}

.adsb-form__intro {
    font-size: 15px;
    line-height: 1.6;
    color: var(--adsb-text-muted);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--adsb-border);
}

.adsb-form__footer {
    font-size: 13px;
    line-height: 1.5;
    color: var(--adsb-text-muted);
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--adsb-border);
}

/* --- En-tête photo de profil + identité --- */
.adsb-form__header {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 32px;
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--adsb-border);
}

.adsb-form__photo {
    flex: 0 0 200px;
    text-align: center;
}

.adsb-form__photo label {
    margin-top: 10px;
}

.adsb-form__photo .adsb-photo-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.adsb-form__photo .adsb-photo-trigger {
    display: block;
    width: 120px;
    margin: 0 auto 8px;
    cursor: pointer;
}

.adsb-form__photo .adsb-photo-trigger .adsb-photo-preview {
    display: block;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--adsb-accent);
    box-shadow: 0 2px 8px rgba(0, 77, 27, 0.15);
    transition: opacity 0.15s ease, box-shadow 0.15s ease;
}

.adsb-form__photo .adsb-photo-trigger:hover .adsb-photo-preview {
    opacity: 0.85;
    box-shadow: 0 0 0 4px rgba(119, 192, 67, 0.35);
}

.adsb-form__photo .adsb-photo-trigger .adsb-photo-preview--empty {
    border-style: dashed;
    border-color: var(--adsb-accent);
}

.adsb-form__photo .adsb-photo-field-remove {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    color: var(--adsb-text-muted);
    margin-top: 8px;
}

.adsb-form__identity {
    flex: 1 1 260px;
    padding-top: 8px;
}

.adsb-form__identity p {
    margin-bottom: 8px;
}

/* --- Grille 2 colonnes --- */
.adsb-form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
    align-items: start;
}

.adsb-form__grid > .adsb-form__field,
.adsb-form__grid > .adsb-form__field--full {
    margin-bottom: 18px;
}

.adsb-form__grid > .adsb-form__field--full {
    grid-column: 1 / -1;
}

@media (max-width: 640px) {
    .adsb-form__grid {
        grid-template-columns: 1fr;
    }

    .adsb-form__header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* --- Bouton --- */
.adsb-form button[type="submit"] {
    background: var(--adsb-primary);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.adsb-form button[type="submit"]:hover,
.adsb-form button[type="submit"]:focus {
    background: var(--adsb-accent);
}

.adsb-form button[type="submit"]:active {
    transform: scale(0.98);
}

.adsb-form button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- Autocomplétion Commune --- */
.adsb-commune-field {
    position: relative;
    max-width: 480px;
}

.adsb-commune-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--adsb-border);
    border-top: none;
    border-radius: 0 0 6px 6px;
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 220px;
    overflow-y: auto;
    z-index: 20;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.adsb-commune-suggestions li {
    padding: 8px 12px;
    cursor: pointer;
}

.adsb-commune-suggestions li:hover,
.adsb-commune-suggestions li.is-active {
    background: var(--adsb-accent);
    color: #fff;
}

.adsb-commune-field.is-invalid input {
    border-color: var(--adsb-danger);
}

.adsb-commune-msg {
    display: none;
    font-size: 13px;
    color: var(--adsb-danger);
    margin-top: 6px;
    margin-bottom: 0;
}

.adsb-commune-field.is-invalid .adsb-commune-msg {
    display: block;
}

/* --- Liste "Mes bonnes pratiques" --- */
.adsb-mes-pratiques {
    list-style: none;
    margin: 0;
    padding: 0;
}

.adsb-mes-pratiques li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--adsb-bg-soft);
    border: 1px solid var(--adsb-border);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
}

.adsb-mes-pratiques a {
    color: var(--adsb-primary);
    font-weight: 600;
    text-decoration: none;
}

#adsb-nouvelle-pratique .adsb-form__footer a,
.adsb-mes-pratiques a:hover {
    color: var(--adsb-accent);
    text-decoration: underline;
}


/* --- Page de connexion --- */
.adsb-connexion {
    max-width: 420px;
    min-height: auto;
    margin: 64px auto;
    padding: 40px 32px;
    background: #fff;
    border: 1px solid var(--adsb-border);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.page-template-adsb-connexion .adsb-connexion h1 {
    text-align: center;
    font-size: 36px;
    margin-bottom: 28px;
}

.adsb-connexion .adsb-form input {
    max-width: 100%;
}

.adsb-connexion .adsb-form button[type="submit"] {
    width: 100%;
}

.adsb-connexion #adsb-toggle-lost-password {
    display: inline-block;
    color: var(--adsb-primary);
    font-size: 14px;
    text-decoration: none;
}

.adsb-connexion #adsb-toggle-lost-password:hover {
    color: var(--adsb-accent);
    text-decoration: underline;
}

/* --- Barre supérieure de l'espace membre (titre + déconnexion) --- */
.adsb-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.adsb-topbar h1 {
    margin-bottom: 0;
}

.adsb-logout-link {
    color: var(--adsb-primary);
    font-weight: 600;
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid var(--adsb-primary);
    border-radius: 6px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.adsb-logout-link:hover,
.adsb-logout-link:focus {
    background: var(--adsb-primary);
    color: #fff;
}

.adsb-login-links {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.adsb-login-links a {
    color: var(--adsb-primary);
    font-size: 14px;
    text-decoration: none;
}

.adsb-login-links a:hover {
    color: var(--adsb-accent);
    text-decoration: underline;
}


/* --- Responsive --- */
@media (max-width: 600px) {
    .adsb-connexion {
        margin: 24px 12px;
        padding: 28px 20px;
    }
    .adsb-espace-membre {
        padding: 20px 12px 48px;
    }

    .adsb-layout {
        flex-direction: column;
    }

    .adsb-tabs-nav {
        position: static;
        flex-direction: row;
        flex: 1 1 auto;
        width: 100%;
        overflow-x: auto;
    }

    .adsb-mes-pratiques li {
        flex-direction: column;
        align-items: flex-start;
    }
}