/* 
    SISTEMA DE DISEÑO UROGESTIÓN - PREMIUM PWA
    Colores, Tipografía y Estilos Base
*/

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
    /* Paleta de Colores */
    --primary: #007b8a;
    --primary-light: #7ac8be;
    --secondary: #8dc63f;
    --dark: #333333;
    --light: #f4f7f6;
    --white: #ffffff;
    --accent: #ff6b6b;
    --gradient-primary: linear-gradient(135deg, #007b8a 0%, #005a66 100%);
    --gradient-glass: rgba(255, 255, 255, 0.9);
    
    /* Sombras y Efectos */
    --shadow-sm: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

/* --- Layouts Base --- */
.app-container {
    width: 100%;
    margin: 0 auto;
    min-height: 100vh;
}

/* --- Estilos para el Mapa (Leaflet) --- */
#map {
    width: 100%;
    height: 350px; /* Altura obligatoria para que el mapa sea visible */
    z-index: 1;
}

.stats-container {
    padding: 1.5rem;
    background: var(--white);
    border-top-left-radius: 25px;
    border-top-right-radius: 25px;
    margin-top: -20px;
    position: relative;
    z-index: 10;
}

.provincia-badge {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid #f1f5f9;
}

h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

/* El layout se encuentra ahora en pwa.css para separar contextos */


/* --- Botones Premium con Efectos --- */
.btn-premium {
    background: var(--gradient-primary);
    color: var(--white);
    border: none;
    padding: 16px 24px;
    border-radius: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 123, 138, 0.2);
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    position: relative;
    overflow: hidden;
}

.btn-premium:active {
    transform: scale(0.96);
    box-shadow: 0 2px 6px rgba(0, 123, 138, 0.1);
}

.btn-premium::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.4);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn-premium:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% { transform: scale(0, 0); opacity: 0.5; }
    100% { transform: scale(40, 40); opacity: 0; }
}

/* --- Tarjetas Estilo iOS con Feedback --- */
.card {
    background: var(--white);
    border-radius: 24px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.04);
    transition: var(--transition);
    user-select: none;
}

.card:active {
    transform: scale(0.98);
    background-color: #fafafa;
}

/* Animación de entrada para tarjetas */
.card {
    animation: slideUpFade 0.4s ease-out forwards;
}

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

/* --- Estados Dinámicos --- */
.pulse {
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% { box-shadow: 0 0 0 0px rgba(0, 123, 138, 0.2); }
    100% { box-shadow: 0 0 0 15px rgba(0, 123, 138, 0); }
}





/* --- Formularios Premium --- */
.form-group {
    margin-bottom: 1.25rem;
    width: 100%;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
    margin-left: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    background: var(--white);
    border: 2px solid transparent;
    border-radius: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--dark);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(0, 123, 138, 0.1);
}

/* --- Pantalla de Login --- */
.login-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem 1.5rem;
    min-height: 50vh;
}

/* --- Estados de Fases Hospitalarias --- */
.phase-tag {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.phase-1 { background: #e0f2fe; color: #0369a1; } /* Introducción */
.phase-2 { background: #fef3c7; color: #b45309; } /* Visita */
.phase-3 { background: #dcfce7; color: #15803d; } /* Pruebas */
.phase-4 { background: #f3f4f6; color: #374151; } /* Implantado */

/* --- Modo Oscuro Automático (Refinado) --- */
@media (prefers-color-scheme: dark) {
    :root {
        --light: #0a0a0a;
        --white: #171717;
        --dark: #e5e7eb;
        --shadow-sm: 0 4px 6px rgba(0,0,0,0.4);
        --shadow-md: 0 10px 20px rgba(0,0,0,0.5);
        --shadow-lg: 0 20px 40px rgba(0,0,0,0.6);
        --gradient-glass: rgba(23, 23, 23, 0.85);
    }
    
    body { background-color: #000; }
    
    .card {
        border-color: rgba(255, 255, 255, 0.03);
        background: #171717;
    }
    
    .bottom-nav {
        background: rgba(23, 23, 23, 0.9);
        border-top-color: rgba(255, 255, 255, 0.03);
    }
    
    .form-control {
        background: #262626;
        border-color: transparent;
        color: white;
    }

    .info-item {
        background: #1f1f1f !important;
    }
}

/* --- Esqueleto de Carga (Skeleton) --- */
.skeleton {
    background: linear-gradient(90deg, var(--light) 25%, #e5e7eb 50%, var(--light) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

@media (prefers-color-scheme: dark) {
    .skeleton {
        background: linear-gradient(90deg, #171717 25%, #262626 50%, #171717 75%);
    }
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Utilitarios --- */
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.glass { background: var(--gradient-glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }


