﻿
body.login-modern-body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    /* Otimização para touch no Android 10 */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Design Moderno Health Club Academia - OTIMIZADO PARA TOTEM 43" (1920x1080) */
.modern-login-container {
    min-height: 100vh;
    height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 0;
    /* Suporte para telas de alta densidade (2K) */
    image-rendering: -webkit-optimize-contrast;
}

.login-card {
    background: white;
    box-shadow: 0 0 100px rgba(0,0,0,0.3);
    overflow: hidden;
    width: 100%;
    max-width: none;
    margin: 0;
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease;
    display: grid;
    grid-template-columns: 42% 58%;
    height: 100vh;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Lado Esquerdo - Branding (TOTEM) */
.login-header {
    /* Gradiente Health Club: Vermelho forte para azul energia */
    background: linear-gradient(135deg, #DC143C 0%, #B22222 25%, #8B0000 45%, #1E3A8A 70%, #3B82F6 100%);
    padding: 100px 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

    /* Efeitos de fundo animados */
    .login-header::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 800px;
        height: 800px;
        background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
        animation: pulse 4s ease-in-out infinite;
    }

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.8;
    }
}

/* Partículas decorativas */
.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    pointer-events: none;
    animation: rise 18s linear infinite;
}

@keyframes rise {
    0% {
        bottom: -10%;
        opacity: 0;
    }

    10% {
        opacity: 0.8;
    }

    90% {
        opacity: 0.6;
    }

    100% {
        bottom: 110%;
        opacity: 0;
    }
}

.login-logo {
    max-width: 450px;
    width: 100%;
    height: auto;
    margin-bottom: 60px;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 15px 35px rgba(0,0,0,0.5));
    animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% {
        filter: drop-shadow(0 15px 35px rgba(0,0,0,0.5));
    }

    50% {
        filter: drop-shadow(0 15px 45px rgba(255,255,255,0.7));
    }
}

.login-subtitle {
    color: rgba(255,255,255,0.98);
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 70px 0;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
    position: relative;
    z-index: 2;
    line-height: 1.6;
}

    .login-subtitle i {
        margin-right: 15px;
        color: #FFD700;
        font-size: 32px;
        animation: sparkle 2s ease-in-out infinite;
    }

@keyframes sparkle {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.15);
    }
}

/* Avatar do Robô IA - GRANDE PARA TOTEM */
.robot-avatar {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    z-index: 3;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #DC143C 0%, #3B82F6 100%);
    padding: 10px;
    box-shadow: 0 25px 70px rgba(0,0,0,0.6);
    animation: robotFloat 3s ease-in-out infinite;
    position: relative;
}

@keyframes robotFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.robot-avatar::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, #DC143C, #3B82F6, #FFD700, #DC143C);
    border-radius: 50%;
    z-index: -1;
    animation: rotateBorder 4s linear infinite;
}

