/* WP Guest Form - Formulaire invités */
.wgf-form-wrapper,
.wgf-retrieve-wrapper {
    max-width: 600px;
    margin: 1em 0;
}

.wgf-form .wgf-field,
.wgf-retrieve-form .wgf-field {
    margin-bottom: 1em;
}

.wgf-form label,
.wgf-retrieve-form label {
    display: block;
    margin-bottom: 0.25em;
    font-weight: 600;
}

.wgf-form input[type="text"],
.wgf-form input[type="email"],
.wgf-form input[type="date"],
.wgf-form input[type="number"],
.wgf-form select,
.wgf-form textarea,
.wgf-retrieve-form input[type="text"],
.wgf-retrieve-form input[type="email"],
.wgf-retrieve-form input[type="date"] {
    width: 100%;
    padding: 0.5em;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* ——— Section Enfants ——— */
.wgf-children-section {
    margin: 1.75em 0;
    padding: 1.5em;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.wgf-children-title {
    margin: 0 0 1.25em;
    font-size: 1.1em;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.02em;
}

.wgf-children-list {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

/* Carte par enfant : mode résumé ou édition */
.wgf-child-row {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.wgf-child-row.wgf-child-genre-fille .wgf-child-summary-prenom {
    color: #f59e1f;
}

.wgf-child-row.wgf-child-genre-garcon .wgf-child-summary-prenom {
    color: #477b7b;
}

.wgf-child-summary[aria-hidden="true"],
.wgf-child-edit-block[aria-hidden="true"] {
    display: none !important;
}

/* Ligne récap compacte */
.wgf-child-summary {
    display: flex;
    align-items: center;
    gap: 0.75em 1em;
    padding: 0.6em 1em;
    flex-wrap: wrap;
}

.wgf-child-summary-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.6em 1em;
    flex-wrap: wrap;
    font-size: 0.9em;
    color: #334155;
}

.wgf-child-summary-content span {
    white-space: nowrap;
}

.wgf-child-summary-genre {
    font-weight: 600;
    color: #475569;
}

.wgf-child-summary-prenom {
    font-weight: 600;
    color: #0ea5e9;
}

.wgf-child-summary-age,
.wgf-child-summary-prise {
    color: #64748b;
}

.wgf-child-summary-prise::before {
    content: '•';
    margin-right: 0.5em;
    color: #cbd5e1;
}

.wgf-child-summary-infos {
    color: #64748b;
    font-size: 0.9em;
}

.wgf-child-summary-infos:not(:empty)::before {
    content: '— ';
    color: #cbd5e1;
}

.wgf-child-summary-actions {
    display: flex;
    align-items: center;
    gap: 0.25em;
    flex-shrink: 0;
}

.wgf-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.wgf-btn-icon:hover {
    background: #f8fafc;
    color: #0ea5e9;
    border-color: #bae6fd;
}

.wgf-btn-delete:hover {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}

.wgf-icon {
    flex-shrink: 0;
}

/* ——— Cartes enfant (affichage récap / animateur) ——— même design que le formulaire */
.wgf-age-group-block {
    margin-bottom: 1.25em;
}

.wgf-age-group-block:last-child {
    margin-bottom: 0;
}

.wgf-age-group-title {
    margin: 0 0 0.5em;
    font-size: 0.95em;
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.02em;
}

.wgf-children-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
    margin-top: 0.5em;
}

.wgf-child-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 10px;
}

.wgf-child-card.wgf-child-genre-fille .wgf-child-summary-prenom {
    color: #f59e1f;
}

.wgf-child-card.wgf-child-genre-garcon .wgf-child-summary-prenom {
    color: #477b7b;
}

.wgf-child-card-inner {
    display: flex;
    align-items: center;
    gap: 0.75em 1em;
    padding: 0.6em 1em;
    flex-wrap: wrap;
}

.wgf-child-card-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.6em 1em;
    flex-wrap: wrap;
    font-size: 0.9em;
    color: #334155;
}

