@tailwind base;
@tailwind components;
@tailwind utilities;

/* ========== VARIABLES CSS ========== */
:root {
    /* Couleurs principales - Palette épurée */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-main: #f3f4f6;
    --bg-card: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;

    /* Espacement (échelle 4px) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 32px;
    --space-8: 40px;

    /* Animations */
    --transition-fast: 150ms;
    --transition-normal: 200ms;
    --transition-slow: 300ms;
    --transition-page: 350ms;
    --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

    /* Touch targets */
    --touch-target-min: 44px;

    /* Rayons de bordure */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Ombres */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

    /* Safe areas mobile */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);

    /* Navigation */
    --bottom-nav-height: 64px;
    --header-height: 56px;
}

/* Mode sombre */
.dark {
    --bg-main: #111827;
    --bg-card: #1f2937;
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --border-color: #374151;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
}

.bg-card { background-color: var(--bg-card); }
.text-muted { color: var(--text-muted); }
.border-theme { border-color: var(--border-color); }

/* ========== CARD STYLES ========== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-normal) var(--ease-out),
                transform var(--transition-normal) var(--ease-out);
}

.card-elevated {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition-normal) var(--ease-out),
                transform var(--transition-normal) var(--ease-out);
}

.card-flat {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: border-color var(--transition-normal) var(--ease-out);
}

/* Hover subtil sur desktop */
@media (hover: hover) {
    .card:hover {
        box-shadow: var(--shadow-md);
    }
    .card-elevated:hover {
        box-shadow: var(--shadow-lg);
        transform: translateY(-1px);
    }
    .card-flat:hover {
        border-color: var(--primary-light);
    }
}

/* ========== BUTTON CLASSES ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--touch-target-min);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    gap: var(--space-2);
    cursor: pointer;
    transition: all var(--transition-normal) var(--ease-out);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover {
    background: #16a34a;
}

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover {
    background: #dc2626;
}

.btn-ghost {
    background: transparent;
    color: var(--text-main);
}
.btn-ghost:hover {
    background: rgba(0, 0, 0, 0.05);
}
.dark .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-sm {
    min-height: 36px;
    padding: var(--space-1) var(--space-3);
    font-size: 0.8125rem;
}

.btn-lg {
    min-height: 52px;
    padding: var(--space-3) var(--space-6);
    font-size: 1rem;
}

/* Micro-interaction: scale sur appui */
.btn-interactive:active {
    transform: scale(0.96);
}

/* ========== TRANSITIONS CIBLÉES ========== */
button, a, input, select, textarea,
.transition, .fade-in, .toast, .loader,
[class*="hover:"], [class*="focus:"] {
    transition-property: color, background-color, border-color, opacity, transform, box-shadow;
    transition-duration: 0.2s;
    transition-timing-function: ease-in-out;
}

