/* ========================================
   TCF CLB7 - Login Page Styles
======================================== */

.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
    display: flex;
    flex-direction: column;
}

.login-page .header {
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.login-page .nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Login Section */
.login-section {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 120px 0 60px;
}

.login-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.login-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-3xl);
    align-items: stretch;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    min-height: 700px;
}

/* Welcome Side */
.login-welcome {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 50%, var(--primary-blue-dark) 100%);
    padding: var(--spacing-3xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    min-height: 700px;
    height: 100%;
}

.welcome-content {
    max-width: 400px;
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--spacing-lg);
}

.welcome-logo {
    max-width: 200px;
    height: auto;
    margin: 0 auto;
    filter: brightness(0) invert(1);
}

.welcome-content h2 {
    color: var(--white);
    margin-bottom: 0;
    font-size: 2rem;
}

.welcome-content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.125rem;
    margin-bottom: 0;
}

.welcome-features {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    text-align: left;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.feature-item i {
    color: var(--white);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.feature-item span {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
}

.demo-credentials {
    margin-top: 0;
    padding: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.demo-credentials p {
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: var(--spacing-xs);
    font-size: 0.875rem;
}

.demo-credentials p:first-child {
    margin-bottom: var(--spacing-sm);
}

.demo-credentials small {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Login Form Side */
.login-form-wrapper {
    padding: var(--spacing-3xl);
    display: flex;
    align-items: center;
    height: 100%;
}

.login-form-container {
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
}

.login-form-container h1 {
    color: var(--gray-900);
    margin-bottom: var(--spacing-sm);
    font-size: 2rem;
}

.login-subtitle {
    color: var(--gray-600);
    font-size: 1rem;
    margin-bottom: var(--spacing-xl);
}

/* User Type Toggle */
.user-type-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-2xl);
    padding: var(--spacing-xs);
    background: var(--gray-100);
    border-radius: var(--radius-lg);
}

.user-type-toggle input[type="radio"] {
    display: none;
}

.user-type-toggle label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-lg);
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.9375rem;
}

.user-type-toggle label i {
    font-size: 1.5rem;
    transition: all var(--transition-normal);
}

.user-type-toggle input[type="radio"]:checked + label {
    background: var(--white);
    color: var(--primary-blue);
    box-shadow: var(--shadow-md);
}

.user-type-toggle input[type="radio"]#type-aluno:checked + label {
    color: var(--primary-blue);
}

.user-type-toggle input[type="radio"]#type-professor:checked + label {
    color: var(--primary-red);
}

.user-type-toggle label:hover {
    color: var(--gray-900);
}

.user-type-toggle input[type="radio"]:checked + label i {
    transform: scale(1.1);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.login-form .form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.login-form label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.login-form label i {
    color: var(--primary-red);
    font-size: 0.875rem;
}

.login-form input {
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-family: var(--font-secondary);
    font-size: 1rem;
    transition: all var(--transition-fast);
    background: var(--white);
}

.login-form select {
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-family: var(--font-secondary);
    font-size: 1rem;
    transition: all var(--transition-fast);
    background: var(--white);
    cursor: pointer;
}

.login-form select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.form-help {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 3rem;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.5rem;
    transition: color var(--transition-fast);
}

.toggle-password:hover {
    color: var(--primary-blue);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: calc(var(--spacing-sm) * -1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--gray-700);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.forgot-password {
    color: var(--primary-blue);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.forgot-password:hover {
    color: var(--primary-red);
}

.login-divider {
    position: relative;
    text-align: center;
    margin: var(--spacing-xl) 0;
}

.login-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gray-200);
}

.login-divider span {
    position: relative;
    background: var(--white);
    padding: 0 var(--spacing-md);
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Social Login */
.social-login {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.btn-social {
    width: 100%;
    padding: 0.875rem 1.5rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--white);
    font-family: var(--font-primary);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
}

.btn-social:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-google {
    color: #DB4437;
}

.btn-google:hover {
    border-color: #DB4437;
    background: rgba(219, 68, 55, 0.05);
}

.btn-facebook {
    color: #1877F2;
}

.btn-facebook:hover {
    border-color: #1877F2;
    background: rgba(24, 119, 242, 0.05);
}

.btn-social i {
    font-size: 1.125rem;
}

/* Register Link */
.register-link {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--gray-200);
}

.register-link p {
    color: var(--gray-600);
    margin-bottom: 0;
}

.register-link a {
    color: var(--primary-blue);
    font-weight: 600;
    transition: color var(--transition-fast);
}

.register-link a:hover {
    color: var(--primary-red);
}

/* Login Footer */
.login-footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: var(--spacing-xl) 0;
}

