/* ==========================================================================
   rcf-common.css — Design system partagé par tous les plugins RCF
   Hébergé par rcf-members (toujours actif), chargé en dépendance.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Variables CSS
   -------------------------------------------------------------------------- */

:root {
    --rcf-blue: #034671;
    --rcf-blue-dark: #1a3a5c;
    --rcf-blue-darker: #022d4a;
    --rcf-blue-light: #0560a0;
    --rcf-blue-hover-dark: #005f8a;
    --rcf-blue-pale: #e3f0fa;
    --rcf-blue-hover: #d3e7f6;
    --rcf-gold: #c5a54e;
    --rcf-text: #1a1a1a;
    --rcf-text-light: #555;
    --rcf-text-muted: #888;
    --rcf-border: #ddd;
    --rcf-border-light: #f0f0f0;
    --rcf-bg: #f8f9fa;
    --rcf-bg-light: #f0f0f0;
    --rcf-white: #fff;
    --rcf-danger: #c0392b;
    --rcf-danger-light: #fdecea;
    --rcf-danger-wp: #d63638;
    --rcf-success-bg: #d4edda;
    --rcf-success-text: #155724;
    --rcf-warning-bg: #fff3cd;
    --rcf-warning-text: #856404;
    --rcf-error-bg: #f8d7da;
    --rcf-error-text: #721c24;
    --rcf-neutral-bg: #e9ecef;
    --rcf-neutral-text: #6c757d;
    --rcf-radius: 8px;
    --rcf-radius-sm: 4px;
    --rcf-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --rcf-shadow-hover: 0 4px 12px rgba(0,0,0,0.1);
    --rcf-shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
}

/* --------------------------------------------------------------------------
   Box-sizing
   -------------------------------------------------------------------------- */

[class^="rcf-"],
[class^="rcf-"] *,
[class^="rcf-"] *::before,
[class^="rcf-"] *::after {
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Page title  .rcf-page-title
   -------------------------------------------------------------------------- */

h2.rcf-page-title {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: var(--rcf-blue) !important;
    margin: 0 0 30px 0 !important;
    text-align: center;
    line-height: 1em;
    font-family: Helvetica, Arial, sans-serif;
}
.rcf-page-subtitle {
    text-align: center;
    color: var(--rcf-text-light);
    margin: -22px 0 30px 0 !important;
}

/* --------------------------------------------------------------------------
   Buttons  .rcf-btn
   -------------------------------------------------------------------------- */

.rcf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 0.8em;
    font-family: inherit;
    font-size: 0.9em;
    font-weight: 500;
    line-height: 34px;
    text-decoration: none;
    border: 1px solid var(--rcf-border);
    border-radius: 3px;
    background: var(--rcf-white);
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-sizing: border-box;
    margin: 0;
    outline: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}

/* Supprimer le padding interne des <button> (Firefox) */
.rcf-btn::-moz-focus-inner {
    padding: 0;
    border: 0;
}

.rcf-btn:hover {
    background-color: #f0f0f0;
    text-decoration: none;
}

.rcf-btn:focus {
    outline: none;
    box-shadow: none;
}

.rcf-btn--primary,
.rcf-btn--primary:focus,
a.rcf-btn--primary,
a.rcf-btn--primary:focus,
a.rcf-btn--primary:visited {
    background: var(--rcf-blue);
    border-color: var(--rcf-blue);
    color: #fff !important;
}

.rcf-btn--primary:hover,
a.rcf-btn--primary:hover {
    background: var(--rcf-blue-hover-dark);
    border-color: var(--rcf-blue-hover-dark);
    color: #fff !important;
}

.rcf-btn--secondary,
.rcf-btn--secondary:focus,
a.rcf-btn--secondary,
a.rcf-btn--secondary:focus,
a.rcf-btn--secondary:visited {
    background: var(--rcf-white);
    border-color: var(--rcf-border);
    color: #333 !important;
}

.rcf-btn.active,
.rcf-btn.active:focus {
    background: var(--rcf-blue);
    color: var(--rcf-white);
    border-color: var(--rcf-blue);
}

.rcf-btn.active:hover {
    background: var(--rcf-blue-hover-dark);
    border-color: var(--rcf-blue-hover-dark);
    color: var(--rcf-white);
}

.rcf-btn--danger,
.rcf-btn--danger:focus {
    background: var(--rcf-danger-wp);
    border-color: var(--rcf-danger-wp);
    color: var(--rcf-white);
}

