/* ============================================================
   BASE — Reset, variables, composants (boutons, formulaires)
   Ce bloc manquait dans app.css : les classes .btn, .form-input,
   etc. n'étaient définies nulle part côté public, et les variables
   CSS (--color-bg-secondary, etc.) utilisées par .toast n'existaient
   pas non plus. Copié/aligné sur admin.css pour rester cohérent.
   ============================================================ */

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

:root {
    --color-bg-primary: #0B0C10;
    --color-bg-secondary: #1A1A24;
    --color-bg-tertiary: #242433;
    --color-accent: #F5C518;
    --color-accent-hover: #D4A800;
    --color-text-primary: #E5E7EB;
    --color-text-secondary: #9CA3AF;
    --color-text-muted: #6B7280;
    --color-border: #2D2D3D;
    --color-success: #10B981;
    --color-danger: #EF4444;
    --color-warning: #F59E0B;
    --color-info: #3B82F6;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Variables de composition Tailwind (transform / gradient) */
    --tw-translate-x: 0;
    --tw-translate-y: 0;
    --tw-rotate: 0;
    --tw-scale-x: 1;
    --tw-scale-y: 1;
    --tw-gradient-from: transparent;
    --tw-gradient-to: transparent;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}

.dark {
    --color-bg-primary: #0B0C10;
    --color-bg-secondary: #1A1A24;
    --color-bg-tertiary: #242433;
    --color-text-primary: #E5E7EB;
    --color-text-secondary: #9CA3AF;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    min-width: 0;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
}

img, svg {
    display: block;
    max-width: 100%;
}

input, select, textarea {
    font: inherit;
    color: inherit;
}

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--color-accent);
    color: #000;
}

.btn-primary:hover {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--color-bg-tertiary);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-bg-secondary);
    border-color: var(--color-accent);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    background: #DC2626;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Formulaires */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text-primary);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.1);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239CA3AF' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-checkbox {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: var(--color-accent);
    flex-shrink: 0;
}

.form-error {
    color: var(--color-danger);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}
/* Styles additionnels pour l'application publique */