.login-footer .footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.login-footer p {
    margin-bottom: 0;
}

.login-footer .footer-links {
    display: flex;
    gap: var(--spacing-xl);
}

.login-footer .footer-links a {
    color: var(--gray-500);
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

.login-footer .footer-links a:hover {
    color: var(--white);
}

/* Responsive */
@media (max-width: 1024px) {
    .login-grid {
        grid-template-columns: 1fr;
    }
    
    .login-welcome {
        min-height: 400px;
    }
    
    .welcome-content {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .login-section {
        padding: 100px 0 40px;
    }
    
    .login-welcome {
        padding: var(--spacing-2xl);
        min-height: 300px;
    }
    
    .welcome-logo {
        max-width: 150px;
    }
    
    .welcome-content h2 {
        font-size: 1.5rem;
    }
    
    .welcome-content p {
        font-size: 1rem;
    }
    
    .login-form-wrapper {
        padding: var(--spacing-2xl);
    }
    
    .login-form-container h1 {
        font-size: 1.5rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }
    
    .login-footer .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .login-footer .footer-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 0 var(--spacing-md);
    }
    
    .login-welcome {
        padding: var(--spacing-xl);
    }
    
    .login-form-wrapper {
        padding: var(--spacing-lg);
    }
    
    .social-login {
        gap: var(--spacing-sm);
    }
    
    .btn-social {
        font-size: 0.875rem;
        padding: 0.75rem 1rem;
    }
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-form-container {
    animation: fadeInUp 0.6s ease;
}

.welcome-content {
    animation: fadeInUp 0.6s ease 0.2s both;
}

/* ========================================
   Firebase Authentication Messages
======================================== */
.auth-message {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    animation: slideInDown 0.3s ease;
    font-size: 0.9375rem;
    font-weight: 500;
}

.auth-message i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.auth-message-success {
    background-color: #d1f2eb;
    color: #0f5132;
    border-left: 4px solid #198754;
}

.auth-message-error {
    background-color: #f8d7da;
    color: #842029;
    border-left: 4px solid #dc3545;
}

.auth-message-info {
    background-color: #cfe2ff;
    color: #084298;
    border-left: 4px solid #0d6efd;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Debug Modal Styles
======================================== */
.debug-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.debug-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUpIn 0.4s ease;
}

.debug-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 12px 12px 0 0;
}

.debug-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.debug-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.debug-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.debug-modal-body {
    padding: 25px;
}

.debug-section {
    margin-bottom: 25px;
}

.debug-step {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 4px solid #dee2e6;
    transition: all 0.3s;
}

.debug-step.processing {
    border-left-color: #ffc107;
    background: #fff8e1;
}

.debug-step.success {
    border-left-color: #28a745;
    background: #d4edda;
}

.debug-step.error {
    border-left-color: #dc3545;
    background: #f8d7da;
}

.debug-step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.debug-step.processing .debug-step-icon {
    color: #ffc107;
}

.debug-step.success .debug-step-icon {
    color: #28a745;
}

.debug-step.error .debug-step-icon {
    color: #dc3545;
}

.debug-step-content {
    flex: 1;
}

.debug-step-content h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.debug-step-status {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    color: #666;
}

.debug-step-details {
    font-size: 0.85rem;
    color: #555;
    font-family: 'Courier New', monospace;
    background: white;
    padding: 10px;
    border-radius: 4px;
    margin-top: 8px;
    max-height: 150px;
    overflow-y: auto;
    display: none;
}

.debug-step.success .debug-step-details,
.debug-step.error .debug-step-details {
    display: block;
}

.debug-console {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.debug-console h4 {
    color: #fff;
    margin: 0 0 12px 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.debug-console-content {
    background: #000;
    border-radius: 4px;
    padding: 12px;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

.debug-log {
    color: #fff;
    margin-bottom: 5px;
    line-height: 1.5;
}

.debug-log.success {
    color: #4caf50;
}

.debug-log.error {
    color: #f44336;
}

.debug-log.warning {
    color: #ffc107;
}

.debug-log.info {
    color: #2196f3;
}

.debug-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.debug-actions .btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.debug-actions .btn-outline {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.debug-actions .btn-outline:hover {
    background: #667eea;
    color: white;
}

.debug-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.debug-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUpIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .debug-modal-content {
        max-height: 95vh;
    }
    
    .debug-modal-header {
        padding: 15px 20px;
    }
    
    .debug-modal-header h3 {
        font-size: 1.1rem;
    }
    
    .debug-modal-body {
        padding: 20px;
    }
    
    .debug-actions {
        flex-direction: column;
    }
    
    .debug-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

