/* =====================================================
   VARIABLES Y RESET
   ===================================================== */

:root {
    color-scheme: dark; /* Global dark mode for native UI */
    /* Colores */
    --bg-primary: #000000;
    --bg-secondary: #09090B;
    --bg-tertiary: #18181B;

    --primary-400: #4ADE80;
    --primary-500: #22C55E;
    --primary-600: #16A34A;
    --primary-700: #15803D;

    --text-primary: #FFFFFF;
    --text-secondary: #E4E4E7;
    --text-tertiary: #A1A1AA;
    --text-quaternary: #71717A;

    /* Espaciado */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    --spacing-3xl: 64px;

    /* Fuentes */
    --font-display: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Inter', sans-serif;
}

html {
    color-scheme: dark;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Fix for white-on-white dropdowns in some browsers */
option {
    background-color: #0f172a !important;
    color: #ffffff !important;
}

select {
    color-scheme: dark !important;
}


body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    color-scheme: dark;
}

/* =====================================================
   PARTÍCULAS DE FONDO
   ===================================================== */

.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-500);
    border-radius: 50%;
    opacity: 0.3;
    animation: float-particle 20s infinite ease-in-out;
}

@keyframes float-particle {

    0%,
    100% {
        transform: translate(0, 0);
        opacity: 0.3;
    }

    25% {
        transform: translate(100px, -100px);
        opacity: 0.6;
    }

    50% {
        transform: translate(-50px, -200px);
        opacity: 0.4;
    }

    75% {
        transform: translate(-100px, -100px);
        opacity: 0.6;
    }
}

/* =====================================================
   LOGIN CONTAINER
   ===================================================== */

.login-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-lg);
}

.login-card {
    width: 100%;
    max-width: 480px;
    padding: var(--spacing-2xl);
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glass-card {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.02) 50%,
            rgba(255, 255, 255, 0.03) 100%);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    box-shadow:
        0 8px 32px 0 rgba(0, 0, 0, 0.37),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

select, .form-select, .filter-select, .filter-select-sm, input[type="text"], input[type="number"], input[type="date"], textarea {
    background: #0f172a !important; 
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    color: white !important;
    color-scheme: dark !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.95rem !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    outline: none !important;
}

select:hover, .form-select:hover, input:hover {
    background-color: #1e293b !important;
    border-color: var(--primary-500) !important;
}

select, .form-select {
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.6)' stroke-width='2' %3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 16px !important;
    padding-right: 40px !important;
}


/* =====================================================
   LOGIN HEADER
   ===================================================== */

.login-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: var(--spacing-lg);
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--primary-400);
}

.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-md);
}

.logo-svg {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 0 20px rgba(34, 197, 94, 0.5));
}

.login-header h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--text-tertiary);
    font-size: 1rem;
}

/* =====================================================
   FORMULARIO
   ===================================================== */

.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.form-group label {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(34, 197, 94, 0.05);
    border: 2px solid rgba(34, 197, 94, 0.2);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input::placeholder {
    color: var(--text-quaternary);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-500);
    background: rgba(34, 197, 94, 0.08);
    box-shadow:
        0 0 0 4px rgba(34, 197, 94, 0.1),
        0 0 20px rgba(34, 197, 94, 0.3);
}

.password-input-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--primary-400);
}

/* =====================================================
   OPCIONES DEL FORMULARIO
   ===================================================== */

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    user-select: none;
}

.checkbox-container input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(34, 197, 94, 0.3);
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-container input[type="checkbox"]:checked~.checkmark {
    background: var(--primary-500);
    border-color: var(--primary-500);
}

.checkbox-container input[type="checkbox"]:checked~.checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label {
    color: var(--text-secondary);
}

.forgot-password {
    color: var(--primary-400);
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: var(--primary-300);
    text-decoration: underline;
}

/* =====================================================
   BOTONES
   ===================================================== */

.btn {
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-500));
    color: #000;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.6);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-login {
    width: 100%;
    margin-top: var(--spacing-md);
}

.btn-loader {
    display: inline-flex;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.3);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =====================================================
   MENSAJES
   ===================================================== */

.form-message {
    padding: 14px 18px;
    border-radius: 12px;
    font-weight: 500;
    text-align: center;
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-message.success {
    background: rgba(34, 197, 94, 0.15);
    border: 2px solid var(--primary-500);
    color: var(--primary-400);
}

.form-message.error {
    background: rgba(239, 68, 68, 0.15);
    border: 2px solid #EF4444;
    color: #FCA5A5;
}

/* =====================================================
   CREDENCIALES DEMO
   ===================================================== */

.demo-credentials {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.1);
    border-radius: 12px;
}

.demo-title {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--primary-400);
    margin-bottom: var(--spacing-md);
    text-align: center;
}

.demo-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.demo-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.demo-item strong {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.demo-item code {
    background: rgba(34, 197, 94, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--primary-400);
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

/* =====================================================
   FOOTER
   ===================================================== */

.login-footer {
    margin-top: var(--spacing-xl);
    text-align: center;
    color: var(--text-quaternary);
    font-size: 0.875rem;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 768px) {
    .login-card {
        padding: var(--spacing-lg);
    }

    .login-header h1 {
        font-size: 1.75rem;
    }

    .form-options {
        flex-direction: column;
        gap: var(--spacing-sm);
        align-items: flex-start;
    }

    .demo-grid {
        gap: var(--spacing-md);
    }
}

/* =====================================================
   NOTIFICACIONES PUSH (TOASTS)
   ===================================================== */
.push-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(24, 24, 27, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 320px;
    max-width: 400px;
}

.push-notification.show {
    transform: translateX(0);
}

.notification-icon {
    font-size: 1.5rem;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    margin-bottom: 2px;
}

.notification-body {
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: #a1a1aa;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: #71717a;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.3s ease;
}

.notification-close:hover {
    color: #fff;
}

@media (max-width: 768px) {
    .push-notification {
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
        bottom: 10px;
    }
}