/**
 * LOGIN PAGE - Juntos na Fé
 * Design moderno com layout split
 * 
 * @author Sistema
 * @version 2.0
 * @date 2025
 */

/* ========================================
   RESET E BASE
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.login-page {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Efeito scale sutil em botões (consistente com a aplicação) */
.login-page button:active:not(:disabled),
.login-page .btn-login:active,
.login-page .btn-register:active {
    transform: scale(0.96) !important;
    transition: transform 0.1s ease !important;
}

/* ========================================
   PARTÍCULAS DE FUNDO ANIMADAS
   ======================================== */

.particles-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-400);
    border-radius: 50%;
    opacity: 0;
    animation: float 15s infinite ease-in-out;
    box-shadow: 0 0 10px var(--primary-500);
}

.particle:nth-child(1) {
    left: 10%;
    animation-delay: 0s;
    animation-duration: 12s;
}

.particle:nth-child(2) {
    left: 25%;
    animation-delay: 2s;
    animation-duration: 15s;
}

.particle:nth-child(3) {
    left: 45%;
    animation-delay: 4s;
    animation-duration: 18s;
}

.particle:nth-child(4) {
    left: 60%;
    animation-delay: 1s;
    animation-duration: 14s;
}

.particle:nth-child(5) {
    left: 75%;
    animation-delay: 3s;
    animation-duration: 16s;
}

.particle:nth-child(6) {
    left: 85%;
    animation-delay: 5s;
    animation-duration: 13s;
}

.particle:nth-child(7) {
    left: 30%;
    animation-delay: 6s;
    animation-duration: 17s;
}

.particle:nth-child(8) {
    left: 55%;
    animation-delay: 7s;
    animation-duration: 19s;
}

@keyframes float {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100vh) scale(1.5);
        opacity: 0;
    }
}

/* ========================================
   CONTAINER PRINCIPAL
   ======================================== */

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    padding: 40px 20px;
}

/* ========================================
   FORMULÁRIO CENTRALIZADO
   ======================================== */

.login-center {
    width: 100%;
    max-width: 480px;
    animation: fadeInUp 0.8s ease;
}

.login-form-container {
    width: 100%;
}

/* ========================================
   CARD DE LOGIN
   ======================================== */

.login-card {
    background: var(--bg-secondary);
    border-radius: 24px;
    padding: 36px 40px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(108, 99, 255, 0.2);
    position: relative;
    overflow: hidden;
}

/* Logo no topo do card */
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

/* Brand Logo Centralizado */
.brand-logo-center {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: rgba(108, 99, 255, 0.1);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(108, 99, 255, 0.2);
    animation: pulse 3s ease-in-out infinite;
}

.brand-logo-center img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(108, 99, 255, 0.3));
}

.login-card-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-card-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.login-card-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Footer centralizado */
.login-footer-centered {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.login-footer-centered p {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ========================================
   ALERTAS
   ======================================== */

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    animation: slideDown 0.3s ease;
}

.alert i {
    font-size: 16px;
    flex-shrink: 0;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-border);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}

/* ========================================
   FORMULÁRIO
   ======================================== */

.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-label i {
    font-size: 13px;
    color: var(--primary-400);
}

.form-input {
    width: 100%;
    height: 46px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0 16px;
    font-size: 14px;
    color: var(--text-primary);
    font-family: var(--font-family);
    transition: all 0.3s ease;
    outline: none;
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
}

.form-input:hover {
    border-color: rgba(108, 99, 255, 0.3);
}

/* Password Input com Toggle */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-input {
    padding-right: 46px;
}

.btn-toggle-password {
    position: absolute;
    right: 0;
    top: 0;
    height: 46px;
    width: 46px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 0 10px 10px 0;
}

.btn-toggle-password:hover {
    color: var(--primary-400);
    background: rgba(108, 99, 255, 0.1);
}

.btn-toggle-password i {
    font-size: 16px;
}

/* ========================================
   OPÇÕES DO FORMULÁRIO
   ======================================== */

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    gap: 12px;
}

/* Checkbox Customizado */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkbox-label:hover .checkbox-custom {
    border-color: var(--primary-400);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--primary-500);
    border-color: var(--primary-500);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
}

