/**
 * Ultragaz 24 Horas - Login Page Modern Theme
 * Design elegante com gradientes azuis, relogio digital, jogos e chat IA
 */

/* Reset e Base */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Segoe UI', 'Open Sans', system-ui, sans-serif;
    background: linear-gradient(135deg, #0a1628 0%, #0d1f36 50%, #0a1628 100%);
    overflow-x: hidden;
}

/* Overlay de fundo animado */
.login-bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(0, 85, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(0, 204, 204, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 204, 102, 0.08) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Particulas flutuantes */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(0, 204, 204, 0.6);
    border-radius: 50%;
    animation: float-particle 15s infinite;
    box-shadow: 0 0 10px rgba(0, 204, 204, 0.5);
}

@keyframes float-particle {
    0%, 100% { transform: translateY(100vh) translateX(0) scale(0); opacity: 0; }
    10% { opacity: 1; transform: translateY(80vh) translateX(20px) scale(1); }
    90% { opacity: 1; transform: translateY(10vh) translateX(-20px) scale(1); }
    100% { transform: translateY(-10vh) translateX(0) scale(0); opacity: 0; }
}

/* Container principal */
.login-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 10;
}

/* Painel esquerdo - Features */
.login-features-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px;
    position: relative;
}

/* Relogio Digital */
.digital-clock-widget {
    position: absolute;
    top: 30px;
    left: 30px;
    background: rgba(0, 85, 255, 0.1);
    border: 1px solid rgba(0, 204, 204, 0.3);
    border-radius: 16px;
    padding: 20px 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.clock-time {
    font-size: 48px;
    font-weight: 700;
    color: #00cccc;
    text-shadow: 0 0 20px rgba(0, 204, 204, 0.5);
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    letter-spacing: 3px;
}

.clock-date {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.clock-seconds {
    font-size: 24px;
    color: rgba(0, 204, 204, 0.6);
    vertical-align: super;
}

/* Logo e Mensagem */
.brand-section {
    text-align: center;
    margin-bottom: 40px;
}

.brand-logo {
    max-width: 250px;
    height: auto;
    filter: drop-shadow(0 4px 20px rgba(0, 204, 204, 0.3));
    animation: logo-pulse 3s ease-in-out infinite;
}

@keyframes logo-pulse {
    0%, 100% { filter: drop-shadow(0 4px 20px rgba(0, 204, 204, 0.3)); }
    50% { filter: drop-shadow(0 4px 30px rgba(0, 204, 204, 0.5)); }
}

.brand-tagline {
    color: #ffffff;
    font-size: 28px;
    font-weight: 600;
    margin-top: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.brand-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    margin-top: 10px;
}

/* Area de Mini Jogos */
.games-section {
    background: rgba(0, 85, 255, 0.08);
    border: 1px solid rgba(0, 204, 204, 0.2);
    border-radius: 20px;
    padding: 25px;
    margin-top: 30px;
    backdrop-filter: blur(10px);
}

.games-title {
    color: #00cccc;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.games-title i {
    font-size: 20px;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.game-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 204, 204, 0.2);
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-card:hover {
    background: rgba(0, 204, 204, 0.15);
    border-color: rgba(0, 204, 204, 0.5);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 204, 204, 0.2);
}

.game-card i {
    font-size: 32px;
    color: #00cccc;
    margin-bottom: 10px;
    display: block;
}

.game-card span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 500;
}

/* Chat IA Widget */
.ai-chat-widget {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 1000;
}

.ai-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0055ff, #00cccc);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 85, 255, 0.4);
    transition: all 0.3s ease;
}

.ai-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(0, 204, 204, 0.5);
}

.ai-chat-toggle i {
    font-size: 28px;
    color: white;
}

