﻿:root {
    --oas-primary:  #28b51b;
    --oas-primary-h:#c0271a;
    --oas-text:     #1a1a1a;
    --oas-muted:    #666;
    --oas-border:   #ddd;
    --oas-bg:       #f4f5f7;
    --oas-card-bg:  #fff;
    --oas-radius:   10px;
    --oas-shadow:   0 2px 12px rgba(0,0,0,.08);
    --oas-success:  #1a7f4b;
    --oas-success-bg:#e6f5ed;
    --oas-error:    #b91c1c;
    --oas-error-bg: #fce8e8;
    --oas-info-bg:  #e8f0fe;
    --oas-info:     #1a56db;
}

*, *::before, *::after { box-sizing: border-box; }

/*  Layout  */
.oas-wrap {
    max-width: 860px;
    margin: 32px auto;
    padding: 0 16px;
}
.oas-form-wrap { max-width: 1100px; }
.oas-login-wrap {
    max-width: 420px;
    margin: 64px auto;
    padding: 0 16px;
}

/*  Card  */
.oas-card {
    background: var(--oas-card-bg);
    border-radius: var(--oas-radius);
    box-shadow: var(--oas-shadow);
    padding: 32px;
}

/*  Notices  */
.oas-notice {
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: .9375rem;
}
.oas-notice--success { background: var(--oas-success-bg); color: var(--oas-success); }
.oas-notice--error   { background: var(--oas-error-bg);   color: var(--oas-error);   }
.oas-notice--info    { background: var(--oas-info-bg);    color: var(--oas-info);    }

/*  Typography  */
.oas-page-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--oas-text);
    margin: 0 0 24px;
}
.oas-login-wrap .oas-page-title { text-align: center; }
.oas-logo { display: block; margin: 0 auto 24px; max-height: 56px; width: auto; }
.oas-asso-name { font-size: 1rem; color: var(--oas-muted); margin: -16px 0 20px; }
.oas-info { color: var(--oas-muted); font-size: .875rem; margin-bottom: 20px; }

/*  Breadcrumb  */
.oas-breadcrumb { margin-bottom: 16px; }
.oas-breadcrumb a { color: var(--oas-primary); text-decoration: none; font-size: .875rem; }
.oas-breadcrumb a:hover { text-decoration: underline; }

/*  Forms  */
.oas-form { display: flex; flex-direction: column; gap: 18px; }
.oas-field { display: flex; flex-direction: column; gap: 6px; }
.oas-field label {
    font-weight: 600;
    font-size: .9375rem;
    color: var(--oas-text);
}
.oas-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--oas-border);
    border-radius: 8px;
    font-size: .9375rem;
    color: var(--oas-text);
    background: #fff;
    transition: border-color .15s;
    font-family: inherit;
}
.oas-input:focus {
    outline: none;
    border-color: var(--oas-primary);
}
.oas-textarea { min-height: 100px; resize: vertical; }

.oas-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.oas-field--radio .oas-field--radio,
.oas-field--oui_non .oas-field--radio,
.oas-field--tarif   .oas-field--radio {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
}
.oas-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}
.oas-radio-label input[type="radio"] {
    accent-color: var(--oas-primary);
    width: 18px;
    height: 18px;
}

/*  Conditional fields  */
.oas-conditional-fields { display: none; padding-top: 8px; }

/*  Form sections  */
.oas-form-section {
    background: var(--oas-card-bg);
    border: 1px solid var(--oas-border);
    border-radius: var(--oas-radius);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.oas-form-section h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--oas-primary);
    margin: 0 0 4px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--oas-border);
}