.wgf-child-card-content .wgf-child-summary-genre,
.wgf-child-card-content .wgf-child-summary-prenom,
.wgf-child-card-content .wgf-child-summary-age,
.wgf-child-card-content .wgf-child-summary-prise,
.wgf-child-card-content .wgf-child-summary-infos {
    white-space: nowrap;
}

.wgf-child-card-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

@media (max-width: 520px) {
    .wgf-child-card-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5em;
    }

    .wgf-child-card-content {
        flex-wrap: wrap;
    }

    .wgf-child-card-actions {
        justify-content: flex-end;
        padding-top: 0.25em;
        border-top: 1px solid #f1f5f9;
    }
}

/* Bloc édition */
.wgf-child-edit-title {
    margin: 0 1.25em 0.5em;
    padding-top: 1em;
    font-size: 0.9em;
    font-weight: 600;
    color: #475569;
}

.wgf-child-edit-title .wgf-child-row-num {
    color: #0ea5e9;
}

.wgf-child-edit-block .wgf-child-fields {
    padding: 0 1.25em 1.25em;
    display: flex;
    flex-direction: column;
    gap: 1.1em;
}

/* Ligne identité : Genre, Prénom, Âge — alignement propre */
.wgf-child-row-identity {
    display: grid;
    grid-template-columns: 100px 1fr 200px;
    gap: 1em 1.25em;
    align-items: end;
}

@media (max-width: 520px) {
    .wgf-child-row-identity {
        grid-template-columns: 1fr;
    }
}

.wgf-child-row .wgf-child-field {
    margin: 0;
    min-width: 0;
}

.wgf-child-row .wgf-child-field label {
    display: block;
    margin-bottom: 0.35em;
    font-size: 0.875em;
    font-weight: 600;
    color: #475569;
}

.wgf-child-row .wgf-child-field input,
.wgf-child-row .wgf-child-field select {
    width: 100%;
    padding: 0.5em 0.65em;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95em;
    box-sizing: border-box;
    background: #fff;
}

.wgf-child-row .wgf-child-field input:focus,
.wgf-child-row .wgf-child-field select:focus {
    border-color: #0ea5e9;
    outline: none;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.wgf-child-genre { min-width: 0; }
.wgf-child-prenom { min-width: 0; }
.wgf-child-age { min-width: 0; }

/* Âge : ans + mois */
.wgf-child-age .wgf-age-inputs {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
}

.wgf-child-age .wgf-age-inputs input {
    width: 3.2em;
    min-width: 3.2em;
    text-align: center;
    padding: 0.5em 0.35em;
}

.wgf-age-sep {
    font-size: 0.85em;
    color: #64748b;
}

.wgf-field-hint {
    display: block;
    font-size: 0.75em;
    color: #94a3b8;
    margin-top: 0.35em;
}

/* Ligne détails : Informations complémentaires puis Prise en charge, chacune sur une ligne entière */
.wgf-child-row-details {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.wgf-child-infos,
.wgf-child-prise {
    width: 100%;
    min-width: 0;
}

.wgf-child-infos input {
    min-width: 0;
}

.wgf-child-edit-actions {
    display: flex;
    align-items: center;
    gap: 0.75em;
    padding: 0 1.25em 1.25em;
    flex-wrap: wrap;
}

.wgf-btn-validate {
    padding: 0.5em 1em;
    border: 1px solid #0ea5e9;
    background: #0ea5e9;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
}

.wgf-btn-validate:hover {
    background: #0284c7;
    border-color: #0284c7;
}

.wgf-btn-remove-inline {
    padding: 0.5em 0.75em;
    border: 1px solid #e2e8f0;
    background: transparent;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
}

.wgf-btn-remove-inline:hover {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}

/* Bouton Retirer (legacy / fallback) */
.wgf-btn-remove {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.4em 0.75em;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.wgf-btn-remove:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.wgf-btn-remove-icon {
    font-size: 1.15em;
    line-height: 1;
    opacity: 0.9;
}

.wgf-btn-remove-text {
    display: none;
}

@media (min-width: 480px) {
    .wgf-btn-remove-text {
        display: inline;
    }
}

/* Bouton Ajouter un enfant */
.wgf-btn-add {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    margin-top: 0.75em;
    padding: 0.6em 1.2em;
    border: 1px dashed #94a3b8;
    background: #fff;
    color: #475569;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.wgf-btn-add:hover {
    background: #f1f5f9;
    border-color: #0ea5e9;
    color: #0ea5e9;
}

/* Bouton Envoyer */
.wgf-btn-add,
.wgf-btn-submit {
    padding: 0.6em 1.2em;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
}

.wgf-btn-submit {
    border: 1px solid #0073aa;
    background: #0073aa;
    color: #fff;
}

.wgf-btn-submit:hover {
    opacity: 0.92;
}

.wgf-actions {
    margin-top: 1.5em;
}

.wgf-actions .wgf-btn-submit {
    width: 100%;
    display: block;
    box-sizing: border-box;
}

.wgf-message {
    margin: 1em 0;
    padding: 0.75em;
    border-radius: 4px;
    display: none;
}

.wgf-message-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.wgf-message-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.required {
    color: #c00;
}

/* Récap (lecture seule) */
.wgf-recap {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
}

.wgf-recap-title {
    margin: 0 0 1.25em;
    font-size: 1.75em;
    font-weight: 700;
    line-height: 1.3;
}

.wgf-recap-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 1.25em 1.5em;
    margin-bottom: 1.25em;
    border: 1px solid #e8e8e8;
}

.wgf-recap-main .wgf-recap-line {
    margin: 0.35em 0;
    font-size: 1em;
}

.wgf-recap-subtitle {
    margin: 0 0 0.75em;
    font-size: 1.1em;
    font-weight: 600;
}

.wgf-age-totals .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.wgf-recap-age-totals.wgf-age-totals {
    margin: 0 0 1.25em;
    padding: 0.85em 1em;
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    font-size: 0.95em;
    color: #333;
}

.wgf-recap-age-totals .wgf-age-totals-heading {
    margin: 0 0 0.65em;
    font-weight: 600;
    font-size: 0.95em;
    color: #222;
}

.wgf-recap-age-totals .wgf-age-totals-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.wgf-recap-age-totals .wgf-age-totals-table {
    width: 100%;
    min-width: 420px;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.wgf-recap-age-totals .wgf-age-totals-table thead th {
    padding: 0.5em 0.65em;
    text-align: center;
    font-weight: 600;
    font-size: 0.88em;
    background: #eee;
    border-bottom: 1px solid #ddd;
}

.wgf-recap-age-totals .wgf-age-totals-table thead th.wgf-age-totals-corner {
    width: 5.5em;
    min-width: 5.5em;
    background: #f5f5f5;
}

.wgf-recap-age-totals .wgf-age-totals-table .wgf-age-totals-col-total {
    background: #e3f2fd;
    font-weight: 700;
}

.wgf-recap-age-totals .wgf-age-totals-table tbody th {
    padding: 0.5em 0.65em;
    text-align: left;
    font-weight: 600;
    background: #fafafa;
    border-right: 1px solid #e8e8e8;
    white-space: nowrap;
}

.wgf-recap-age-totals .wgf-age-totals-table tbody td {
    padding: 0.5em 0.65em;
    text-align: center;
    border-top: 1px solid #eee;
}

.wgf-recap-age-totals .wgf-age-totals-table tbody td.wgf-age-totals-col-total {
    background: #f5f9ff;
    font-weight: 700;
}

.wgf-recap-note .wgf-note-content {
    margin: 0;
    line-height: 1.5;
}

.wgf-recap-table-wrap {
    overflow-x: auto;
    margin-top: 0.5em;
}

.wgf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.wgf-table th,
.wgf-table td {
    border: 1px solid #e8e8e8;
    padding: 0.6em 0.85em;
    text-align: left;
}

.wgf-table th {
    background: #f7f7f7;
    font-weight: 600;
}

.wgf-table tbody tr:nth-child(even) {
    background: #fafafa;
}

/* Mobile : tableau enfants récap en cartes */
@media (max-width: 640px) {
    .wgf-recap-table-wrap {
        overflow-x: visible;
    }

    .wgf-recap .wgf-table thead {
        display: none;
    }

    .wgf-recap .wgf-table tbody tr {
        display: block;
        margin-bottom: 1em;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        overflow: hidden;
        background: #fff;
    }

    .wgf-recap .wgf-table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5em;
        padding: 0.55em 0.75em;
        border-bottom: 1px solid #f1f5f9;
    }

    .wgf-recap .wgf-table tbody td:last-child {
        border-bottom: none;
    }

    .wgf-recap .wgf-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.85em;
        color: #64748b;
        flex-shrink: 0;
    }

    .wgf-recap .wgf-table tbody tr:nth-child(even) {
        background: #fafafa;
    }

    .wgf-recap .wgf-table tbody tr:nth-child(even) td {
        background: #fafafa;
    }
}

.wgf-badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 500;
}

