/* ============================================================
   associations/edit.css — Pages d'édition (admin asso)
   ============================================================ */

main {
    background: #e6e6e6;
}

.edit-page {
    padding: 30px 10px 60px;
}

.edit-page .container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── En-tête ────────────────────────────────────────────────── */
.edit-page__header {
    margin-bottom: 24px;
}

.back-link {
    display: inline-block;
    font-size: 0.88rem;
    color: #555;
    text-decoration: none;
    margin-bottom: 8px;
    transition: color 0.15s;
}

.back-link:hover { color: #379CD0; }

.edit-page__header h2 {
    font-size: 1.8rem;
    color: #222;
    margin: 0;
}

.edit-page__asso-name { color: #379CD0; }

.edit-page__hint {
    margin-top: 6px;
    color: #666;
    font-size: 0.9rem;
}

/* ── Onglets ────────────────────────────────────────────────── */
.edit-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
    overflow-x: auto;
    scrollbar-width: none;
}

.edit-tabs::-webkit-scrollbar { display: none; }

.edit-tab {
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #555;
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
}

.edit-tab:hover { color: #379CD0; }

.edit-tab--active {
    color: #379CD0;
    border-bottom-color: #379CD0;
    font-weight: 700;
}

/* ── Panneau ────────────────────────────────────────────────── */
.edit-panel {
    background: #fff;
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.edit-panel__title {
    font-size: 1.3rem;
    color: #379CD0;
    margin-bottom: 20px;
}

/* ── Formulaires ────────────────────────────────────────────── */
.edit-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group--error input,
.form-group--error select,
.form-group--error textarea { border-color: #e53935 !important; }

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    padding: 9px 12px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.15s;
    width: 100%;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #379CD0;
    box-shadow: 0 0 0 3px rgba(55,156,208,0.12);
}

.form-hint {
    font-size: 0.78rem;
    color: #888;
    margin: 0;
}

.form-errors {
    list-style: none;
    padding: 0;
    font-size: 0.8rem;
    color: #e53935;
}

/* ── Fieldsets ──────────────────────────────────────────────── */
.edit-fieldset {
    border: 1.5px solid #eee;
    border-radius: 10px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.edit-fieldset legend {
    padding: 0 8px;
    font-weight: 700;
    font-size: 0.88rem;
    color: #444;
}

/* ── Couleurs ───────────────────────────────────────────────── */
.colors-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.color-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-input-row input[type="color"] {
    width: 48px !important;
    height: 38px !important;
    padding: 2px !important;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
}

.color-hex {
    font-size: 0.82rem;
    color: #888;
    font-family: monospace;
}

/* ── Media preview ──────────────────────────────────────────── */
.current-media img {
    max-height: 100px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
    margin-bottom: 4px;
}

.media-preview {
    margin-top: 24px;
    padding: 20px;
    background: #f8f8f8;
    border-radius: 10px;
}

.media-preview__title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 12px;
}

.media-preview__header {
    height: 80px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
}

/* ── Actions ────────────────────────────────────────────────── */
.form-actions { margin-top: 6px; }

.btn-save {
    padding: 10px 28px;
    background: #379CD0;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s;
}

.btn-save:hover { background: #2a7db0; }

/* ── Formsets ───────────────────────────────────────────────── */
.formset-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.formset-row {
    padding: 16px;
    border: 1.5px solid #eee;
    border-radius: 10px;
    background: #fafafa;
}

.formset-row--existing {
    border-color: #379CD0;
    background: #f0f8fd;
}

.formset-row__title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #444;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.btn-tree-edit {
    display: inline-block;
    padding: 4px 12px;
    background: #379CD0;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: background 0.15s;
}

.btn-tree-edit:hover { background: #2a7db0; }

.formset-row__fields {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.formset-row__fields .form-group {
    flex: 1;
    min-width: 180px;
}

.form-group--delete {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.delete-label {
    font-size: 0.85rem;
    color: #e53935;
    cursor: pointer;
}
