﻿/* ===============================================
   MODERN LOGIN STYLES - UNAMAD SYSTEM
=============================================== */

/* CSS Variables */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-muted: #a0aec0;
    --error-color: #e53e3e;
    --success-color: #38a169;
    --border-radius: 16px;
    --shadow-soft: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 20px 40px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
    box-sizing: border-box;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    padding: 20px;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Glass Card */
.login-glass-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    box-shadow: var(--shadow-medium);
    padding: 40px;
    animation: slideIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Section */
.login-header {
    margin-bottom: 32px;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(103, 126, 234, 0.1);
    border: 1px solid rgba(103, 126, 234, 0.2);
}

    .back-button:hover {
        color: #667eea;
        background: rgba(103, 126, 234, 0.2);
        transform: translateX(-2px);
    }

    .back-button svg {
        transition: var(--transition);
    }

    .back-button:hover svg {
        transform: translateX(-2px);
    }

/* Brand Section */
.brand-section {
    text-align: center;
    margin-bottom: 40px;
}

.brand-logo {
    margin-bottom: 16px;
}

.logo-circle {
    width: 80px;
    height: 80px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 8px 32px rgba(103, 126, 234, 0.3);
    color: white;
    animation: pulse 2s ease-in-out infinite alternate;
}

@keyframes pulse {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.05);
    }
}

.brand-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 8px 0;
    letter-spacing: -1px;
}

.brand-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
    margin: 0;
}

/* Form Section */
.form-section {
    margin-bottom: 32px;
}

.form-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 32px 0;
    text-align: center;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-left: 4px;
}

/* Modern Input Styles */
.modern-input .mud-input-outlined .mud-input-outlined-border {
    border: 2px solid #e2e8f0 !important;
    border-radius: var(--border-radius) !important;
    transition: var(--transition) !important;
}

.modern-input .mud-input.mud-input-outlined {
    padding: 16px !important;
    font-size: 16px !important;
    background: rgba(255, 255, 255, 0.8) !important;
    color: var(--text-primary) !important;
}

.modern-input.mud-input-outlined:hover .mud-input-outlined-border {
    border-color: #cbd5e0 !important;
}

.modern-input.mud-input-outlined.mud-input-focused .mud-input-outlined-border {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(103, 126, 234, 0.1) !important;
}

.modern-input .mud-input-label {
    display: none !important;
}

/* Password Field */
.password-field {
    position: relative;
    margin-left: -20px; /* Mueve 20px hacia la izquierda */
}

.password-input {
    padding-right: 50px !important;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

    .password-toggle:hover {
        color: #667eea;
        background: rgba(103, 126, 234, 0.1);
    }

    .password-toggle:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* Error Alert */
.error-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(229, 62, 62, 0.1);
    border: 1px solid rgba(229, 62, 62, 0.2);
    border-radius: var(--border-radius);
    color: var(--error-color);
    font-size: 14px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--error-color);
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    transition: var(--transition);
}

    .error-close:hover {
        background: rgba(229, 62, 62, 0.1);
    }

/* Submit Button */
.submit-button {
    width: 100%;
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(103, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

    .submit-button::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s;
    }

    .submit-button:hover::before {
        left: 100%;
    }

    .submit-button:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(103, 126, 234, 0.4);
    }

    .submit-button:active {
        transform: translateY(0);
    }

    .submit-button:disabled {
        opacity: 0.7;
        cursor: not-allowed;
        transform: none;
    }

/* Loading Spinner */
.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Test Section */
.test-section {
    margin-top: 32px;
}

.test-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
    margin-bottom: 24px;
}

.test-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
    text-align: center;
}

.test-user-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.test-user-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

    .test-user-card:hover {
        background: rgba(103, 126, 234, 0.05);
        border-color: #667eea;
        transform: translateY(-1px);
    }

.test-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.test-username {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.test-credentials {
    font-size: 10px;
    color: var(--text-secondary);
}

.test-user-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: white;
}

    .test-user-badge.victoria {
        background: var(--success-color);
    }

    .test-user-badge.luis {
        background: var(--secondary-gradient);
    }

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 32px;
}

    .login-footer p {
        font-size: 14px;
        color: var(--text-muted);
        margin: 0;
    }

/* Responsive Design */
@media (max-width: 480px) {
    .login-glass-card {
        padding: 24px;
        margin: 16px;
        border-radius: 20px;
    }

    .brand-title {
        font-size: 2rem;
    }

    .logo-circle {
        width: 64px;
        height: 64px;
    }

    .test-user-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f7fafc;
        --text-secondary: #e2e8f0;
        --text-muted: #a0aec0;
    }

    .login-glass-card {
        background: rgba(26, 32, 44, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .modern-input .mud-input.mud-input-outlined {
        background: rgba(45, 55, 72, 0.6) !important;
        color: var(--text-primary) !important;
    }

    .modern-input .mud-input-outlined .mud-input-outlined-border {
        border-color: rgba(255, 255, 255, 0.1) !important;
    }

    .test-user-card {
        background: rgba(45, 55, 72, 0.6);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
.back-button:focus,
.password-toggle:focus,
.submit-button:focus,
.test-user-card:focus,
.error-close:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .login-glass-card {
        background: white;
        border: 2px solid #000;
    }

    .submit-button {
        background: #000;
    }
}
