:root {
    /* Default/Winter theme colors (light) */
    --color-primary: #667eea;
    --color-primary-dark: #5a67d8;
    --color-secondary: #764ba2;
    --color-success: #48bb78;
    --color-error: #f56565;
    --color-warning: #ed8936;
    
    --bg-body: #f7fafc;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --bg-input-focus: #ffffff;
    
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-tertiary: #a0aec0;
    
    --border-color: #e2e8f0;
    --border-focus: #667eea;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Tema claro - Winter */
[data-theme="winter"] {
    --bg-body: #f7fafc;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --bg-input-focus: #ffffff;
    
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --text-tertiary: #a0aec0;
    
    --border-color: #e2e8f0;
    --border-focus: #667eea;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Tema oscuro - Night */
[data-theme="night"] {
    --bg-body: #1a202c;
    --bg-card: #2d3748;
    --bg-input: #4a5568;
    --bg-input-focus: #4a5568;
    
    --text-primary: #f7fafc;
    --text-secondary: #cbd5e0;
    --text-tertiary: #a0aec0;
    
    --border-color: #4a5568;
    --border-focus: #667eea;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
    padding-left: calc(5% + 10rem);
    transition: background 0.3s ease, color 0.3s ease;
    background-image: url('/shared/img/fondo1.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.login-container {
    width: 100%;
    max-width: 450px;
    position: relative;
    transform: translateY(-5rem);
}

.login-card {
    background: transparent;
    border-radius: 20px;
    box-shadow: none;
    padding: 24px 40px;
    transition: all 0.3s ease;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.logo img {
    width: 340px;
    height: auto;
    max-width: 100%;
}

.welcome-text {
    text-align: center;
    margin-bottom: 20px;
}

.welcome-text h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.welcome-text p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: rgba(72, 187, 120, 0.1);
    color: var(--color-success);
    border: 1px solid rgba(72, 187, 120, 0.3);
}

.alert-error {
    background: rgba(245, 101, 101, 0.1);
    color: var(--color-error);
    border: 1px solid rgba(245, 101, 101, 0.3);
}

.alert-warning {
    background: rgba(237, 137, 54, 0.1);
    color: var(--color-warning);
    border: 1px solid rgba(237, 137, 54, 0.3);
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    pointer-events: none;
    transition: color 0.2s ease;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 12px 12px 44px;
    font-size: 15px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.15);
    border: 3px solid #ffffff;
    border-radius: 10px;
    transition: all 0.2s ease;
    outline: none;
}

.input-wrapper input:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.input-wrapper input:focus + .input-icon {
    color: var(--color-primary);
}

.input-wrapper input::placeholder {
    color: var(--text-tertiary);
}

.toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    transition: color 0.2s ease;
}

.toggle-password:hover {
    color: var(--text-secondary);
}

.toggle-password svg {
    width: 20px;
    height: 20px;
}

.error-message {
    font-size: 13px;
    color: var(--color-error);
    display: none;
}

.error-message.show {
    display: block;
}

/* Form options */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -6px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #000000;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.forgot-password {
    font-size: 14px;
    color: #000000;
    text-decoration: none;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: #333333;
    text-decoration: underline;
}

/* Submit button */
.btn-submit {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    color: #000000;
    background: #ffffff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 4px;
    position: relative;
    overflow: hidden;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.4);
    background: #f0f0f0;
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    animation: rotate 2s linear infinite;
    width: 24px;
    height: 24px;
}

.spinner .path {
    stroke: white;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Footer */
.login-footer {
    margin-top: 20px;
    text-align: center;
}

.login-footer p {
    font-size: 13px;
    color: #000000;
}

/* Theme toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 480px) {
    body {
        justify-content: center;
        padding-left: 20px;
    }
    
    .login-container {
        transform: translateY(0);
    }
    
    .login-card {
        padding: 20px 24px;
    }
    
    .logo img {
        width: 280px;
    }
    
    .welcome-text h2 {
        font-size: 20px;
    }
    
    .theme-toggle {
        top: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
    }
    
    .theme-toggle svg {
        width: 20px;
        height: 20px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}