.rcf-btn--danger:hover {
    background: #b32d2e;
    border-color: #b32d2e;
    color: var(--rcf-white);
}

.rcf-btn--danger.rcf-btn--outline {
    background: transparent;
    color: var(--rcf-danger-wp);
}
.rcf-btn--danger.rcf-btn--outline:hover {
    background: var(--rcf-danger-wp);
    color: var(--rcf-white);
}

.rcf-btn--small {
    padding: 0 0.6em;
    font-size: 13px;
    height: 28px;
    line-height: 28px;
}

.rcf-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Inputs  .rcf-input
   -------------------------------------------------------------------------- */

.rcf-input {
    height: 34px;
    padding: 0 0.8em;
    font-size: 0.9em;
    line-height: 34px;
    border: 1px solid var(--rcf-border);
    border-radius: 3px;
    background: var(--rcf-white);
    color: #333;
    box-sizing: border-box;
    margin: 0;
    transition: border-color 0.2s;
}

.rcf-input:focus {
    border-color: var(--rcf-blue);
    outline: none;
    box-shadow: none;
}

/* --------------------------------------------------------------------------
   Selects custom  .rcf-select
   -------------------------------------------------------------------------- */

.rcf-select {
    appearance: none;
    -webkit-appearance: none;
    height: 34px;
    padding: 0 26px 0 0.8em;
    font-size: 0.9em;
    line-height: 34px;
    border: 1px solid var(--rcf-border);
    border-radius: 3px;
    background: var(--rcf-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23034671'/%3E%3C/svg%3E") no-repeat right 8px center;
    color: #333;
    cursor: pointer;
    box-sizing: border-box;
    min-width: 0;
    max-width: 220px;
    transition: border-color 0.2s;
}

.rcf-select:focus {
    outline: none;
    border-color: var(--rcf-blue);
}

.rcf-select.rcf-select--active {
    background-color: var(--rcf-blue);
    color: var(--rcf-white);
    border-color: var(--rcf-blue);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='white'/%3E%3C/svg%3E");
}

.rcf-select.rcf-select--active:hover {
    background-color: var(--rcf-blue-hover-dark);
    border-color: var(--rcf-blue-hover-dark);
    color: var(--rcf-white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='white'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Export button  .rcf-export-btn
   -------------------------------------------------------------------------- */

.rcf-export-btn {
    white-space: nowrap;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Tags  .rcf-tag
   -------------------------------------------------------------------------- */

.rcf-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.82em;
    font-weight: 600;
    line-height: 1.4;
    background: var(--rcf-text-light);
    color: var(--rcf-white);
}

/* --------------------------------------------------------------------------
   Notices  .rcf-notice
   -------------------------------------------------------------------------- */

.rcf-notice {
    padding: 12px 16px;
    border-radius: var(--rcf-radius);
    font-size: 14px;
    margin: 12px 0;
}

.rcf-notice-success {
    background: var(--rcf-blue-pale);
    color: var(--rcf-blue);
    border: 1px solid var(--rcf-blue);
}

.rcf-notice-error {
    background: var(--rcf-danger-light);
    color: var(--rcf-danger);
    border: 1px solid var(--rcf-danger);
}

.rcf-notice-warning {
    background: #fff8e1;
    color: var(--rcf-warning-text);
    border: 1px solid #ffc107;
}

.rcf-notice a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Details table  .rcf-details-table
   -------------------------------------------------------------------------- */

.rcf-details-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.rcf-details-table th,
.rcf-details-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--rcf-border);
    font-size: 15px;
    vertical-align: top;
}

.rcf-details-table th {
    font-weight: 600;
    color: var(--rcf-text);
    width: 180px;
    background: var(--rcf-bg);
    white-space: nowrap;
}

.rcf-details-table td {
    color: var(--rcf-text-light);
}

.rcf-details-table a {
    color: var(--rcf-blue);
}

/* --------------------------------------------------------------------------
   Loading  .rcf-loading / .rcf-spinner
   -------------------------------------------------------------------------- */

.rcf-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    color: var(--rcf-text-light);
    font-size: 14px;
}

.rcf-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid var(--rcf-border);
    border-top-color: var(--rcf-blue);
    border-radius: 50%;
    animation: rcf-spin 0.7s linear infinite;
}

