/* ============================================
   Login - Dashboard DDS
   Estilos para la página de inicio de sesión
   ============================================ */

/* Reset y variables */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --error-color: #dc2626;
    --error-bg: #fef2f2;
    --success-color: #16a34a;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --bg-color: #f9fafb;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-primary);
}

/* Container principal */
.login-container {
    width: 100%;
    max-width: 440px;
    animation: fadeIn 0.5s ease-out;
}

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

/* Caja de login */
.login-box {
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    padding: 40px;
    position: relative;
}

/* Header */
.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--white);
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 400;
}

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

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

.form-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-secondary);
    pointer-events: none;
}

.form-input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    font-size: 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
    background: var(--white);
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Toggle password button */
.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.toggle-password:hover {
    background-color: var(--bg-color);
}

.eye-icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

/* Mensajes de error */
.error-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background-color: var(--error-bg);
    border: 1px solid var(--error-color);
    border-radius: 10px;
    color: var(--error-color);
    font-size: 14px;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.error-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Botón de login */
.login-button {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-md);
    margin-top: 8px;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.login-button:active {
    transform: translateY(0);
}

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.button-icon {
    width: 20px;
    height: 20px;
}

/* Loading spinner */
.loading-spinner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 10;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
}

/* Footer */
.login-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.footer-text-small {
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 480px) {
    .login-box {
        padding: 28px 24px;
    }

    .login-title {
        font-size: 24px;
    }

    .login-subtitle {
        font-size: 14px;
    }

    .form-input {
        font-size: 16px; /* Previene zoom en iOS */
    }
}

/* Dark mode support (opcional) */
@media (prefers-color-scheme: dark) {
    /* Puedes agregar estilos para modo oscuro aquí si lo deseas */
}