/* ========== DARK MODE OVERRIDES ========== */
.dark .bg-white { background-color: var(--bg-card); }
.dark .bg-gray-100 { background-color: #111827; }
.dark .bg-gray-50 { background-color: #1f2937; }
.dark .text-gray-800 { color: #f9fafb; }
.dark .text-gray-700 { color: #e5e7eb; }
.dark .text-gray-600 { color: #9ca3af; }
.dark .border { border-color: #374151; }
.dark input, .dark select { 
    background-color: #374151; 
    color: #f9fafb; 
    border-color: #4b5563;
}
.dark .bg-orange-50 { background-color: #422006; }
.dark .bg-indigo-50 { background-color: #1e1b4b; }
.dark .bg-pink-50 { background-color: #500724; }
.dark .bg-blue-50 { background-color: #172554; }
.dark .bg-yellow-50 { background-color: #422006; }
.dark .bg-red-50 { background-color: #450a0a; }
.dark .hover\:bg-gray-50:hover { background-color: #374151; }

/* ========== STYLE CHECKED ========== */
.checked {
    text-decoration: line-through;
    opacity: 0.5;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.animate-fade-in {
    animation: fadeIn 0.2s ease-out;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ========== PAGE TRANSITIONS ========== */
@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pageExit {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-5px);
    }
}

.page-enter {
    animation: pageEnter var(--transition-page) var(--ease-out) forwards;
}

.page-exit {
    animation: pageExit var(--transition-fast) var(--ease-out) forwards;
}

/* ========== STAGGER LIST ANIMATIONS ========== */
@keyframes staggerFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stagger-list > * {
    opacity: 0;
    animation: staggerFadeIn var(--transition-normal) var(--ease-out) forwards;
}

.stagger-list > *:nth-child(1) { animation-delay: 0ms; }
.stagger-list > *:nth-child(2) { animation-delay: 30ms; }
.stagger-list > *:nth-child(3) { animation-delay: 60ms; }
.stagger-list > *:nth-child(4) { animation-delay: 90ms; }
.stagger-list > *:nth-child(5) { animation-delay: 120ms; }
.stagger-list > *:nth-child(6) { animation-delay: 150ms; }
.stagger-list > *:nth-child(7) { animation-delay: 180ms; }
.stagger-list > *:nth-child(8) { animation-delay: 210ms; }
.stagger-list > *:nth-child(9) { animation-delay: 240ms; }
.stagger-list > *:nth-child(n+10) { animation-delay: 270ms; }

/* Désactiver les animations si l'utilisateur préfère un mouvement réduit */
@media (prefers-reduced-motion: reduce) {
    .page-enter,
    .page-exit,
    .stagger-list > * {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ========== SLIDE UP ANIMATION (for modals/sheets) ========== */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(100%);
    }
}

.slide-up {
    animation: slideUp var(--transition-slow) var(--ease-out) forwards;
}

.slide-down {
    animation: slideDown var(--transition-slow) var(--ease-out) forwards;
}

/* ========== LOADER ========== */
.loader {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

/* ========== TOAST NOTIFICATIONS ========== */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    max-width: 90vw;
}

.toast.success { background-color: var(--success); }
.toast.error { background-color: var(--danger); }
.toast.warning { background-color: var(--warning); }

/* ========== LAZY LOADING IMAGES ========== */
.lazy-loading {
    opacity: 0.5;
    filter: blur(2px);
    transition: opacity 0.3s ease, filter 0.3s ease;
    animation: pulse 1.5s ease-in-out infinite;
}

.lazy-loaded {
    opacity: 1;
    filter: blur(0);
    animation: none;
}

.lazy-error {
    opacity: 0.7;
    background-color: #f3f4f6;
}

img {
    content-visibility: auto;
}

/* ========== SKELETON PLACEHOLDER ========== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.dark .skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}

/* ========== NAVIGATION ========== */
nav a.active {
    background-color: #2563eb;
}

/* ========== MOBILE MENU ========== */
.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #3b82f6;
    padding: 0.75rem;
    z-index: 50;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.mobile-menu.show {
    display: block;
}

.mobile-menu a {
    display: block;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
    border-radius: 0.375rem;
}

/* ========== HAMBURGER BUTTON ========== */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 24px;
    height: 20px;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ========== THEME TOGGLE ========== */
.theme-toggle {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* ========== SEARCH BAR ========== */
.search-bar {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 0.5rem 1rem;
    width: 100%;
    max-width: 400px;
}

.dark .search-bar {
    background-color: #374151;
    border-color: #4b5563;
    color: #f9fafb;
}

/* ========== INSTALL PWA BANNER ========== */
.install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    padding: 1rem;
    display: none;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
}

.install-banner.show {
    display: flex;
}

/* ========== SYNC STATUS ========== */
.sync-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.sync-info { color: #3b82f6; }
.sync-success { color: #22c55e; }
.sync-warning { color: #f59e0b; }
.sync-error { color: #ef4444; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .desktop-nav {
        display: none;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-card {
        display: block;
    }

    .desktop-table {
        display: none;
    }
}

@media (min-width: 769px) {
    .mobile-menu {
        display: none !important;
    }

    .mobile-card {
        display: none;
    }

    .desktop-table {
        display: table;
    }
}

/* Touch amélioration pour mobile */
@media (hover: none) and (pointer: coarse) {
    button, a, select, input {
        min-height: 44px;
    }
}

/* ========== TOUCH TARGETS ========== */
.touch-target {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

/* Border width for checkboxes */
.border-3 {
    border-width: 3px;
}

/* ========== PROGRESS BAR ========== */
@keyframes progress-indeterminate {
    0% {
        width: 0%;
        margin-left: 0%;
    }
    50% {
        width: 30%;
        margin-left: 35%;
    }
    100% {
        width: 0%;
        margin-left: 100%;
    }
}

.animate-progress-indeterminate {
    animation: progress-indeterminate 1.5s ease-in-out infinite;
}

/* ========== SWIPE GESTURES ========== */
.swipe-item {
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
    will-change: transform;
}

.swipe-item::before,
.swipe-item::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.swipe-item::before {
    left: 0;
    background: linear-gradient(to right, #10b981 0%, transparent 100%);
    content: '✓';
    color: white;
    padding-left: 1rem;
}

.swipe-item::after {
    right: 0;
    background: linear-gradient(to left, #ef4444 0%, transparent 100%);
    content: '🗑️';
    padding-right: 1rem;
}

.swipe-item.swipe-right-active {
    background: linear-gradient(to right, rgba(16, 185, 129, 0.2) 0%, transparent 50%) !important;
}

.swipe-item.swipe-right-active::before {
    opacity: 1;
}

.swipe-item.swipe-left-active {
    background: linear-gradient(to left, rgba(239, 68, 68, 0.2) 0%, transparent 50%) !important;
}

.swipe-item.swipe-left-active::after {
    opacity: 1;
}

/* Hint pour les utilisateurs mobiles */
.swipe-hint-container {
    position: relative;
}

.swipe-hint-banner {
    background: linear-gradient(to right, rgba(16, 185, 129, 0.1), rgba(239, 68, 68, 0.1));
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.swipe-hint-banner span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ========== ACCESSIBILITÉ ========== */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Skip link pour l'accessibilité */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Focus trap visual indicator */
[aria-modal="true"] {
    isolation: isolate;
}

/* ========== BOTTOM NAVIGATION (Mobile) ========== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    padding-bottom: var(--safe-area-bottom);
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    z-index: 100;
    justify-content: space-around;
    align-items: stretch;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.dark .bottom-nav {
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: var(--space-2);
    color: var(--text-muted);
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color var(--transition-fast) var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item.active,
.bottom-nav-item:active {
    color: var(--primary);
}

.bottom-nav-icon {
    font-size: 1.5rem;
    line-height: 1;
    margin-bottom: 2px;
}

.bottom-nav-label {
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.2;
}

/* ========== BOTTOM SHEET ========== */
.bottom-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-slow) var(--ease-out),
                visibility var(--transition-slow);
}

.bottom-sheet-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    padding: var(--space-4);
    padding-bottom: calc(var(--space-6) + var(--safe-area-bottom));
    z-index: 200;
    transform: translateY(100%);
    transition: transform var(--transition-slow) var(--ease-out);
    max-height: 80vh;
    overflow-y: auto;
}

.bottom-sheet.open {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 36px;
    height: 4px;
    background: var(--border-color);
    border-radius: var(--radius-full);
    margin: 0 auto var(--space-4);
}

.bottom-sheet-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3);
}

.bottom-sheet-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    color: var(--text-main);
    text-decoration: none;
    background: transparent;
    transition: background var(--transition-fast) var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}

.bottom-sheet-item:active {
    background: rgba(0, 0, 0, 0.05);
}

.dark .bottom-sheet-item:active {
    background: rgba(255, 255, 255, 0.1);
}

.bottom-sheet-icon {
    font-size: 1.75rem;
    margin-bottom: var(--space-1);
}

.bottom-sheet-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
}

/* ========== MOBILE RESPONSIVE - Bottom Nav ========== */
@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
    }

    /* Ajouter padding bottom pour le contenu principal */
    main {
        padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + var(--space-4)) !important;
    }

    /* Masquer la navigation hamburger classique */
    .hamburger,
    .mobile-menu {
        display: none !important;
    }

    /* Masquer la barre de navigation bleue sur mobile */
    nav[role="navigation"]:not(.bottom-nav) .flex.justify-between {
        display: none !important;
    }

    /* Masquer le footer sur mobile */
    .footer-desktop {
        display: none;
    }

    /* Install banner au-dessus de la bottom nav */
    .install-banner {
        bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
    }

    /* Toast au-dessus de la bottom nav */
    .toast {
        bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + 20px);
    }
}

/* Desktop: masquer la bottom nav */
@media (min-width: 769px) {
    .bottom-nav,
    .bottom-sheet,
    .bottom-sheet-backdrop {
        display: none !important;
    }
}

/* ========== MODALS AS BOTTOM SHEETS (Mobile) ========== */
@media (max-width: 640px) {
    /* Centrer les modals en bas sur mobile */
    .fixed.inset-0[role="dialog"],
    #confirm-modal,
    #custom-prompt-modal,
    #family-modal {
        align-items: flex-end !important;
    }

    /* Contenu du modal en bottom sheet */
    .fixed.inset-0[role="dialog"] > div[role="document"],
    #confirm-modal > div,
    #custom-prompt-modal > div,
    #family-modal > div[role="document"] {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        border-radius: var(--radius-2xl) var(--radius-2xl) 0 0 !important;
        max-height: 85vh !important;
        animation: slideUp var(--transition-slow) var(--ease-out) !important;
    }

    /* Padding bottom pour safe area */
    .fixed.inset-0[role="dialog"] > div[role="document"],
    #confirm-modal > div,
    #custom-prompt-modal > div {
        padding-bottom: calc(var(--space-4) + var(--safe-area-bottom)) !important;
    }

    /* Handle de drag pour les modals mobile */
    .fixed.inset-0[role="dialog"] > div[role="document"]::before,
    #family-modal > div[role="document"]::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: var(--border-color);
        border-radius: var(--radius-full);
        margin: 0 auto var(--space-3);
    }
}

/* ========== ENHANCED TOUCH TARGETS ========== */
@media (hover: none) and (pointer: coarse) {
    /* Tous les éléments interactifs ont au moins 44px */
    button:not(.btn-sm),
    a:not(.text-xs):not(.text-sm),
    select,
    input[type="checkbox"],
    input[type="radio"] {
        min-height: var(--touch-target-min);
    }

    /* Checkboxes plus grandes */
    input[type="checkbox"] {
        width: 24px;
        height: 24px;
    }

    /* Select plus grands */
    select {
        padding: var(--space-3);
    }

    /* Boutons dans les listes */
    .space-y-2 button,
    .space-y-3 button,
    .space-y-4 button {
        min-height: var(--touch-target-min);
        padding: var(--space-3);
    }
}

/* ========== INPUT IMPROVEMENTS ========== */
input, select, textarea {
    font-size: 16px; /* Empêche le zoom sur iOS */
}

/* Focus ring amélioré */
input:focus, select:focus, textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* ========== UTILITY CLASSES ========== */
.gap-safe-bottom {
    padding-bottom: var(--safe-area-bottom);
}

.mb-safe-bottom {
    margin-bottom: var(--safe-area-bottom);
}

/* Spacing helpers */
.p-safe {
    padding: var(--space-4);
    padding-bottom: calc(var(--space-4) + var(--safe-area-bottom));
}

/* Hide on mobile */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Hide on desktop */
@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}