@keyframes rcf-spin {
    to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Pagination  .rcf-pagination
   -------------------------------------------------------------------------- */

.rcf-pagination {
    display: flex;
    width: 100%;
    gap: 0.3em;
    align-items: stretch;
    margin-top: 1em;
}

.rcf-pagination .rcf-btn {
    flex: 1 1 0;
    min-width: 0;
}

.rcf-pagination__nav {
    flex: none !important;
    min-width: 7em;
}

.rcf-pagination__ellipsis {
    cursor: pointer;
}

.rcf-pagination .rcf-btn.active,
.rcf-pagination .rcf-btn.active:hover {
    background: var(--rcf-blue);
    color: #fff;
    border-color: var(--rcf-blue);
}

.rcf-pagination .disabled {
    opacity: 0.4;
    pointer-events: none;
}

@media (max-width: 600px) {
    .rcf-pagination {
        gap: 0.2em;
        font-size: 0.85em;
    }
    .rcf-pagination .rcf-btn {
        padding-left: 0.3em;
        padding-right: 0.3em;
    }
    .rcf-pagination__nav {
        min-width: 0;
    }
}

/* --------------------------------------------------------------------------
   Responsive — details table
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .rcf-details-table th {
        width: 100px;
    }
}

@media (max-width: 600px) {
    .rcf-details-table th,
    .rcf-details-table td {
        display: block;
        width: 100%;
    }

    .rcf-details-table th {
        border-bottom: none;
        padding-bottom: 2px;
    }

    .rcf-details-table td {
        padding-top: 2px;
    }
}

/* --------------------------------------------------------------------------
   Aide contextuelle
   -------------------------------------------------------------------------- */

.rcf-contextual-help {
    margin-bottom: 16px;
    border: 1px solid var(--rcf-border);
    border-radius: var(--rcf-radius);
    background: var(--rcf-white);
    overflow: hidden;
}

.rcf-contextual-help summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--rcf-blue);
    background: var(--rcf-blue-pale);
    user-select: none;
    transition: background 0.2s;
}

.rcf-contextual-help summary:hover {
    background: #d3e7f6;
}

.rcf-contextual-help summary::-webkit-details-marker { display: none; }
.rcf-contextual-help summary::marker { display: none; content: ''; }

.rcf-contextual-help__icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.rcf-contextual-help__chevron {
    margin-left: auto;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    transition: transform 0.25s ease;
}

.rcf-contextual-help[open] .rcf-contextual-help__chevron {
    transform: rotate(180deg);
}

.rcf-contextual-help__body {
    padding: 14px 18px;
    border-top: 1px solid var(--rcf-border);
}

.rcf-contextual-help__body ul {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.rcf-contextual-help__body li {
    position: relative;
    padding: 5px 0 5px 18px !important;
    margin: 0 !important;
    font-size: 13px;
    line-height: 1.5;
    color: var(--rcf-text-light);
    list-style: none !important;
}

.rcf-contextual-help__body li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--rcf-blue);
    opacity: 0.35;
}

.rcf-contextual-help__body li strong {
    color: var(--rcf-text);
    font-weight: 600;
}

.rcf-contextual-help__body li + li {
    border-top: 1px solid var(--rcf-border-light);
}

/* --------------------------------------------------------------------------
   Collapsible panel  .rcf-collapsible
   Même apparence que l'aide contextuelle, pour envelopper des formulaires.
   -------------------------------------------------------------------------- */

.rcf-collapsible {
    margin-bottom: 16px;
    border: 1px solid var(--rcf-border);
    border-radius: var(--rcf-radius);
    background: var(--rcf-white);
    overflow: hidden;
}

.rcf-collapsible > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--rcf-blue);
    background: var(--rcf-blue-pale);
    user-select: none;
    transition: background 0.2s;
}

.rcf-collapsible > summary:hover {
    background: #d3e7f6;
}

.rcf-collapsible > summary::-webkit-details-marker { display: none; }
.rcf-collapsible > summary::marker { display: none; content: ''; }

.rcf-collapsible__chevron {
    margin-left: auto;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    transition: transform 0.25s ease;
}

.rcf-collapsible[open] .rcf-collapsible__chevron {
    transform: rotate(180deg);
}

.rcf-collapsible__body {
    padding: 18px;
    border-top: 1px solid var(--rcf-border);
}

@media (max-width: 600px) {
    .rcf-collapsible > summary {
        padding: 8px 12px;
        font-size: 13px;
    }
    .rcf-collapsible__body {
        padding: 12px;
    }
}

