/* ========================================
   CampoSano - Estilos Personalizados
   ======================================== */

/* =============================================================================
   1. COMPONENTES BASE
   ============================================================================= */

/* Fondos y efectos visuales */
.gradient-bg {
    background: linear-gradient(to right, #f0fdf4, #dcfce7, #bbf7d0);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Efectos de hover para tarjetas */
.card-hover {
    transition: all 0.3s ease-in-out;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Botones con gradiente */
.btn-gradient {
    background: linear-gradient(to right, #10b981, #059669);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease-in-out;
}

.btn-gradient:hover {
    background: linear-gradient(to right, #059669, #047857);
    box-shadow: 0 20px 25px -5px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

/* =============================================================================
   2. ESTILOS RESPONSIVOS
   ============================================================================= */

/* Scrollbars personalizados */
.scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f3f4f6;
}

.scrollbar-thin::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Tarjetas de diagnóstico móvil */
.diagnostic-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.diagnostic-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-color: #bbf7d0;
}

/* Mejora de contraste para legibilidad */
.text-contrast-high {
    color: #111827;
}

.text-contrast-medium {
    color: #374151;
}

.text-contrast-low {
    color: #4b5563;
}

/* =============================================================================
   3. ESTILOS GLOBALES
   ============================================================================= */

/* Configuración base del body */
body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
}

/* =============================================================================
   4. FORMULARIOS
   ============================================================================= */

/* Grupos de formulario */
.form-group {
    margin-bottom: 1.5rem;
}

/* Etiquetas de formulario */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* Campos de entrada */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
}

.form-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-input:invalid {
    border-color: #ef4444;
}

.form-input:invalid:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-input:valid {
    border-color: #10b981;
}

/* Mensajes de error y éxito */
.form-error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-success {
    color: #059669;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* =============================================================================
   5. BOTONES
   ============================================================================= */

/* Botón primario */
.btn-primary {
    background-color: #059669;
    color: white;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.btn-primary:hover {
    background-color: #047857;
}

.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.3);
}

/* Botón secundario */
.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

.btn-secondary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.3);
}

/* Botón de peligro */
.btn-danger {
    background-color: #dc2626;
    color: white;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-danger:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.3);
}

/* Botón outline */
.btn-outline {
    background-color: transparent;
    color: #059669;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border: 2px solid #059669;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.btn-outline:hover {
    background-color: #059669;
    color: white;
}

.btn-outline:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.3);
}

/* Estados de carga */
.btn-loading {
    opacity: 0.75;
    cursor: not-allowed;
}

.spinner {
    animation: spin 1s linear infinite;
    border-radius: 50%;
    height: 1rem;
    width: 1rem;
    border: 2px solid transparent;
    border-bottom-color: currentColor;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =============================================================================
   6. SISTEMA DE ESPACIADO
   ============================================================================= */

/* Espaciado vertical */
.space-y-consistent > * + * {
    margin-top: 1.5rem;
}

.space-y-tight > * + * {
    margin-top: 0.75rem;
}

.space-y-loose > * + * {
    margin-top: 2rem;
}

/* Espaciado horizontal */
.space-x-consistent > * + * {
    margin-left: 1.5rem;
}

.space-x-tight > * + * {
    margin-left: 0.75rem;
}

.space-x-loose > * + * {
    margin-left: 2rem;
}

/* =============================================================================
   7. ACCESIBILIDAD
   ============================================================================= */

/* Estilos de enfoque globales */
*:focus {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

/* Estilos focus-within */
.focus-within\:ring-2:focus-within {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
}

.focus-within\:border-green-500:focus-within {
    border-color: #10b981;
}

/* Solo para lectores de pantalla */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Enlace de salto para navegación por teclado */
.skip-link {
    position: absolute;
    top: -2.5rem;
    left: 1.5rem;
    background-color: #059669;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    z-index: 50;
    transition: all 0.2s ease-in-out;
}

.skip-link:focus {
    top: 1.5rem;
}

/* =============================================================================
   8. MEDIA QUERIES
   ============================================================================= */

/* Soporte para alto contraste */
@media (prefers-contrast: high) {
    .text-contrast-medium {
        color: #111827;
    }
    
    .text-contrast-low {
        color: #1f2937;
    }
}

/* Soporte para movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}