@keyframes rotateBorder {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.robot-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.robot-avatar video,
.robot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Lado Direito - Formulário OTIMIZADO PARA TOUCH 43" */
.login-body {
    padding: 80px 90px;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow-y: auto;
}

/* Badge IA */
.ai-badge {
    position: absolute;
    top: 40px;
    right: 40px;
    background: linear-gradient(135deg, #DC143C 0%, #3B82F6 100%);
    padding: 16px 28px;
    border-radius: 35px;
    color: white;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
    box-shadow: 0 8px 25px rgba(220, 20, 60, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

    .ai-badge i {
        color: #FFD700;
        font-size: 22px;
        animation: sparkle 2s ease-in-out infinite;
    }

/* FUTURO: Badge de Comando de Voz (preparado para integração) */
.voice-badge {
    position: absolute;
    top: 110px;
    right: 40px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    padding: 12px 20px;
    border-radius: 25px;
    color: #1f2937;
    font-size: 14px;
    font-weight: 600;
    display: none; /* Ativar quando integrar microfone */
    align-items: center;
    gap: 10px;
    z-index: 10;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

    .voice-badge:hover {
        transform: scale(1.05);
        box-shadow: 0 8px 25px rgba(255, 215, 0, 0.6);
    }

    .voice-badge i {
        font-size: 18px;
    }

    .voice-badge.listening {
        animation: voicePulse 1s ease-in-out infinite;
    }

@keyframes voicePulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.form-title-modern {
    font-size: 52px;
    font-weight: 800;
    background: linear-gradient(135deg, #DC143C 0%, #1E3A8A 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

    .form-title-modern::after {
        content: '';
        position: absolute;
        bottom: -22px;
        left: 50%;
        transform: translateX(-50%);
        width: 140px;
        height: 6px;
        background: linear-gradient(90deg, #DC143C 0%, #3B82F6 100%);
        border-radius: 3px;
    }

.form-group-modern {
    margin-bottom: 35px;
}

    .form-group-modern label {
        display: block;
        color: #1f2937;
        font-weight: 700;
        font-size: 22px;
        margin-bottom: 16px;
    }

.input-wrapper-modern {
    position: relative;
}

    .input-wrapper-modern i {
        position: absolute;
        left: 30px;
        top: 50%;
        transform: translateY(-50%);
        background: linear-gradient(135deg, #DC143C 0%, #3B82F6 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        font-size: 30px;
        z-index: 2;
    }

/* CAMPOS GRANDES PARA TOUCH - 43" ANDROID 10 */
.form-control-modern {
    width: 100%;
    padding: 28px 28px 28px 80px;
    border: 4px solid #e5e7eb;
    border-radius: 22px;
    font-size: 24px;
    transition: all 0.3s ease;
    background: #f9fafb;
    font-weight: 500;
    /* Otimizações para touch Android */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

    .form-control-modern:focus {
        outline: none;
        border-color: #DC143C;
        background: white;
        box-shadow: 0 0 0 6px rgba(220, 20, 60, 0.15);
    }

    .form-control-modern::placeholder {
        color: #9ca3af;
        font-weight: 400;
    }

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 40px 0;
    /* Touch target optimization */
    min-height: 44px;
}

/* CHECKBOX GRANDE PARA TOUCH */
.checkbox-modern {
    width: 36px;
    height: 36px;
    border: 4px solid #d1d5db;
    border-radius: 10px;
    cursor: pointer;
    appearance: none;
    transition: all 0.3s ease;
    position: relative;
    /* Área de toque aumentada */
    padding: 8px;
}

    .checkbox-modern:checked {
        background: linear-gradient(135deg, #DC143C 0%, #3B82F6 100%);
        border-color: #DC143C;
    }

        .checkbox-modern:checked::after {
            content: '✓';
            position: absolute;
            color: white;
            font-size: 24px;
            font-weight: bold;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }

.checkbox-label {
    color: #4b5563;
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    /* Touch target expandido */
    padding: 10px;
}

/* BOTÃO GRANDE PARA TOUCH - TOTEM 43" ANDROID */
button.btn-login-modern,
button#btnEntrar,
.btn-login-modern {
    width: 100%;
    padding: 32px;
    background: linear-gradient(135deg, #DC143C 0%, #B22222 50%, #1E3A8A 100%) !important;
    color: white !important;
    border: none;
    border-radius: 22px;
    font-size: 26px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 15px 45px rgba(220, 20, 60, 0.5) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 40px;
    position: relative;
    overflow: hidden;
    /* Otimizações touch Android */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 80px;
}

    button.btn-login-modern::before,
    button#btnEntrar::before,
    .btn-login-modern::before {
        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.6s ease;
    }

    button.btn-login-modern:hover,
    button#btnEntrar:hover,
    .btn-login-modern:hover,
    button.btn-login-modern:active,
    button#btnEntrar:active,
    .btn-login-modern:active {
        transform: scale(0.98) !important;
        box-shadow: 0 18px 50px rgba(220, 20, 60, 0.6) !important;
        background: linear-gradient(135deg, #FF1744 0%, #DC143C 50%, #2563EB 100%) !important;
    }

        button.btn-login-modern:hover::before,
        button#btnEntrar:hover::before,
        .btn-login-modern:hover::before {
            left: 100%;
        }

    button.btn-login-modern:focus,
    button#btnEntrar:focus,
    .btn-login-modern:focus {
        background: linear-gradient(135deg, #DC143C 0%, #B22222 50%, #1E3A8A 100%) !important;
        outline: none !important;
    }

/* Área de redefinição de senha - TOTEM */
.forgot-password-modern {
    text-align: center;
    margin-top: 40px;
    padding-top: 35px;
    border-top: 3px solid #e5e7eb;
}

    .forgot-password-modern h4 {
        color: #6b7280;
        font-size: 20px;
        font-weight: 600;
        margin-bottom: 18px;
    }

    .forgot-password-modern a {
        color: #DC143C;
        text-decoration: none;
        font-weight: 700;
        font-size: 22px;
        transition: all 0.3s ease;
        display: inline-flex;
        align-items: center;
        gap: 12px;
        padding: 15px 20px;
        /* Touch target optimization */
        min-height: 44px;
        touch-action: manipulation;
    }

        .forgot-password-modern a:hover,
        .forgot-password-modern a:active {
            color: #B22222;
            text-decoration: underline;
            transform: scale(1.05);
        }

        .forgot-password-modern a i {
            font-size: 24px;
        }

/* Validação de erro - VISÍVEL EM TOTEM */
.field-validation-error {
    color: #ef4444;
    font-size: 18px;
    margin-top: 10px;
    display: block;
    font-weight: 600;
}

.input-validation-error {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
}

/* Estado de carregamento */
.btn-login-modern.loading {
    pointer-events: none;
    opacity: 0.8;
}

    .btn-login-modern.loading i {
        animation: spin 1s linear infinite;
    }

/* Responsive - Tablets Menores */
@media (max-width: 1366px) {
    .login-card {
        grid-template-columns: 40% 60%;
    }

    .login-body {
        padding: 70px 60px;
    }

    .form-title-modern {
        font-size: 46px;
    }

    .login-logo {
        max-width: 380px;
    }

    .robot-avatar {
        width: 240px;
        height: 240px;
    }
}

@media (max-width: 992px) {
    .login-card {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100vh;
    }

    .login-header {
        padding: 60px 40px 100px;
        min-height: 50vh;
    }

    .robot-avatar {
        position: absolute;
        bottom: -100px;
        left: 50%;
        transform: translateX(-50%);
    }

    .login-body {
        padding: 120px 50px 60px;
    }

    .ai-badge {
        top: 20px;
        right: 20px;
    }

    .voice-badge {
        top: 80px;
        right: 20px;
    }
}

/* Garantir fullscreen sem margens para Android */
body, html {
    margin: 0 !important;
    padding: 0 !important;
    height: 100%;
    overflow-x: hidden;
    /* Prevenir zoom acidental no Android */
    touch-action: pan-x pan-y;
}

/* Prevenir seleção de texto no touch */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Permitir seleção apenas em inputs */
input, textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* ===== MODAL RECONHECIMENTO FACIAL ===== */
.facial-recognition-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

.facial-modal-content {
    position: relative;
    background: white;
    margin: 3% auto;
    padding: 0;
    width: 90%;
    max-width: 900px;
    border-radius: 30px;
    box-shadow: 0 30px 100px rgba(220, 20, 60, 0.7);
    animation: slideUp 0.4s ease;
    overflow: hidden;
}

.facial-modal-header {
    background: linear-gradient(135deg, #DC143C 0%, #B22222 50%, #1E3A8A 100%);
    padding: 35px 45px;
    text-align: center;
    position: relative;
}

    .facial-modal-header h2 {
        color: white;
        font-size: 36px;
        font-weight: 800;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 18px;
    }

        .facial-modal-header h2 i {
            font-size: 42px;
            color: #FFD700;
            animation: sparkle 2s ease-in-out infinite;
        }

    .facial-modal-header .close-modal {
        position: absolute;
        right: 25px;
        top: 50%;
        transform: translateY(-50%);
        color: white;
        font-size: 40px;
        font-weight: bold;
        cursor: pointer;
        transition: all 0.3s ease;
        width: 50px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
    }

        .facial-modal-header .close-modal:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: translateY(-50%) rotate(90deg);
        }

.facial-modal-body {
    padding: 50px;
    text-align: center;
}

.camera-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto 35px;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
}

#videoCamera {
    width: 100%;
    height: auto;
    display: block;
    transform: scaleX(-1);
}

#canvasCamera {
    display: none;
}

.camera-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 350px;
    border: 5px solid #FFD700;
    border-radius: 50% 50% 45% 45%;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    animation: overlayPulse 2s ease-in-out infinite;
}

@keyframes overlayPulse {
    0%, 100% {
        border-color: #FFD700;
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
    }

    50% {
        border-color: #DC143C;
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
    }
}

.camera-instructions {
    color: #6b7280;
    font-size: 20px;
    margin-bottom: 35px;
    line-height: 1.6;
}

    .camera-instructions i {
        color: #DC143C;
        font-size: 24px;
        margin-right: 10px;
    }

/* Botões do Modal */
.btn-capture-photo,
.btn-facial-fallback {
    padding: 22px 45px;
    font-size: 22px;
    font-weight: 700;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    min-height: 70px;
    touch-action: manipulation;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 10px;
}

.btn-capture-photo {
    background: linear-gradient(135deg, #DC143C 0%, #B22222 50%, #1E3A8A 100%);
    color: white;
    box-shadow: 0 12px 35px rgba(220, 20, 60, 0.5);
}

    .btn-capture-photo:hover,
    .btn-capture-photo:active {
        transform: scale(0.98);
        box-shadow: 0 15px 40px rgba(220, 20, 60, 0.6);
    }

    .btn-capture-photo.processing {
        pointer-events: none;
        opacity: 0.8;
    }

        .btn-capture-photo.processing i {
            animation: spin 1s linear infinite;
        }

.btn-facial-fallback {
    background: #6b7280;
    color: white;
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.4);
}

    .btn-facial-fallback:hover,
    .btn-facial-fallback:active {
        background: #4b5563;
        transform: scale(0.98);
    }

/* Status do reconhecimento */
.recognition-status {
    margin-top: 30px;
    padding: 25px;
    border-radius: 18px;
    font-size: 20px;
    font-weight: 600;
    display: none;
}

    .recognition-status.error {
        background: #fef2f2;
        color: #ef4444;
        border: 3px solid #ef4444;
    }

    .recognition-status.success {
        background: #f0fdf4;
        color: #22c55e;
        border: 3px solid #22c55e;
    }

    .recognition-status.processing {
        background: #fef3c7;
        color: #f59e0b;
        border: 3px solid #f59e0b;
    }

/* ===== BOTÃO DE RECONHECIMENTO FACIAL NA TELA DE LOGIN ===== */
.facial-recognition-section {
    margin: 45px 0;
    padding-top: 35px;
    border-top: 3px solid #e5e7eb;
    text-align: center;
}

    .facial-recognition-section h4 {
        color: #6b7280;
        font-size: 20px;
        font-weight: 600;
        margin-bottom: 25px;
    }

.btn-facial-recognition {
    width: 100%;
    padding: 28px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1f2937;
    border: none;
    border-radius: 22px;
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.8px;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 12px 40px rgba(255, 215, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
    min-height: 75px;
}

    .btn-facial-recognition::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
        transition: left 0.6s ease;
    }

    .btn-facial-recognition:hover,
    .btn-facial-recognition:active {
        transform: scale(0.98);
        box-shadow: 0 15px 45px rgba(255, 215, 0, 0.6);
        background: linear-gradient(135deg, #FFE55C 0%, #FFB84D 100%);
    }

        .btn-facial-recognition:hover::before {
            left: 100%;
        }

    .btn-facial-recognition i {
        font-size: 28px;
    }

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
