/**
 * Sistema MFCT - CSS de Autenticación
 * Estilos para login y registro
 */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 20% 50%, white 1px, transparent 1px),
                      radial-gradient(circle at 70% 80%, white 1px, transparent 1px);
    background-size: 100px 100px;
    opacity: 0.1;
}

.bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    padding: 3rem;
    width: 100%;
    max-width: 500px;
    margin: 2rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo img {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
}

.auth-title {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: #7f8c8d;
    margin-bottom: 1rem;
}

.system-info {
    font-size: 0.8rem;
    color: #95a5a6;
}

.auth-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 2px solid #ecf0f1;
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 1rem;
    cursor: pointer;
    color: #7f8c8d;
    font-size: 1rem;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.auth-tab.active {
    color: #3498db;
    border-bottom-color: #3498db;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: 600;
}

.input-wrapper {
    position: relative;
}

.form-control {
    width: 100%;
    padding: 1rem;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
}

.input-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #7f8c8d;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-container input {
    margin-right: 0.5rem;
}

.forgot-link {
    color: #3498db;
    text-decoration: none;
}

.forgot-link:hover {
    text-decoration: underline;
}

.btn-auth {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    margin-bottom: 1.5rem;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-auth.btn-primary {
    background: #3498db;
    color: white;
}

.btn-auth.btn-primary:hover {
    background: #2980b9;
}

.btn-loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-auth.loading .btn-text {
    display: none;
}

.btn-auth.loading .btn-loading {
    display: flex;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.role-selector {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.role-option {
    position: relative;
}

.role-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.role-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.role-option input[type="radio"]:checked + .role-label {
    border-color: #3498db;
    background: #f8f9fa;
}

.role-icon {
    font-size: 1.5rem;
}

.role-text strong {
    display: block;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.role-text small {
    color: #7f8c8d;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.password-strength {
    margin-top: 0.5rem;
}

.strength-bar {
    height: 4px;
    background: #ecf0f1;
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    background: #e74c3c;
    transition: all 0.3s ease;
}

.strength-text {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-top: 0.25rem;
}

.alert-container {
    margin-bottom: 2rem;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-error {
    background: #fadbd8;
    color: #e74c3c;
    border-left-color: #e74c3c;
}

.alert-success {
    background: #d5f4e6;
    color: #27ae60;
    border-left-color: #27ae60;
}

.alert-info {
    background: #d6eaf8;
    color: #3498db;
    border-left-color: #3498db;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #ecf0f1;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: #7f8c8d;
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: #3498db;
}

.footer-text {
    font-size: 0.8rem;
    color: #95a5a6;
}

.footer-text p {
    margin-bottom: 0.25rem;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ecf0f1;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .auth-container {
        margin: 1rem;
        padding: 2rem;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.logo img {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
}

/* Fallback si la imagen falla */
.logo img:after {
    content: "🎓";
    font-size: 4rem;
    display: block;
    text-align: center;
}

.logo-text {
    font-size: 4rem;
    margin-bottom: 1rem;
    text-align: center;
}