/* auth/css/auth.css */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #059669;
    --error-color: #dc2626;
    --warning-color: #d97706;
    --info-color: #0891b2;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-accent: #f1f5f9;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-focus: #3b82f6;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* Reset y base */
* {
    box-sizing: border-box;
}

.auth-body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

/* Fondo animado */
.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.auth-bg-pattern {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.1) 2px, transparent 2px);
    background-size: 50px 50px;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* Container principal */
.auth-container {
    display: flex;
    max-width: 1200px;
    width: 100%;
    margin: 2rem;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    min-height: 600px;
}

/* Tarjeta de autenticación */
.auth-card {
    flex: 1;
    max-width: 500px;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Header */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: var(--shadow-lg);
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--text-primary);
}

.auth-header p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 1.1rem;
}

/* Contenido */
.auth-content {
    flex: 1;
}

/* Formulario */
.auth-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--bg-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Input de contraseña */
.password-input {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: var(--text-secondary);
}

/* Checkbox */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
}

.form-check-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 48px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-login {
    width: 100%;
    font-size: 1.1rem;
    padding: 1rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Enlaces */
.auth-links {
    text-align: center;
    margin: 1.5rem 0;
}

.link-primary {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
}

.link-primary:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Divisor */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 2rem 0;
    color: var(--text-muted);
    position: relative;
}

.auth-divider::before {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    padding: 0 1rem;
    background: var(--bg-primary);
    font-size: 0.9rem;
}

/* Registro */
.auth-register {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-register p {
    margin: 0 0 1rem;
    color: var(--text-secondary);
}

.auth-register .btn {
    width: 100%;
}

/* Enlaces del footer */
.auth-footer-links {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.auth-footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
}

.auth-footer-links a:hover {
    color: var(--text-secondary);
}

/* Panel de características */
.auth-features {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.auth-features::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><circle cx="30" cy="30" r="2"/></g></g></svg>');
    animation: float 15s ease-in-out infinite reverse;
}

.auth-features h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.auth-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 1;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    opacity: 0.9;
}

.auth-features li i {
    width: 24px;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Alertas */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.alert-danger {
    background: rgba(220, 38, 38, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.alert-warning {
    background: rgba(217, 119, 6, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.alert-info {
    background: rgba(8, 145, 178, 0.1);
    color: var(--info-color);
    border: 1px solid rgba(8, 145, 178, 0.2);
}

/* Steps para registro multi-paso */
.auth-steps {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.auth-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    position: relative;
}

.auth-step.active {
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
}

.auth-step.completed {
    color: var(--success-color);
}

.auth-step:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -1rem;
    width: 2rem;
    height: 1px;
    background: var(--border-color);
}

/* Responsive */
@media (max-width: 968px) {
    .auth-container {
        flex-direction: column;
        max-width: 500px;
        margin: 1rem;
    }
    
    .auth-features {
        order: -1;
        padding: 2rem;
        text-align: center;
    }
    
    .auth-features h3 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .auth-features ul {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .auth-features li {
        margin-bottom: 0;
        font-size: 0.95rem;
    }
}

@media (max-width: 640px) {
    .auth-body {
        padding: 0;
    }
    
    .auth-container {
        margin: 0;
        border-radius: 0;
        min-height: 100vh;
    }
    
    .auth-card {
        padding: 2rem 1.5rem;
    }
    
    .auth-features ul {
        grid-template-columns: 1fr;
    }
    
    .auth-header h1 {
        font-size: 1.75rem;
    }
    
    .auth-logo {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

/* Animaciones */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    animation: slideIn 0.6s ease-out;
}

.auth-features {
    animation: slideIn 0.6s ease-out 0.2s both;
}

/* Estados de carga */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent
    );
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Focus visible para accesibilidad */
.btn:focus-visible,
.form-control:focus-visible,
.form-check-input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Dark mode (opcional) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1e293b;
        --bg-secondary: #0f172a;
        --bg-accent: #334155;
        
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
        --text-muted: #64748b;
        
        --border-color: #334155;
    }
    
    .auth-body {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    }
}