/**
 * MODAL DE LOGIN - CSS CORRIGIDO V3.1
 * CORREÇÕES APLICADAS:
 * ✅ Hover NÃO inverte cores (mantém legibilidade)
 * ✅ Título afastado do botão X
 * ✅ Botão Google SEM mudança de cor no texto
 * 
 * @package Blue_Concursos
 * @since 3.1.0
 */

/* ========================================
   VARIÁVEIS CSS
======================================== */

:root {
    --modal-primary: #2563eb;
    --modal-primary-dark: #1d4ed8;
    --modal-danger: #dc2626;
    --modal-success: #16a34a;
    --modal-gray-50: #f9fafb;
    --modal-gray-100: #f3f4f6;
    --modal-gray-200: #e5e7eb;
    --modal-gray-300: #d1d5db;
    --modal-gray-400: #9ca3af;
    --modal-gray-600: #4b5563;
    --modal-gray-700: #374151;
    --modal-gray-900: #111827;
    --modal-white: #ffffff;
}

/* ========================================
   OVERLAY DO MODAL
======================================== */

.bc-modal-login {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
}

.bc-modal-login.active {
    display: block;
}

.bc-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ========================================
   CONTAINER DO MODAL
======================================== */

.bc-modal-container {
    position: relative;
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    margin: 0 auto;
    top: 50%;
    transform: translateY(-50%);
    background: var(--modal-white);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(-40%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

/* ========================================
   BOTÃO FECHAR (X)
======================================== */

.bc-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 2px solid var(--modal-gray-300);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    padding: 0;
}

.bc-modal-close:hover {
    background: var(--modal-danger);
    border-color: var(--modal-danger);
    transform: rotate(90deg);
}

.bc-modal-close svg {
    color: var(--modal-gray-600);
    transition: color 0.3s ease;
}

.bc-modal-close:hover svg {
    color: var(--modal-white);
}

/* ========================================
   CONTEÚDO DO MODAL
======================================== */

.bc-modal-content {
    padding: 40px 30px 30px;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.bc-modal-content::-webkit-scrollbar {
    width: 6px;
}

.bc-modal-content::-webkit-scrollbar-track {
    background: var(--modal-gray-100);
}

.bc-modal-content::-webkit-scrollbar-thumb {
    background: var(--modal-gray-400);
    border-radius: 3px;
}

/* ========================================
   LOGO E TÍTULO - AFASTADO DO X
======================================== */

.bc-modal-logo {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 10px; /* ESPAÇAMENTO EXTRA DO X */
}

.bc-modal-logo img {
    max-width: 120px;
    height: auto;
    margin-bottom: 15px;
}

.bc-modal-logo h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--modal-gray-900);
    margin: 0;
    padding: 0 50px; /* ESPAÇO LATERAL PARA NÃO ENCOSTAR NO X */
}

/* ========================================
   ABAS (TABS)
======================================== */

.bc-modal-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    background: var(--modal-gray-100);
    padding: 4px;
    border-radius: 10px;
}

.bc-tab-btn {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--modal-gray-600);
    cursor: pointer;
    transition: all 0.2s ease;
}

.bc-tab-btn.active {
    background: var(--modal-white);
    color: var(--modal-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* CORREÇÃO: Hover NÃO muda muito, mantém legível */
.bc-tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
    color: var(--modal-gray-700);
}

/* ========================================
   CONTEÚDO DAS ABAS
======================================== */

.bc-tab-content {
    display: none;
}

.bc-tab-content.active {
    display: block;
    animation: fadeInContent 0.3s ease;
}

@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   BOTÃO GOOGLE - SEM MUDAR COR DO TEXTO
======================================== */

.bc-btn-google {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--modal-white);
    border: 2px solid var(--modal-gray-300);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    color: var(--modal-gray-700);
    cursor: pointer;
    transition: all 0.2s ease;
}

/* CORREÇÃO: Hover apenas muda fundo, texto PERMANECE IGUAL */
.bc-btn-google:hover {
    background: var(--modal-gray-50);
    border-color: var(--modal-gray-400);
    color: var(--modal-gray-700); /* MESMA COR */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.bc-btn-google:active {
    transform: scale(0.98);
}

.bc-btn-google svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ========================================
   DIVISOR "OU"
======================================== */

.bc-divider {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    color: var(--modal-gray-600);
    font-size: 13px;
    font-weight: 500;
}

.bc-divider::before,
.bc-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--modal-gray-300);
}

/* ========================================
   FORMULÁRIOS
======================================== */

.bc-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.bc-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bc-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--modal-gray-700);
}

.bc-form-group input[type="text"],
.bc-form-group input[type="email"],
.bc-form-group input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    background: var(--modal-white);
    border: 2px solid var(--modal-gray-300);
    border-radius: 8px;
    font-size: 15px;
    color: var(--modal-gray-900);
    transition: all 0.2s ease;
}

