/* public/css/app.css - REEMPLAZAR TODO */

/**
 * Sistema Municipal - Diseño Moderno
 * Inspirado en: Airbnb, Stripe, Notion
 */

/* ============================================
   IMPORTS Y RESET
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colores primarios con gradientes */
    --primary-start: #667eea;
    --primary-end: #764ba2;
    --secondary-start: #f093fb;
    --secondary-end: #f5576c;
    --success-start: #4facfe;
    --success-end: #00f2fe;
    --accent-start: #fa709a;
    --accent-end: #fee140;
    
    /* Neutrales */
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    
    /* Tipografía */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Sombras modernas */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    
    /* Espaciado */
    --spacing-1: 0.25rem;
    --spacing-2: 0.5rem;
    --spacing-3: 0.75rem;
    --spacing-4: 1rem;
    --spacing-5: 1.25rem;
    --spacing-6: 1.5rem;
    --spacing-8: 2rem;
    --spacing-10: 2.5rem;
    --spacing-12: 3rem;
    
    /* Radios */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --radius-full: 9999px;
    
    /* Transiciones */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   BASE
   ============================================ */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--gray-900);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* ============================================
   PÁGINA DE AUTENTICACIÓN
   ============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-6);
    position: relative;
    overflow: hidden;
}

/* Decoración de fondo */
.auth-page::before {
    content: '';
    position: absolute;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    top: -400px;
    right: -400px;
    animation: float 20s ease-in-out infinite;
}

.auth-page::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    bottom: -300px;
    left: -300px;
    animation: float 15s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(50px, 50px); }
}

/* Contenedor principal */
.auth-container {
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 10;
    animation: slideInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Logo y marca */
.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-8);
}

.auth-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-4);
    background: white;
    border-radius: var(--radius-2xl);
    padding: var(--spacing-4);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.auth-title {
    color: white;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: var(--spacing-2);
    letter-spacing: -0.02em;
}

.auth-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 400;
}

/* Card glassmorphism */
.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-2xl);
    padding: var(--spacing-10);
    box-shadow: var(--shadow-2xl);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.auth-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--spacing-2);
}

.auth-card-subtitle {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: var(--spacing-8);
}

/* ============================================
   FORMULARIOS MODERNOS
   ============================================ */
.form-group {
    margin-bottom: var(--spacing-6);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--spacing-2);
}

.form-input {
    width: 100%;
    padding: var(--spacing-4);
    font-size: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    background: white;
    font-family: var(--font-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-start);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.input-large {
    padding: var(--spacing-5);
    font-size: 1.125rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.1em;
}

.form-hint {
    display: block;
    margin-top: var(--spacing-2);
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ============================================
   BOTONES MODERNOS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
    padding: var(--spacing-4) var(--spacing-6);
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-primary);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.btn:hover::before {
    transform: translateX(100%);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    color: white;
    box-shadow: 0 4px 14px 0 rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-large {
    padding: var(--spacing-5) var(--spacing-8);
    font-size: 1.125rem;
}

.btn-block {
    width: 100%;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   ALERTAS Y NOTIFICACIONES
   ============================================ */
.alert {
    padding: var(--spacing-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-4);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-3);
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
}

.alert-success {
    background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
    color: white;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast {
    position: fixed;
    top: var(--spacing-6);
    right: var(--spacing-6);
    background: white;
    padding: var(--spacing-4) var(--spacing-6);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    z-index: 9999;
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-success {
    border-left: 4px solid #51cf66;
}

.toast-error {
    border-left: 4px solid #ff6b6b;
}

/* ============================================
   UTILIDADES
   ============================================ */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
    :root {
        --spacing-10: 1.5rem;
        --spacing-12: 2rem;
    }
    
    .auth-card {
        padding: var(--spacing-8);
    }
    
    .auth-title {
        font-size: 1.5rem;
    }
    
    .toast {
        left: var(--spacing-4);
        right: var(--spacing-4);
        top: var(--spacing-4);
    }
}

/* ============================================
   ANIMACIONES ADICIONALES
   ============================================ */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.scale-in {
    animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}