.wgf-badge-present {
    background: #d4edda;
    color: #155724;
}

.wgf-badge-absent {
    background: #f8d7da;
    color: #721c24;
}

/* Liste des demandes de modification (page client) */
.wgf-recap-modifications {
    margin-top: 1em;
}

.wgf-recap-request-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wgf-recap-request-item {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-bottom: 0.75em;
    overflow: hidden;
    background: #fafafa;
}

.wgf-recap-request-item:last-child {
    margin-bottom: 0;
}

.wgf-recap-request-item.wgf-recap-request-pending {
    border-left: 4px solid #d97706;
    background: #fffbeb;
}

.wgf-recap-request-item.wgf-recap-request-applied {
    border-left: 4px solid #059669;
}

.wgf-recap-request-item.wgf-recap-request-refused {
    border-left: 4px solid #dc2626;
}

.wgf-recap-request-head {
    display: flex;
    align-items: center;
    gap: 0.75em;
    padding: 0.5em 0.85em;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.9em;
}

.wgf-recap-request-head time {
    font-weight: 600;
    color: #374151;
}

.wgf-recap-request-badge {
    display: inline-block;
    padding: 0.2em 0.5em;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.wgf-recap-request-pending .wgf-recap-request-badge {
    background: #fef3c7;
    color: #92400e;
}

.wgf-recap-request-applied .wgf-recap-request-badge {
    background: #d1fae5;
    color: #065f46;
}

.wgf-recap-request-refused .wgf-recap-request-badge {
    background: #fee2e2;
    color: #991b1b;
}

.wgf-recap-request-body {
    padding: 0.75em 1em;
    font-size: 0.95em;
    line-height: 1.5;
    color: #1f2937;
}

.wgf-recap-actions {
    margin-top: 1.5em;
}

.wgf-btn-modification {
    padding: 0.65em 1.35em;
    border: none;
    background: #0073aa;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
}

.wgf-btn-modification:hover {
    background: #005a87;
}

.wgf-recap-empty {
    padding: 2em;
    text-align: center;
    color: #666;
}

.wgf-recap-empty p {
    margin: 0;
}

/* Popup demande modification (centré sur la page) */
.wgf-modification-popup {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1em;
    box-sizing: border-box;
}

.wgf-modification-inner {
    position: relative;
    background: #fff;
    padding: 1.5em;
    border-radius: 8px;
    max-width: 500px;
    width: 100%;
    max-height: calc(100vh - 2em);
    overflow: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.wgf-modification-inner textarea {
    width: 100%;
    margin: 0.75em 0;
    padding: 0.5em;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.wgf-popup-actions {
    display: flex;
    gap: 0.5em;
    margin-top: 1em;
}

.wgf-popup-actions .wgf-btn {
    padding: 0.5em 1em;
    cursor: pointer;
    border-radius: 4px;
}