.bc-form-group input:focus {
    outline: none;
    border-color: var(--modal-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.bc-form-group input::placeholder {
    color: var(--modal-gray-400);
}

/* ========================================
   PASSWORD WRAPPER
======================================== */

.bc-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.bc-password-wrapper input {
    padding-right: 50px;
}

.bc-toggle-password {
    position: absolute;
    right: 12px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--modal-gray-500);
    transition: color 0.2s ease;
}

.bc-toggle-password:hover {
    color: var(--modal-gray-700);
}

/* ========================================
   INDICADOR DE FORÇA DA SENHA
======================================== */

.bc-password-strength {
    height: 4px;
    background: var(--modal-gray-200);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.bc-strength-bar {
    height: 100%;
    width: 0;
    background: var(--modal-danger);
    transition: width 0.3s ease, background-color 0.3s ease;
}

.bc-password-strength.weak .bc-strength-bar {
    width: 33%;
    background: var(--modal-danger);
}

.bc-password-strength.medium .bc-strength-bar {
    width: 66%;
    background: #f59e0b;
}

.bc-password-strength.strong .bc-strength-bar {
    width: 100%;
    background: var(--modal-success);
}

/* ========================================
   MENSAGENS DE ERRO
======================================== */

.bc-error-message {
    display: none;
    font-size: 13px;
    color: var(--modal-danger);
    margin-top: 4px;
}

.bc-error-message.active {
    display: block;
}

.bc-form-group.has-error input {
    border-color: var(--modal-danger);
}

/* ========================================
   FOOTER DO FORMULÁRIO
======================================== */

.bc-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.bc-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.bc-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--modal-primary);
}

.bc-checkbox span {
    font-size: 14px;
    color: var(--modal-gray-700);
}

.bc-checkbox a {
    color: var(--modal-primary);
    text-decoration: none;
}

.bc-checkbox a:hover {
    text-decoration: underline;
}

.bc-link-forgot {
    font-size: 14px;
    color: var(--modal-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.bc-link-forgot:hover {
    color: var(--modal-primary-dark);
    text-decoration: underline;
}

/* ========================================
   BOTÃO PRIMARY - CORRIGIDO
======================================== */

.bc-btn-primary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--modal-primary);
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    color: var(--modal-white);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}

/* CORREÇÃO: Hover escurece fundo, texto PERMANECE BRANCO */
.bc-btn-primary:hover {
    background: var(--modal-primary-dark);
    color: var(--modal-white); /* GARANTE QUE PERMANECE BRANCO */
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.bc-btn-primary:active {
    transform: scale(0.98);
}

.bc-btn-primary:disabled {
    background: var(--modal-gray-400);
    cursor: not-allowed;
}

.bc-btn-loader {
    display: none;
}

.bc-btn-primary.loading .bc-btn-text {
    display: none;
}

.bc-btn-primary.loading .bc-btn-loader {
    display: inline-flex;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ========================================
   RECUPERAR SENHA
======================================== */

.bc-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--modal-gray-600);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 15px;
    transition: color 0.2s ease;
}

.bc-back-btn:hover {
    color: var(--modal-primary);
}

.bc-tab-content h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--modal-gray-900);
    margin: 0 0 10px 0;
}

.bc-help-text {
    font-size: 14px;
    color: var(--modal-gray-600);
    line-height: 1.6;
    margin-bottom: 20px;
}

/* ========================================
   TOAST
======================================== */

.bc-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    min-width: 300px;
    max-width: 400px;
    background: var(--modal-white);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 9999999;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.bc-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
}

.bc-toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.bc-toast.success .bc-toast-icon::before {
    content: '✓';
    display: block;
    width: 24px;
    height: 24px;
    background: var(--modal-success);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-weight: bold;
}

.bc-toast.error .bc-toast-icon::before {
    content: '✕';
    display: block;
    width: 24px;
    height: 24px;
    background: var(--modal-danger);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-weight: bold;
}

.bc-toast-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--modal-gray-900);
}

/* ========================================
   RESPONSIVO
======================================== */

@media (max-width: 768px) {
    .bc-modal-container {
        max-width: calc(100% - 40px);
        max-height: calc(100vh - 40px);
    }
    
    .bc-modal-content {
        padding: 30px 20px 20px;
    }
    
    .bc-modal-logo h2 {
        font-size: 20px;
        padding: 0 40px;
    }
    
    .bc-toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .bc-form-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ========================================
   PREVENÇÃO DE SCROLL
======================================== */

body.bc-modal-open {
    overflow: hidden;
}

/* ========================================
   FIM DO ARQUIVO
======================================== */