/* Toast notifications */
.toast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(20px);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.toast-show {
    transform: translateX(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-message {
    font-size: 0.875rem;
    color: var(--color-text-primary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
}

.toast-close:hover {
    color: var(--color-text-primary);
}

.toast-success {
    border-left: 4px solid var(--color-success);
}

.toast-success .toast-icon {
    color: var(--color-success);
}

.toast-error {
    border-left: 4px solid var(--color-danger);
}

.toast-error .toast-icon {
    color: var(--color-danger);
}

.toast-warning {
    border-left: 4px solid var(--color-warning);
}

.toast-warning .toast-icon {
    color: var(--color-warning);
}

.toast-info {
    border-left: 4px solid var(--color-info);
}

.toast-info .toast-icon {
    color: var(--color-info);
}

/* Animations de page */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-enter {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Glass morphism cards */
.glass-card {
    background: rgba(26, 26, 36, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.glass-card:hover {
    background: rgba(26, 26, 36, 0.8);
    border-color: var(--color-accent);
    transform: translateY(-4px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

/* Etat utilitaire - à utiliser à la place de tout style inline
   (ex : element.style.display = 'none') pour rester compatible avec la
   CSP style-src 'self' du site */
.hidden {
    display: none;
}

/* Conteneur de toasts, positionné en CSS plutôt qu'en style inline */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
    width: calc(100vw - 2rem);
}

/* Responsive */
@media (max-width: 640px) {
    .glass-card {
        border-radius: 12px;
    }
    
    .toast {
        max-width: calc(100vw - 2rem);
        margin: 0 1rem;
    }

    .toast-container {
        top: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
        max-width: none;
        width: auto;
    }
}
/* ============================================================
   UTILITAIRES — équivalents exacts des classes de type Tailwind
   utilisées dans les templates (login, register, profil, layouts
   public + admin). Ce fichier ne réinvente pas Tailwind en entier :
   il définit uniquement les classes réellement utilisées, pour que
   chaque page s'affiche exactement comme prévu sans dépendre d'un
   pipeline de build. Mobile-first ; les variantes sm:/md:/lg: sont
   regroupées dans les media queries en bas de fichier.
   ============================================================ */

/* Affichage */
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }
.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none; }

/* Flexbox */
.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

/* Grid */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.col-span-1 { grid-column: span 1 / span 1; }
.col-span-2 { grid-column: span 2 / span 2; }

/* Espacements (échelle Tailwind : 1 unité = 0.25rem) */
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.pt-16 { padding-top: 4rem; }
.pl-10 { padding-left: 2.5rem; }

.mx-auto { margin-left: auto; margin-right: auto; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mr-3 { margin-right: 0.75rem; }

.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-4 > * + * { margin-top: 1rem; }

/* Tailles */
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-8 { width: 2rem; }
.w-24 { width: 6rem; }
.w-64 { width: 16rem; }
.w-full { width: 100%; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-8 { height: 2rem; }
.h-16 { height: 4rem; }
.h-24 { height: 6rem; }
.h-screen { height: 100vh; }
.min-h-screen { min-height: 100vh; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-7xl { max-width: 80rem; }

/* Icônes / images — jamais de débordement, quelle que soit la taille d'écran */
svg, img { flex-shrink: 0; }
.w-4, .w-5, .w-6, .w-8, .w-24 { max-width: 100%; }
.h-4, .h-5, .h-6, .h-8, .h-24 { max-height: 100%; }

/* Typographie */
.font-sans { font-family: var(--font-family); }
.antialiased { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }
.text-left { text-align: left; }

/* Couleurs de texte */
.text-white { color: #ffffff; }
.text-black { color: #000000; }
.text-gray-100 { color: #f3f4f6; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-amber-500 { color: #f59e0b; }
.text-red-400 { color: #f87171; }
.text-green-400 { color: #4ade80; }
.hover\:text-white:hover { color: #ffffff; }
.hover\:text-gray-300:hover { color: #d1d5db; }
.hover\:text-amber-400:hover { color: #fbbf24; }

/* Couleurs de fond */
.bg-black\/70 { background-color: rgba(0, 0, 0, 0.7); }
.bg-gray-800 { background-color: #1f2937; }
.bg-gray-900 { background-color: #111827; }
.bg-gray-900\/80 { background-color: rgba(17, 24, 39, 0.8); }
.bg-gray-950 { background-color: #030712; }
.bg-amber-500 { background-color: #f59e0b; }
.bg-amber-500\/20 { background-color: rgba(245, 158, 11, 0.2); }
.bg-green-900\/50 { background-color: rgba(20, 83, 45, 0.5); }
.bg-red-900\/50 { background-color: rgba(127, 29, 29, 0.5); }
.hover\:bg-amber-400:hover { background-color: #fbbf24; }
.hover\:bg-gray-800:hover { background-color: #1f2937; }
.hover\:bg-red-900\/20:hover { background-color: rgba(127, 29, 29, 0.2); }

/* Dégradés */
.bg-gradient-to-br { background-image: linear-gradient(to bottom right, var(--tw-gradient-stops)); }
.from-gray-950 { --tw-gradient-from: #030712; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(3, 7, 18, 0)); }
.via-gray-900 { --tw-gradient-stops: var(--tw-gradient-from), #111827, var(--tw-gradient-to, rgba(3, 7, 18, 0)); }
.to-gray-950 { --tw-gradient-to: #030712; }

/* Bordures / arrondis */
.border { border-width: 1px; border-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-r { border-right-width: 1px; border-right-style: solid; }
.border-gray-800 { border-color: #1f2937; }
.border-red-500 { border-color: #ef4444; }
.border-red-500\/30 { border-color: rgba(239, 68, 68, 0.3); }
.border-red-700 { border-color: #b91c1c; }
.border-green-700 { border-color: #15803d; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }

/* Anneaux (ring) */
.ring-2 { box-shadow: 0 0 0 2px var(--tw-ring-color, currentColor); }
.ring-amber-500 { --tw-ring-color: #f59e0b; }

/* Ombres / flous */
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }
.backdrop-blur-lg { backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.backdrop-blur-xl { backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.left-3 { left: 0.75rem; }
.right-3 { right: 0.75rem; }
.top-1\/2 { top: 50%; }
.left-1\/2 { left: 50%; }
.z-50 { z-index: 50; }

/* Transformations (composables comme dans Tailwind : chaque classe ne
   fixe qu'une variable, la propriété transform les combine toutes) */
.-translate-x-1\/2 {
    --tw-translate-x: -50%;
    transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}
.-translate-y-1\/2 {
    --tw-translate-y: -50%;
    transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

/* Divers */
.object-cover { object-fit: cover; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.cursor-pointer { cursor: pointer; }
.transition-colors { transition-property: color, background-color, border-color; transition-duration: 0.2s; transition-timing-function: ease; }

/* ============================================================
   RESPONSIVE — mobile-first. Variantes réellement utilisées :
   sm: 640px / md: 768px / lg: 1024px
   ============================================================ */
@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 768px) {
    .md\:flex { display: flex; }
    .md\:flex-row { flex-direction: row; }
    .md\:mt-0 { margin-top: 0; }
}

@media (min-width: 1024px) {
    .lg\:block { display: block; }
    .lg\:hidden { display: none; }
    .lg\:col-span-1 { grid-column: span 1 / span 1; }
    .lg\:col-span-2 { grid-column: span 2 / span 2; }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
}

/* Très petits écrans : on resserre les espacements des conteneurs
   principaux sans jamais casser la mise en page ni provoquer de
   débordement horizontal. */
@media (max-width: 380px) {
    .p-6, .p-8 { padding: 1rem; }
    .px-4 { padding-left: 0.75rem; padding-right: 0.75rem; }
    .text-3xl { font-size: 1.5rem; line-height: 2rem; }
}
