/* ==============================================================================
   TSP12 - PORTAIL ADHÉRENT (Direction Artistique Officielle TSP12)
   Harmonisé avec la palette Raft & les codes visuels du Tutorat Santé Paris 12
   ============================================================================== */

:root {
    --portal-font: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Couleurs de la charte TSP12 */
    --color-raft-bg: #fff5e0;
    --color-raft-fg: #292e29;
    --color-raft-accent: #41b06e;
    --color-raft-accent-secondary: #8decb4;
    --color-raft-navy: #141e46;
    
    /* Fond spécifique au portail : légèrement plus soutenu et chaleureux */
    --portal-bg: #f4eee2;
    --portal-bg-gradient: linear-gradient(180deg, #f7f1e4 0%, #ede5d5 100%);
    
    /* Carte et élévation */
    --portal-card-bg: #ffffff;
    --portal-card-border: rgba(20, 30, 70, 0.08);
    --portal-card-shadow: 0 20px 45px -10px rgba(20, 30, 70, 0.08), 0 4px 16px rgba(20, 30, 70, 0.03);
    
    /* Contrôles et inputs */
    --portal-input-bg: #ffffff;
    --portal-input-border: #dcd4c6;
    --portal-input-focus-border: #41b06e;
    --portal-input-focus-ring: rgba(65, 176, 110, 0.20);
}

/* Base du corps de page en mode portail */
body.portal-body {
    font-family: var(--portal-font);
    background-color: var(--portal-bg);
    background-image: 
        radial-gradient(circle at 12% 15%, rgba(65, 176, 110, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 88% 85%, rgba(20, 30, 70, 0.06) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(141, 236, 180, 0.05) 0%, transparent 60%);
    background-attachment: fixed;
    color: var(--color-raft-fg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* En-tête standard du site */
.site-header {
    background-color: rgba(255, 245, 224, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(20, 30, 70, 0.08);
}

/* Panneau Carte du Portail */
.portal-card {
    background: var(--portal-card-bg);
    border: 1px solid var(--portal-card-border);
    box-shadow: var(--portal-card-shadow);
    border-radius: 28px;
    transition: all 0.3s ease;
}

/* Sélecteur d'onglets façon Segmented Control élégant */
.portal-tabs-wrapper {
    background: #eae2d3;
    padding: 5px;
    border-radius: 18px;
    display: flex;
    gap: 4px;
}

.portal-tab-btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #647065;
    background: transparent;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--portal-font);
}

.portal-tab-btn:hover {
    color: var(--color-raft-fg);
}

.portal-tab-btn.active {
    background: #ffffff;
    color: var(--color-raft-navy);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(20, 30, 70, 0.08);
}

/* Champs de formulaires */
.form-input {
    background: var(--portal-input-bg);
    border: 1.5px solid var(--portal-input-border);
    border-radius: 14px;
    color: var(--color-raft-fg);
    font-family: var(--portal-font);
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-input::placeholder {
    color: #9ba49c;
}

.form-input:focus {
    background: #ffffff;
    border-color: var(--portal-input-focus-border);
    box-shadow: 0 0 0 3.5px var(--portal-input-focus-ring);
    outline: none;
}

/* Bouton principal signature TSP12 */
.btn-primary {
    background-color: var(--color-raft-navy) !important;
    color: #ffffff !important;
    border-radius: 50px !important;
    font-weight: 700 !important;
    font-family: var(--portal-font) !important;
    box-shadow: 0 4px 15px rgba(20, 30, 70, 0.2) !important;
    transition: all 0.25s ease !important;
    border: none !important;
    cursor: pointer !important;
}

.btn-primary:hover {
    background-color: var(--color-raft-accent) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(65, 176, 110, 0.35) !important;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Boutons secondaires */
.btn-secondary {
    background-color: #eae3d4;
    color: var(--color-raft-fg);
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background-color: #dfd7c5;
    color: var(--color-raft-navy);
}

/* Badges de Rôles */
.badge-role-etudiant {
    background: rgba(37, 99, 235, 0.10);
    color: #1d4ed8;
    border: 1px solid rgba(37, 99, 235, 0.25);
}

.badge-role-tuteur {
    background: rgba(65, 176, 110, 0.12);
    color: #15803d;
    border: 1px solid rgba(65, 176, 110, 0.3);
}

.badge-role-vp {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-role-bureau {
    background: rgba(124, 58, 237, 0.12);
    color: #6d28d9;
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.badge-role-webmaster {
    background: rgba(225, 29, 72, 0.12);
    color: #be123c;
    border: 1px solid rgba(225, 29, 72, 0.35);
}

/* Cartes Modules du Dashboard */
.resource-card {
    background: #ffffff;
    border: 1px solid rgba(20, 30, 70, 0.08);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(20, 30, 70, 0.04);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.resource-card:hover {
    transform: translateY(-3px);
    border-color: rgba(65, 176, 110, 0.3);
    box-shadow: 0 12px 30px rgba(20, 30, 70, 0.08);
}

/* Spinner de chargement */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
}

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

/* Animations de transition */
.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modale */
.portal-modal-backdrop {
    background-color: rgba(20, 30, 70, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ==============================================================================
   MODE SOMBRE POUR LE PORTAIL & DASHBOARD TSP12
   ============================================================================== */
html.dark body.portal-body {
    background-color: #0b0f19 !important;
    background-image: 
        radial-gradient(circle at 12% 15%, rgba(65, 176, 110, 0.08) 0%, transparent 45%),
        radial-gradient(circle at 88% 85%, rgba(20, 30, 70, 0.15) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(141, 236, 180, 0.03) 0%, transparent 60%) !important;
    color: #f1f5f9 !important;
}

html.dark .portal-card {
    background: #131c2e !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5) !important;
}

html.dark .portal-card h1,
html.dark .portal-card h2,
html.dark .portal-card h3 {
    color: #ffffff !important;
}

html.dark .portal-card label {
    color: #e2e8f0 !important;
}

html.dark .portal-card p {
    color: #94a3b8 !important;
}

html.dark .portal-tabs-wrapper {
    background: #0d1424 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.dark .portal-tab-btn {
    color: #94a3b8 !important;
}

html.dark .portal-tab-btn:hover {
    color: #ffffff !important;
}

html.dark .portal-tab-btn.active {
    background: #1e293b !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

html.dark .form-input {
    background: #0f172a !important;
    border-color: #2d3b55 !important;
    color: #ffffff !important;
}

html.dark .form-input::placeholder {
    color: #64748b !important;
}

html.dark .form-input:focus {
    border-color: #41b06e !important;
    box-shadow: 0 0 0 3px rgba(65, 176, 110, 0.25) !important;
}

html.dark .resource-card {
    background: #131c2e !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3) !important;
}

html.dark .resource-card h4 {
    color: #ffffff !important;
}

html.dark .resource-card p {
    color: #94a3b8 !important;
}

html.dark #btnNeedHelp {
    background: #1e293b !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

html.dark #btnNeedHelp:hover {
    background: #283548 !important;
}

html.dark select.form-input {
    background-color: #0f172a !important;
    color: #ffffff !important;
    border-color: #2d3b55 !important;
}

html.dark select.form-input option {
    background-color: #0f172a;
    color: #ffffff;
}

html.dark .btn-secondary {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

html.dark .btn-secondary:hover {
    background-color: #283548 !important;
    color: #ffffff !important;
}

html.dark .portal-modal-backdrop {
    background-color: rgba(0, 0, 0, 0.75) !important;
}

html.dark #modalHelp .bg-slate-50,
html.dark #viewSignup .bg-slate-50 {
    background-color: #0d1424 !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #94a3b8 !important;
}

html.dark #modalHelp h4,
html.dark #modalHelp strong,
html.dark #viewSignup strong {
    color: #ffffff !important;
}

html.dark #sectionWebmasterPanel > div:first-child {
    background-color: rgba(244, 63, 94, 0.08) !important;
    border-color: rgba(244, 63, 94, 0.25) !important;
}

html.dark #sectionWebmasterPanel .bg-white {
    background-color: #0f172a !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

html.dark #sectionWebmasterPanel .text-slate-900 {
    color: #ffffff !important;
}

html.dark table th {
    color: #94a3b8 !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

html.dark table td {
    color: #cbd5e1 !important;
    border-bottom-color: rgba(255, 255, 255, 0.05) !important;
}

html.dark #membersTableBody tr:hover {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

/* ==============================================================================
   ALERTES & FEEDBACK ADHÉRENT TSP12 (Mode Clair & Mode Sombre)
   ============================================================================== */
.adherent-alert {
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-width: 1px;
    border-style: solid;
    transition: all 0.2s ease;
}

.adherent-alert .alert-title {
    font-weight: 700;
    margin-bottom: 2px;
}

.adherent-alert .alert-desc {
    font-size: 11px;
    line-height: 1.45;
}

/* Success */
.adherent-alert-success {
    background-color: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}
.adherent-alert-success .alert-title { color: #047857; }
.adherent-alert-success .alert-desc { color: #064e3b; }
.adherent-alert-success svg, .adherent-alert-success i { color: #059669; }

html.dark .adherent-alert-success {
    background-color: rgba(16, 185, 129, 0.12) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #a7f3d0 !important;
}
html.dark .adherent-alert-success .alert-title { color: #34d399 !important; }
html.dark .adherent-alert-success .alert-desc { color: #e2e8f0 !important; }
html.dark .adherent-alert-success svg, html.dark .adherent-alert-success i { color: #34d399 !important; }

/* Warning */
.adherent-alert-warning {
    background-color: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}
.adherent-alert-warning .alert-title { color: #b45309; }
.adherent-alert-warning .alert-desc { color: #78350f; }
.adherent-alert-warning svg, .adherent-alert-warning i { color: #d97706; }

html.dark .adherent-alert-warning {
    background-color: rgba(245, 158, 11, 0.12) !important;
    border-color: rgba(245, 158, 11, 0.3) !important;
    color: #fde68a !important;
}
html.dark .adherent-alert-warning .alert-title { color: #fbbf24 !important; }
html.dark .adherent-alert-warning .alert-desc { color: #e2e8f0 !important; }
html.dark .adherent-alert-warning svg, html.dark .adherent-alert-warning i { color: #fbbf24 !important; }

/* Danger */
.adherent-alert-danger {
    background-color: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}
.adherent-alert-danger .alert-title { color: #b91c1c; }
.adherent-alert-danger .alert-desc { color: #7f1d1d; }
.adherent-alert-danger svg, .adherent-alert-danger i { color: #dc2626; }

html.dark .adherent-alert-danger {
    background-color: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
    color: #fecaca !important;
}
html.dark .adherent-alert-danger .alert-title { color: #f87171 !important; }
html.dark .adherent-alert-danger .alert-desc { color: #e2e8f0 !important; }
html.dark .adherent-alert-danger svg, html.dark .adherent-alert-danger i { color: #f87171 !important; }

/* Info */
.adherent-alert-info {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}
.adherent-alert-info .alert-title { color: #1d4ed8; }
.adherent-alert-info .alert-desc { color: #1e3a8a; }
.adherent-alert-info svg, .adherent-alert-info i { color: #2563eb; }

html.dark .adherent-alert-info {
    background-color: rgba(59, 130, 246, 0.12) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    color: #bfdbfe !important;
}
html.dark .adherent-alert-info .alert-title { color: #60a5fa !important; }
html.dark .adherent-alert-info .alert-desc { color: #e2e8f0 !important; }
html.dark .adherent-alert-info svg, html.dark .adherent-alert-info i { color: #60a5fa !important; }

/* ==============================================================================
   MODULE DRIVE TSP12 & GESTIONNAIRE DE FICHIERS (LIGHT & DARK MODE)
   ============================================================================== */
.drive-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .drive-layout {
        grid-template-columns: 1fr;
    }
}

.drive-sidebar {
    background: #ffffff;
    border: 1px solid rgba(20, 30, 70, 0.08);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

html.dark .drive-sidebar {
    background: #131c2e !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3) !important;
}

.drive-main {
    background: #ffffff;
    border: 1px solid rgba(20, 30, 70, 0.08);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    min-height: 480px;
}

html.dark .drive-main {
    background: #131c2e !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3) !important;
}

.drive-folder-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.drive-folder-card:hover {
    transform: translateY(-2px);
}

.drive-file-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.drive-file-card:hover {
    transform: translateY(-2px);
}

.drive-dropzone {
    border: 2px dashed rgba(65, 176, 110, 0.35);
    background: rgba(65, 176, 110, 0.03);
    border-radius: 18px;
    padding: 28px 20px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.drive-dropzone:hover,
.drive-dropzone.drag-over {
    border-color: #41b06e;
    background: rgba(65, 176, 110, 0.08);
}

html.dark .drive-dropzone {
    border-color: rgba(65, 176, 110, 0.3);
    background: rgba(65, 176, 110, 0.04);
}

html.dark .drive-dropzone:hover {
    border-color: #34d399;
    background: rgba(65, 176, 110, 0.12);
}

/* Modale de prévisualisation PDF */
.drive-preview-frame-container {
    height: 72vh;
    min-height: 460px;
    border-radius: 12px;
    overflow: hidden;
    background: #1e293b;
}

.drive-preview-frame {
    width: 100%;
    height: 100%;
    border: 0;
}