/*  Buttons  */
.oas-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: .9375rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: 2px solid transparent;
    transition: background .15s, border-color .15s, color .15s;
    font-family: inherit;
}
.oas-btn--primary {
    background: var(--oas-primary);
    color: #fff;
    border-color: var(--oas-primary);
}
.oas-btn--primary:hover {
    background: var(--oas-primary-h);
    border-color: var(--oas-primary-h);
    color: #fff;
}
.oas-btn--outline {
    background: transparent;
    color: var(--oas-primary);
    border-color: var(--oas-primary);
}
.oas-btn--outline:hover { background: var(--oas-primary); color: #fff; }
.oas-btn--ghost {
    background: transparent;
    color: var(--oas-muted);
    border-color: var(--oas-border);
}
.oas-btn--ghost:hover { background: var(--oas-bg); color: var(--oas-text); }
.oas-btn--danger { background: var(--oas-error); color: #fff; border-color: var(--oas-error); }
.oas-btn--danger:hover { opacity: .88; }
.oas-btn--sm { padding: 6px 14px; font-size: .8125rem; }

.oas-form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 8px;
}

/*  Password helpers  */
.oas-pass-error { color: var(--oas-error); font-size: .8125rem; display: none; }
.oas-forgot-link { font-size: .875rem; color: var(--oas-muted); text-align: right; }
.oas-forgot-link a { color: var(--oas-primary); text-decoration: none; }

/*  Dashboard header  */
.oas-dashboard__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--oas-border);
    margin-bottom: 28px;
}
.oas-dashboard__title { font-size: 1.25rem; font-weight: 700; color: var(--oas-text); margin: 0; }
.oas-dashboard__nav { display: flex; gap: 10px; flex-wrap: wrap; }
.oas-dashboard__welcome { color: var(--oas-muted); font-size: .875rem; margin-bottom: 24px; }

/*  Event cards  */
.oas-events-list { display: flex; flex-direction: column; gap: 12px; }
.oas-event-card {
    background: var(--oas-card-bg);
    border: 1px solid var(--oas-border);
    border-radius: var(--oas-radius);
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.oas-event-card__meta { flex: 1; min-width: 0; }
.oas-event-card__title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--oas-text);
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.oas-event-card__info { font-size: .8125rem; color: var(--oas-muted); }
.oas-event-card__actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }

/*  Status badges  */
.oas-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.oas-status--publish { background: #e6f5ed; color: var(--oas-success); }
.oas-status--pending { background: #fff7e0; color: #8a6400; }
.oas-status--draft   { background: #f0f0f0; color: #555; }

/*  Empty state  */
.oas-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--oas-muted);
}
.oas-empty p { margin-bottom: 16px; }

/*  Responsive  */
@media (max-width: 600px) {
    .oas-field-row { grid-template-columns: 1fr; }
    .oas-dashboard__header { flex-direction: column; align-items: flex-start; }
    .oas-card { padding: 20px; }
    .oas-form-section { padding: 16px; }
}

/* =====================================================================
   CALENDRIER DES ACTIVITÉS
   =================================================================== */

.oas-calendar-wrap {
    max-width: 1200px;
}

/* Calendrier embarqué dans Ma fiche */
.oas-cal-embed-section {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 2px solid #e8f5e8;
}

/* Légende catégories */
.oas-cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-bottom: 20px;
}
.oas-cal-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .8125rem;
    color: var(--oas-muted);
}
.oas-cal-legend__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Conteneur FullCalendar */
#oas-calendar {
    background: #fff;
    border-radius: var(--oas-radius);
    box-shadow: var(--oas-shadow);
    padding: 16px;
    margin-bottom: 40px;
}

/* Override FullCalendar pour coller au design OFFISA */
#oas-calendar .fc-toolbar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--oas-text);
}
#oas-calendar .fc-button-primary {
    background: var(--oas-primary) !important;
    border-color: var(--oas-primary) !important;
    box-shadow: none !important;
    font-size: .8rem;
    padding: 4px 12px;
}
#oas-calendar .fc-button-primary:hover {
    background: var(--oas-primary-h) !important;
    border-color: var(--oas-primary-h) !important;
}
#oas-calendar .fc-button-primary:disabled {
    background: var(--oas-border) !important;
    border-color: var(--oas-border) !important;
}
#oas-calendar .fc-button-active {
    background: var(--oas-primary-h) !important;
    border-color: var(--oas-primary-h) !important;
}
#oas-calendar .fc-daygrid-day.fc-day-today,
#oas-calendar .fc-timegrid-col.fc-day-today {
    background: rgba(141,198,63,.08) !important;
}
#oas-calendar .fc-highlight {
    background: rgba(141,198,63,.18) !important;
}
#oas-calendar .fc-event {
    border-radius: 5px;
    font-size: .78rem;
    cursor: pointer;
    border: none;
}
#oas-calendar .fc-event-title {
    font-weight: 600;
}

/* Champ en erreur */
.oas-input--error {
    border-color: var(--oas-error) !important;
    box-shadow: 0 0 0 3px rgba(185,28,28,.15);
}

/* Obligatoire */
.oas-req {
    color: var(--oas-error);
    margin-left: 2px;
}

/* =====================================================================
   MODAL
   =================================================================== */
.oas-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(2px);
}
.oas-modal-overlay.is-open {
    display: flex;
}