@media (max-width: 600px) {
    .rcf-contextual-help summary {
        padding: 8px 12px;
        font-size: 12px;
    }
    .rcf-contextual-help__body {
        padding: 10px 12px;
    }
    .rcf-contextual-help__body li {
        font-size: 12px;
    }
}

/* --------------------------------------------------------------------------
   Badges de statut
   -------------------------------------------------------------------------- */

.rcf-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    background: var(--rcf-neutral-bg);
    color: var(--rcf-neutral-text);
}

.rcf-badge--success,
.rcf-badge--paid,
.rcf-badge--high  { background: var(--rcf-success-bg); color: var(--rcf-success-text); }

.rcf-badge--warning,
.rcf-badge--pending,
.rcf-badge--medium { background: var(--rcf-warning-bg); color: var(--rcf-warning-text); }

.rcf-badge--error,
.rcf-badge--failed,
.rcf-badge--low    { background: var(--rcf-error-bg);   color: var(--rcf-error-text); }

.rcf-badge--expired,
.rcf-badge--neutral,
.rcf-badge--none   { background: var(--rcf-neutral-bg); color: var(--rcf-neutral-text); }

/* --------------------------------------------------------------------------
   Barres de progression
   -------------------------------------------------------------------------- */

.rcf-progress {
    margin: 16px 0;
}

.rcf-progress__bar {
    height: 24px;
    background: #e0e0e0;
    border-radius: var(--rcf-radius-sm);
    overflow: hidden;
}

.rcf-progress__fill {
    height: 100%;
    width: 0;
    background: var(--rcf-blue);
    border-radius: var(--rcf-radius-sm);
    transition: width 0.3s ease;
}

.rcf-progress__text {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

/* --------------------------------------------------------------------------
   Dropdowns autocomplete
   -------------------------------------------------------------------------- */

.rcf-dropdown {
    position: absolute;
    z-index: 100;
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: var(--rcf-white);
    border: 1px solid var(--rcf-border);
    border-radius: 6px;
    box-shadow: var(--rcf-shadow-lg);
    margin-top: 2px;
}

.rcf-dropdown:empty {
    display: none;
}

.rcf-dropdown__item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.5;
    border-bottom: 1px solid var(--rcf-border-light);
    transition: background 0.15s;
}

.rcf-dropdown__item:last-child {
    border-bottom: none;
}

.rcf-dropdown__item:hover {
    background: var(--rcf-blue-pale);
}

.rcf-dropdown__item--empty {
    cursor: default;
    color: #999;
    font-style: italic;
}

.rcf-dropdown__item--empty:hover {
    background: transparent;
}

.rcf-dropdown__num {
    color: var(--rcf-text-muted);
    font-size: 12px;
}

/* --------------------------------------------------------------------------
   Onglets réutilisables
   -------------------------------------------------------------------------- */

.rcf-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--rcf-blue);
    margin-bottom: 1.5em;
}

.rcf-tab {
    padding: 10px 24px;
    border: none;
    background: var(--rcf-border-light);
    color: var(--rcf-text-light);
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    margin-right: 2px;
    transition: background 0.2s, color 0.2s;
}

.rcf-tab:hover {
    background: #e0e8ef;
    color: var(--rcf-blue);
}

.rcf-tab--active {
    background: var(--rcf-blue);
    color: #fff;
}

/* Dans la gestion des adhésions, les onglets occupent toute la largeur. */
.rcf-membership-admin-wrap .rcf-tabs {
    width: 100%;
}
.rcf-membership-admin-wrap .rcf-tabs .rcf-tab {
    flex: 1 1 0;
    min-width: 0;
    padding-left: 6px;
    padding-right: 6px;
    text-align: center;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .rcf-membership-admin-wrap .rcf-tabs {
        flex-wrap: wrap;
    }
    .rcf-membership-admin-wrap .rcf-tabs .rcf-tab {
        flex: 1 1 50%;
        padding: 8px 10px;
        font-size: 0.85em;
        white-space: normal;
    }
}

.rcf-tab--active:hover {
    background: var(--rcf-blue);
    color: #fff;
}

.rcf-tab-content {
    display: none;
}

.rcf-tab-content--active {
    display: block;
}

/* Astérisque champ obligatoire */
.required {
    color: var(--rcf-text);
}