.checkbox-text {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Link Esqueceu Senha */
.link-forgot {
    font-size: 13px;
    color: var(--primary-400);
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.link-forgot:hover {
    color: var(--primary-300);
}

/* ========================================
   BOTÕES
   ======================================== */

.btn-login {
    width: 100%;
    height: 48px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.3);
    margin-bottom: 20px;
    touch-action: manipulation;
    user-select: none;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(108, 99, 255, 0.4);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-login i {
    font-size: 16px;
}

/* ========================================
   DIVISOR
   ======================================== */

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.divider-secondary {
    margin-top: 20px;
    margin-bottom: 24px;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.divider-text {
    font-size: 12px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* ========================================
   BOTÃO GOOGLE
   ======================================== */

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    height: 48px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    color: #3c4043;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    touch-action: manipulation;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

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

.btn-google:active {
    transform: scale(0.96);
    transition: transform 0.1s ease;
}

.google-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .btn-google {
        height: 44px;
        font-size: 13px;
    }
    
    .google-icon {
        width: 18px;
        height: 18px;
    }
}

/* ========================================
   SEÇÃO DE REGISTRO
   ======================================== */

.register-section {
    text-align: center;
}

.register-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.btn-register {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 46px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(108, 99, 255, 0.3);
    border-radius: 10px;
    color: var(--primary-400);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    touch-action: manipulation;
    user-select: none;
}

.btn-register:hover {
    background: rgba(108, 99, 255, 0.1);
    border-color: var(--primary-500);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(108, 99, 255, 0.2);
}

.btn-register i {
    font-size: 15px;
}

/* Botão de Cadastro Gratuito - Estilo Destacado */
.btn-register-free {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    border: 2px solid #10b981 !important;
    color: white !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3) !important;
    position: relative;
    overflow: hidden;
}

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

.btn-register-free:hover {
    background: linear-gradient(135deg, #059669, #047857) !important;
    border-color: #059669 !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 30px rgba(16, 185, 129, 0.5) !important;
}

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

.btn-register-free:active {
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 15px rgba(16, 185, 129, 0.4) !important;
}

/* ========================================
   ANIMAÇÕES
   ======================================== */

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

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

@media (max-width: 768px) {
    .login-container {
        padding: 30px 20px;
    }
    
    .login-center {
        max-width: 100%;
    }
    
    .login-card {
        padding: 32px 28px;
    }
    
    .login-card-header h2 {
        font-size: 24px;
    }
    
    .login-card-header p {
        font-size: 14px;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 20px 16px;
    }
    
    .login-card {
        padding: 28px 24px;
    }
    
    .brand-logo-center {
        width: 56px;
        height: 56px;
        margin-bottom: 16px;
    }
    
    .brand-logo-center img {
        width: 36px;
        height: 36px;
    }
    
    .login-card-header h2 {
        font-size: 22px;
    }
    
    .login-card-header p {
        font-size: 13px;
    }
    
    .form-input,
    .btn-login,
    .btn-register {
        height: 44px;
    }
    
    .btn-login {
        font-size: 14px;
    }
}

/* ========================================
   REGISTRO: PASSWORD STRENGTH INDICATOR
   ======================================== */

.password-strength {
    margin-top: 8px;
}

.password-strength-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.password-strength-text {
    font-size: 12px;
    font-weight: 500;
    display: block;
}

/* ========================================
   REGISTRO: CHECKBOX LABEL FULL WIDTH
   ======================================== */

.checkbox-label-full {
    width: 100%;
    display: flex !important;
    align-items: flex-start !important;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label-full .checkbox-text {
    flex: 1;
    text-align: left;
    line-height: 1.5;
    font-size: 13px;
}

.link-terms {
    color: var(--primary-400);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.link-terms:hover {
    color: var(--primary-500);
    text-decoration: underline;
}

/* ========================================
   REGISTRO: INPUT ERROR STATE
   ======================================== */

.form-input.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.form-input.error:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ========================================
   ANIMAÇÃO SHAKE (ERRO)
   ======================================== */

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}
