/**
 * NativaX Store - Estilos de Autenticação
 * 
 * Estilos para modais de login, registro e perfil
 */

/* ============================================================================
   BOTÕES DE AUTENTICAÇÃO NA NAVBAR
   ============================================================================ */

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 0.5rem;
}

/* Garantir que os botões apareçam por padrão quando não logado */
.auth-buttons:not([style*="display: none"]) {
    display: flex;
}

.auth-btn-text {
    margin-left: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.login-btn,
.register-btn {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--color-text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.login-btn::before,
.register-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.login-btn:hover::before,
.register-btn:hover::before {
    width: 300px;
    height: 300px;
}

.login-btn:hover,
.register-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2),
                0 0 20px rgba(255, 255, 255, 0.1);
}

.login-btn:active,
.register-btn:active {
    transform: translateY(-1px) scale(1.02);
    transition: all 0.1s ease;
}

.login-btn svg,
.register-btn svg {
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.login-btn:hover svg,
.register-btn:hover svg {
    transform: scale(1.1) rotate(5deg);
}

.login-btn .auth-btn-text,
.register-btn .auth-btn-text {
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.login-btn:hover .auth-btn-text,
.register-btn:hover .auth-btn-text {
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Botão de Login - Efeitos Especiais */
.login-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(10px);
}

.login-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Botão de Cadastrar - Efeitos Especiais */
.register-btn {
    background: var(--gradient-primary);
    border: none;
    position: relative;
    overflow: hidden;
}

.register-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.register-btn:hover::after {
    left: 100%;
}

.register-btn:hover {
    background: var(--gradient-hover);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25),
                0 0 0 1px rgba(255, 255, 255, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.register-btn:active {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2),
                0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Efeito de brilho no texto do botão Cadastrar */
.register-btn .auth-btn-text {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.register-btn:hover .auth-btn-text {
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.8),
                 0 0 25px rgba(255, 255, 255, 0.5);
}

/* ============================================================================
   LOGIN SOCIAL
   ============================================================================ */

.social-login-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-social:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-social:active {
    transform: translateY(0);
}

.btn-google {
    background: #fff;
    color: #333;
    border-color: #dadce0;
}

.btn-google:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-facebook {
    background: #1877F2;
    color: #fff;
    border-color: #1877F2;
}

.btn-facebook:hover {
    background: #166fe5;
    box-shadow: 0 2px 8px rgba(24, 119, 242, 0.3);
}

.btn-social svg {
    flex-shrink: 0;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-divider span {
    padding: 0 1rem;
}

/* ============================================================================
   VALIDAÇÃO E ERROS
   ============================================================================ */

.field-error {
    display: block;
    color: #ff4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    min-height: 1rem;
}

.auth-error-message {
    padding: 0.75rem;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    border-radius: 6px;
    color: #ff4444;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.auth-form-group input:invalid:not(:placeholder-shown),
.auth-form-group input.error {
    border-color: rgba(255, 68, 68, 0.5);
}

.auth-form-group input:valid:not(:placeholder-shown):not(.error) {
    border-color: rgba(76, 175, 80, 0.5);
}

.btn-loading {
    display: none;
}

.btn-auth-submit:disabled .btn-text {
    display: none;
}

.btn-auth-submit:disabled .btn-loading {
    display: inline;
}

/* ============================================================================
   CONTAS VINCULADAS
   ============================================================================ */

.linked-accounts-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.linked-accounts-section .section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.linked-accounts-section .section-description {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.linked-accounts-list {
    margin-bottom: 1rem;
}

.no-linked-accounts {
    padding: 1rem;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.linked-account-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.linked-account-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.linked-account-info svg {
    flex-shrink: 0;
}

.account-email {
    color: var(--color-text-muted);
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.btn-unlink {
    padding: 0.5rem 1rem;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    border-radius: 6px;
    color: #ff4444;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-unlink:hover {
    background: rgba(255, 68, 68, 0.2);
    border-color: rgba(255, 68, 68, 0.5);
}

.link-accounts-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.link-accounts-buttons .btn-social {
    width: 100%;
}

/* Menu do Usuário */
.user-menu {
    display: flex;
    align-items: center;
    position: relative;
    margin-right: 0.5rem;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15) 0%, rgba(225, 46, 11, 0.1) 100%);
    border: 1px solid rgba(255, 107, 53, 0.3);
    border-radius: 8px;
    color: var(--color-text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.1);
}

.user-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.user-btn:hover::before {
    left: 100%;
}

.user-btn:hover {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.25) 0%, rgba(225, 46, 11, 0.15) 100%);
    border-color: rgba(255, 107, 53, 0.5);
    /* Sem sombra/brilho aumentando no hover - mantém a mesma do estado normal */
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.1);
}

.user-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.15);
    transition: all 0.1s ease;
}

.user-btn svg {
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.user-btn:hover svg {
    transform: none;
    filter: none;
}

.user-btn .user-name {
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.user-btn:hover .user-name {
    font-weight: 600;
    /* Sem sombra/brilho no texto no hover */
}

.user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--color-bg-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--color-text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.user-dropdown-item:last-child {
    border-bottom: none;
}

.user-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-orange);
}

.user-dropdown-item.logout-item {
    color: #ff6b6b;
}

.user-dropdown-item.logout-item:hover {
    background: rgba(255, 107, 107, 0.1);
}

.user-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
}