.ai-chat-box {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 350px;
    height: 450px;
    background: rgba(10, 22, 40, 0.95);
    border: 1px solid rgba(0, 204, 204, 0.3);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.ai-chat-box.open {
    display: flex;
    animation: chat-open 0.3s ease;
}

@keyframes chat-open {
    from { opacity: 0; transform: translateY(20px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.ai-chat-header {
    background: linear-gradient(135deg, rgba(0, 85, 255, 0.3), rgba(0, 204, 204, 0.2));
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 204, 204, 0.2);
}

.ai-chat-header h4 {
    color: #ffffff;
    margin: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-chat-header h4 i {
    color: #00cccc;
}

.ai-chat-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 20px;
    transition: color 0.2s;
}

.ai-chat-close:hover {
    color: #ffffff;
}

.ai-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ai-message {
    display: flex;
    gap: 10px;
    animation: message-in 0.3s ease;
}

@keyframes message-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-message.user {
    flex-direction: row-reverse;
}

.ai-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0055ff, #00cccc);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-avatar i {
    color: white;
    font-size: 16px;
}

.user .ai-avatar {
    background: linear-gradient(135deg, #00cc66, #00cccc);
}

.message-bubble {
    background: rgba(0, 85, 255, 0.15);
    border: 1px solid rgba(0, 204, 204, 0.2);
    border-radius: 16px;
    padding: 12px 16px;
    max-width: 80%;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.5;
}

.user .message-bubble {
    background: rgba(0, 204, 102, 0.15);
    border-color: rgba(0, 204, 102, 0.3);
}

.ai-chat-input {
    padding: 15px 20px;
    border-top: 1px solid rgba(0, 204, 204, 0.2);
    display: flex;
    gap: 10px;
}

.ai-chat-input input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 204, 204, 0.2);
    border-radius: 25px;
    padding: 12px 20px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.ai-chat-input input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.ai-chat-input input:focus {
    border-color: rgba(0, 204, 204, 0.5);
}

.ai-chat-input button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0055ff, #00cccc);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.ai-chat-input button:hover {
    transform: scale(1.05);
}

.ai-chat-input button i {
    color: white;
    font-size: 18px;
}

/* Painel direito - Login Form */
.login-form-panel {
    width: 480px;
    background: rgba(10, 22, 40, 0.8);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border-left: 1px solid rgba(0, 204, 204, 0.15);
}

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

.login-form-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-form-header h2 {
    color: #ffffff;
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.login-form-header p {
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* Form Styles */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-group .input-wrapper {
    position: relative;
}

.form-group .input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(0, 204, 204, 0.6);
    font-size: 18px;
}

.form-group input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 204, 204, 0.2);
    border-radius: 12px;
    padding: 14px 16px 14px 50px;
    color: white;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-group input:focus {
    border-color: #00cccc;
    background: rgba(0, 204, 204, 0.08);
    box-shadow: 0 0 20px rgba(0, 204, 204, 0.15);
}

/* Login Button */
.btn-login {
    width: 100%;
    background: linear-gradient(135deg, #0055ff, #00cccc);
    border: none;
    border-radius: 12px;
    padding: 16px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-login::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-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 85, 255, 0.4);
}

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

/* Links */
.form-links {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.form-links a {
    color: rgba(0, 204, 204, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.form-links a:hover {
    color: #00cccc;
}

/* Divider */
.login-divider {
    display: flex;
    align-items: center;
    margin: 30px 0;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.login-divider span {
    padding: 0 15px;
}

/* Alert Messages */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.alert-danger {
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.alert-info {
    background: rgba(0, 204, 204, 0.15);
    border: 1px solid rgba(0, 204, 204, 0.3);
    color: #67e8f9;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #00cccc;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modal de Jogo */
.game-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.game-modal.open {
    display: flex;
    animation: modal-in 0.3s ease;
}

@keyframes modal-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.game-modal-content {
    background: rgba(10, 22, 40, 0.95);
    border: 1px solid rgba(0, 204, 204, 0.3);
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    backdrop-filter: blur(20px);
    overflow: hidden;
}

.game-modal-header {
    background: linear-gradient(135deg, rgba(0, 85, 255, 0.2), rgba(0, 204, 204, 0.15));
    padding: 20px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 204, 204, 0.2);
}

.game-modal-header h3 {
    color: #ffffff;
    margin: 0;
    font-size: 20px;
}

.game-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 24px;
    transition: color 0.2s;
}

.game-modal-close:hover {
    color: #ffffff;
}

.game-modal-body {
    padding: 30px;
}

/* Jogo da Memoria */
.memory-game {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.memory-card {
    aspect-ratio: 1;
    background: rgba(0, 85, 255, 0.15);
    border: 1px solid rgba(0, 204, 204, 0.3);
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: all 0.3s ease;
    color: transparent;
}

.memory-card:hover {
    background: rgba(0, 204, 204, 0.2);
    transform: scale(1.05);
}

.memory-card.flipped,
.memory-card.matched {
    background: rgba(0, 204, 204, 0.3);
    color: white;
}

.memory-card.matched {
    background: rgba(0, 204, 102, 0.3);
    border-color: rgba(0, 204, 102, 0.5);
}

/* Responsive */
@media (max-width: 992px) {
    .login-container {
        flex-direction: column;
    }

    .login-features-panel {
        padding: 20px;
        order: 2;
    }

    .login-form-panel {
        width: 100%;
        order: 1;
        border-left: none;
        border-bottom: 1px solid rgba(0, 204, 204, 0.15);
    }

    .digital-clock-widget {
        position: relative;
        top: 0;
        left: 0;
        margin-bottom: 20px;
        text-align: center;
    }

    .games-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .ai-chat-box {
        width: calc(100vw - 60px);
        max-width: 350px;
    }
}

@media (max-width: 576px) {
    .clock-time {
        font-size: 36px;
    }

    .games-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .game-card {
        padding: 15px 10px;
    }

    .game-card i {
        font-size: 24px;
    }
}

/* Scrollbar customizada */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 204, 204, 0.4);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 204, 204, 0.6);
}