.oas-modal {
    background: #fff;
    border-radius: var(--oas-radius);
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    width: 100%;
    max-width: 680px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    animation: oasModalIn .18s ease;
}

@keyframes oasModalIn {
    from { opacity: 0; transform: translateY(-16px) scale(.97); }
    to   { opacity: 1; transform: translateY(0)     scale(1); }
}

.oas-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--oas-border);
    flex-shrink: 0;
}

.oas-modal__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--oas-text);
    margin: 0;
}

.oas-modal__close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--oas-muted);
    cursor: pointer;
    padding: 0 4px;
    transition: color .15s;
}
.oas-modal__close:hover { color: var(--oas-error); }

.oas-modal__body {
    overflow-y: auto;
    padding: 20px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.oas-modal__body .oas-field-row {
    gap: 14px;
}

.oas-field--span2 {
    grid-column: span 2;
}

.oas-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid var(--oas-border);
    flex-shrink: 0;
    gap: 12px;
}

.oas-modal__footer-right {
    display: flex;
    gap: 10px;
}

/* =====================================================================
   RESPONSIVE CALENDRIER + MODAL
   =================================================================== */
@media (max-width: 700px) {
    .oas-modal {
        max-height: 96vh;
    }
    .oas-modal__body .oas-field-row {
        grid-template-columns: 1fr;
    }
    .oas-field--span2 {
        grid-column: span 1;
    }
    #oas-calendar .fc-toolbar {
        flex-wrap: wrap;
        gap: 8px;
    }
    .oas-cal-legend {
        gap: 8px 14px;
    }
}

/* =====================================================================
   MA FICHE — Nouveaux composants
   =================================================================== */

/* Champ requis */
.oas-req { color: var(--oas-error); }

/* Grille checkboxes catégories */
.oas-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px 16px;
    padding: 12px 0 4px;
}
.oas-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400 !important;
    font-size: .9rem;
    color: var(--oas-text);
}
.oas-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--oas-primary);
    cursor: pointer;
}

/* Logo upload zone */
.oas-logo-upload {
    position: relative;
    border: 2px dashed var(--oas-border);
    border-radius: 10px;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    background: #fafafa;
    transition: border-color .2s, background .2s;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.oas-logo-upload:hover { border-color: var(--oas-primary); background: #f4fdf4; }
.oas-logo-upload__preview {
    max-height: 72px;
    max-width: 200px;
    object-fit: contain;
    border-radius: 4px;
}
.oas-logo-upload__hint { color: var(--oas-muted); font-size: .82rem; }
.oas-logo-upload__input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.oas-logo-upload__remove {
    margin-top: 8px;
    font-size: .82rem;
    color: var(--oas-error);
}

/* ---- Activities repeater table ------------------------------------ */
.oas-act-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1.5px solid var(--oas-border);
}
.oas-act-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 960px;
    font-size: .84rem;
}
.oas-act-table thead th {
    background: var(--oas-primary);
    color: #fff;
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    font-size: .8rem;
}
.oas-act-table thead th:last-child { width: 36px; text-align: center; }
.oas-act-table tbody tr:nth-child(even) { background: #f5fdf5; }
.oas-act-table tbody td {
    padding: 5px 4px;
    vertical-align: middle;
    border-bottom: 1px solid #eee;
}
.oas-act-table tbody tr:last-child td { border-bottom: none; }

.oas-act-input {
    width: 100%;
    padding: 6px 8px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    font-size: .8rem;
    color: var(--oas-text);
    background: #fff;
    transition: border-color .15s;
    font-family: inherit;
}
.oas-act-input:focus {
    outline: none;
    border-color: var(--oas-primary);
    box-shadow: 0 0 0 2px rgba(40,181,27,.1);
}
.oas-act-short  { min-width: 80px; }
.oas-act-medium { min-width: 110px; }
.oas-act-select { min-width: 90px; }

.oas-act-row-del {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--oas-error);
    font-size: 1.15rem;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background .15s;
    display: block;
    margin: 0 auto;
}
.oas-act-row-del:hover { background: var(--oas-error-bg); }

.oas-act-empty {
    text-align: center;
    color: var(--oas-muted);
    padding: 24px;
    font-style: italic;
    font-size: .875rem;
}
.oas-act-add-btn { margin-top: 12px; }

@media (max-width: 600px) {
    .oas-checkbox-grid { grid-template-columns: 1fr 1fr; }
    .oas-logo-upload { min-height: 90px; }
}