/* ============================================================================
   MODAIS DE AUTENTICAÇÃO
   ============================================================================ */

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.auth-modal-content {
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    position: relative;
}

.auth-modal-large {
    max-width: 700px;
}

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

.auth-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 107, 53, 0.2);
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.05) 0%, rgba(225, 46, 11, 0.03) 100%);
}

.auth-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    background: var(--gradient-logo-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-modal-close {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-modal-close:hover {
    background: rgba(255, 107, 53, 0.2);
    color: var(--color-text-primary);
}

/* ============================================================================
   FORMULÁRIOS DE AUTENTICAÇÃO
   ============================================================================ */

.auth-form {
    padding: 1.5rem;
}

.auth-form-group {
    margin-bottom: 1.25rem;
}

.auth-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-primary);
}

.auth-form-group label .optional {
    color: var(--color-text-muted);
    font-weight: 400;
    font-size: 0.75rem;
}

.auth-form-group input,
.auth-form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 8px;
    color: var(--color-text-primary);
    font-size: 0.875rem;
    font-family: var(--font-primary);
    transition: all var(--transition-fast);
    box-sizing: border-box;
}

.auth-form-group input:focus,
.auth-form-group select:focus {
    outline: none;
    border-color: var(--color-orange);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

.auth-form-group input:read-only {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-muted);
    cursor: not-allowed;
    border-color: rgba(255, 107, 53, 0.15);
}

/* Estilos para opções do select dropdown */
.auth-form-group select option {
    background: #2a2a2a !important;
    color: #ffffff !important;
    padding: 0.75rem 1rem;
}

.auth-form-group select option:hover {
    background: rgba(255, 107, 53, 0.3) !important;
    color: #ffffff !important;
}

.auth-form-group select option:checked,
.auth-form-group select option:focus,
.auth-form-group select option[selected] {
    background: rgba(255, 107, 53, 0.4) !important;
    color: #ffffff !important;
}

/* Garantir que o select em si também tenha cores corretas */
.auth-form-group select {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: var(--color-text-primary) !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.auth-form-group select:focus {
    background-color: rgba(255, 255, 255, 0.15) !important;
}

/* Forçar cores para todas as opções do select, incluindo as não selecionadas */
.auth-form-group select option:not(:checked):not(:hover) {
    background: #2a2a2a !important;
    color: #ffffff !important;
}

.auth-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.auth-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--color-text-primary);
}

.auth-checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 4px;
    accent-color: var(--color-orange);
}

.btn-auth-submit {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: 8px;
    color: var(--color-white);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    margin-top: 1rem;
}

.btn-auth-submit:hover:not(:disabled) {
    background: var(--gradient-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(225, 46, 11, 0.4);
}

.btn-auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-form-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.auth-form-footer a {
    color: var(--color-orange);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.auth-form-footer a:hover {
    color: var(--color-orange-dark);
    text-decoration: underline;
}

/* ============================================================================
   RESPONSIVIDADE
   ============================================================================ */

@media (max-width: 768px) {
    .auth-buttons {
        gap: 0.25rem;
        margin-right: 0.25rem;
    }
    
    .auth-btn-text {
        display: none;
    }
    
    .login-btn,
    .register-btn,
    .user-btn {
        padding: 0.5rem;
    }
    
    /* Ajustar efeitos para mobile */
    .login-btn:hover,
    .register-btn:hover {
        transform: translateY(-2px) scale(1.03);
    }
    
    .login-btn:active,
    .register-btn:active {
        transform: translateY(0) scale(0.98);
    }
    
    .user-name {
        display: none;
    }
    
    .auth-modal {
        padding: 1rem;
    }
    
    .auth-modal-content {
        max-width: 100%;
    }
    
    .auth-form-row {
        grid-template-columns: 1fr;
    }
}

/* Mobile - Esconder texto dos botões */
@media (max-width: 480px) {
    .auth-btn-text {
        display: none;
    }
}

/* Efeitos de foco para acessibilidade */
.login-btn:focus-visible,
.register-btn:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
    box-shadow: none;
}

/* Desabilitar animações para usuários que preferem reduzir movimento */
@media (prefers-reduced-motion: reduce) {
    .login-btn,
    .register-btn,
    .login-btn::before,
    .register-btn::before,
    .register-btn::after,
    .login-btn svg,
    .register-btn svg,
    .login-btn .auth-btn-text,
    .register-btn .auth-btn-text {
        transition: none;
        animation: none;
    }
    
    .register-btn:hover {
        animation: none;
    }
}
