@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

html {
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #f8f8f8;
    overflow-x: hidden;
    touch-action: pan-y;
    -webkit-user-select: none;
    user-select: none;
}

/* Prevenir zoom em double tap */
* {
    -webkit-tap-highlight-color: transparent;
}

input, textarea, select {
    -webkit-user-select: text;
    user-select: text;
}

/* --- Estilos da Tela de Loading Simplificada --- */
#intro {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
}

.intro-container {
    text-align: center;
    position: relative;
    width: 100%;
    max-width: 700px;
}

.logo-animation {
    position: relative;
    margin: 0 auto;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: logoPulse 2s ease-in-out infinite;
}

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

/* --- Header Simplificado --- */
.logo-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
}

.logo-header-img {
    height: 60px;
    width: auto;
    object-fit: contain;
}

@media (min-width: 1024px) {
    .logo-header-img {
        height: 80px;
    }
}

/* --- Main App Styles --- */
.glass-panel {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.neon-glow {
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5),
                0 0 20px rgba(245, 158, 11, 0.3),
                0 0 40px rgba(245, 158, 11, 0.1);
}

.gradient-text {
    background: linear-gradient(to right, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.status-indicator {
    position: relative;
    overflow: hidden;
}

.status-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, #22c55e, #f59e0b);
    transform: translateX(-100%);
    animation: statusLine 3s ease-in-out infinite;
}

@keyframes statusLine {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
    100% { transform: translateX(100%); }
}

.floating {
    animation: floating 6s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.pulse-slow {
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.slide-in {
    animation: slideIn 0.8s ease-out forwards;
}

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

.fade-in {
    animation: fadeIn 1s ease-out forwards;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 2fr 1fr;
    }
}

.signal-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .signal-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.metric-card {
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    transition: all 0.3s ease;
    border-radius: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 158, 11, 0.4);
}

.btn-secondary {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
    transition: all 0.3s ease;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
}

.btn-secondary:hover {
    background: rgba(245, 158, 11, 0.2);
    transform: translateY(-2px);
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.5s ease;
    transform: rotate(90deg);
    transform-origin: 50% 50%;
}

.nav-item {
    position: relative;
    overflow: hidden;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #f59e0b;
    transition: width 0.3s ease;
}

.nav-item.active::after {
    width: 100%;
}

.nav-item:hover::after {
    width: 100%;
}

/* --- Estilos específicos para a plataforma ByNox --- */
.platform-container {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    border: 1px solid #333;
}

.platform-header {
    background: #111;
    padding: 12px 16px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.platform-controls {
    display: flex;
    gap: 8px;
}

.platform-control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.platform-control.close {
    background: #ff5f57;
}

.platform-control.minimize {
    background: #ffbd2e;
}

.platform-control.maximize {
    background: #28ca42;
}

/* Aumentar a altura da corretora */
.platform-frame-container {
    position: relative;
    width: 100%;
    height: 700px; /* Aumentado de 600px */
}

@media (max-width: 767px) {
    .platform-frame-container {
        height: 600px; /* Aumentado de 500px */
    }
}

@media (min-width: 1024px) {
    .platform-frame-container {
        height: 800px; /* Aumentado de 700px */
    }
}

.platform-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
}

/* Modo mobile otimizado por padrão */
.platform-mobile-optimized {
    transform: scale(0.85);
    transform-origin: top left;
    width: 117.65%;
    height: 117.65%;
}

@media (max-width: 480px) {
    .platform-mobile-optimized {
        transform: scale(0.75);
        width: 133.33%;
        height: 133.33%;
    }
}

@media (max-width: 360px) {
    .platform-mobile-optimized {
        transform: scale(0.65);
        width: 153.85%;
        height: 153.85%;
    }
}

.platform-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 10;
    padding: 20px;
    text-align: center;
}

.platform-overlay.hidden {
    display: none;
}

/* Botões otimizados para mobile */
.platform-controls-mobile {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

@media (min-width: 640px) {
    .platform-controls-mobile {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

.platform-btn {
    flex: 1;
    min-width: 140px;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

/* --- Estilos para a área Gerar Sinal de Trading --- */
.signal-generator {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    position: relative;
}

.signal-generator::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f59e0b, #fbbf24, #f59e0b);
    animation: statusLine 3s ease-in-out infinite;
}

.signal-header {
    background: rgba(245, 158, 11, 0.05);
    padding: 20px 24px;
    border-bottom: 1px solid rgba(245, 158, 11, 0.1);
}

.signal-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.signal-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 18px;
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #fbbf24;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 12px;
    padding: 14px 16px;
    color: #ffffff;
    font-size: 15px;
    transition: all 0.3s ease;
    -webkit-user-select: text;
    user-select: text;
}

.form-input:focus {
    outline: none;
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.12);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.form-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23fbbf24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    cursor: pointer;
}

.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 640px) {
    .grid-2-col {
        grid-template-columns: 1fr;
    }
}

.generate-btn {
    width: 100%;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    border: none;
    border-radius: 14px;
    padding: 18px 24px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.generate-btn::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.5s ease;
}

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

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

.generate-btn:active {
    transform: translateY(-1px);
}

.generate-btn:disabled {
    opacity: 0.6;
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
}

.signal-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(245, 158, 11, 0.1);
}

.feature-item {
    text-align: center;
    padding: 12px;
    background: rgba(245, 158, 11, 0.05);
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.feature-item:hover {
    background: rgba(245, 158, 11, 0.1);
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 20px;
    margin-bottom: 8px;
    color: #fbbf24;
}

.feature-text {
    font-size: 12px;
    color: #fbbf24;
    font-weight: 500;
}

/* --- Chat Flutuante de Suporte --- */
.chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
}

.chat-button {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
    transition: all 0.3s ease;
    animation: pulse-chat 2s infinite;
    border: none;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(245, 158, 11, 0.6);
}

.chat-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chat-container.open {
    display: flex;
    animation: chatSlideUp 0.3s ease-out;
}

.chat-header {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    padding: 16px 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    font-weight: 600;
    font-size: 16px;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 85%;
    line-height: 1.4;
    font-size: 14px;
}

.message.bot {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message.user {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-input-area {
    padding: 16px;
    border-top: 1px solid rgba(245, 158, 11, 0.2);
    display: flex;
    gap: 8px;
}

.chat-input {
    flex: 1;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 20px;
    padding: 12px 16px;
    color: white;
    font-size: 14px;
    outline: none;
    -webkit-user-select: text;
    user-select: text;
}

.chat-input:focus {
    border-color: rgba(245, 158, 11, 0.5);
}

.chat-send {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-send:hover {
    transform: scale(1.05);
}

.faq-questions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.faq-question {
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.1);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    color: #fbbf24;
    border: none;
}

.faq-question:hover {
    background: rgba(245, 158, 11, 0.1);
    transform: translateX(4px);
}

/* Sistema de Alerta - Design Melhorado */
.alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.alert-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.alert-box {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 3px solid #f59e0b;
    border-radius: 20px;
    padding: 40px 30px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(245, 158, 11, 0.5),
                0 0 0 1px rgba(245, 158, 11, 0.3),
                inset 0 0 20px rgba(245, 158, 11, 0.1);
    animation: alertPulse 2s infinite;
    position: relative;
    overflow: hidden;
}

.alert-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #f59e0b, #fbbf24, #f59e0b);
    animation: statusLine 3s ease-in-out infinite;
}

.alert-icon {
    font-size: 64px;
    color: #f59e0b;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { 
        transform: scale(1);
        text-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
    }
    50% { 
        transform: scale(1.1);
        text-shadow: 0 0 30px rgba(245, 158, 11, 0.8);
    }
}

.alert-title {
    font-size: 28px;
    font-weight: 800;
    color: #fbbf24;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.alert-message {
    color: #ffffff;
    margin-bottom: 25px;
    line-height: 1.6;
    font-size: 16px;
    background: rgba(245, 158, 11, 0.1);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-timer {
    font-size: 42px;
    font-weight: 900;
    color: #ef4444;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
    animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% { 
        transform: scale(1);
        text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
    }
    50% { 
        transform: scale(1.05);
        text-shadow: 0 0 15px rgba(239, 68, 68, 0.8);
    }
}

.alert-close {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 32px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.alert-close:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
}

.alert-close:active {
    transform: translateY(-1px);
}

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

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

@keyframes alertPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 20px 60px rgba(245, 158, 11, 0.5),
                    0 0 0 1px rgba(245, 158, 11, 0.3),
                    inset 0 0 20px rgba(245, 158, 11, 0.1);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 25px 70px rgba(245, 158, 11, 0.7),
                    0 0 0 1px rgba(245, 158, 11, 0.5),
                    inset 0 0 25px rgba(245, 158, 11, 0.2);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .logo-animation {
        width: 150px;
        height: 150px;
    }
    
    .logo-header-img {
        height: 50px;
    }
    
    .platform-container {
        margin-left: -10px;
        margin-right: -10px;
        width: calc(100% + 20px);
        border-radius: 12px;
    }
    
    .chat-container {
        width: 340px;
        height: 500px;
        right: -10px;
    }
    
    .chat-widget {
        bottom: 16px;
        right: 16px;
    }
    
    .alert-box {
        padding: 30px 20px;
        max-width: 380px;
    }
    
    .alert-title {
        font-size: 24px;
    }
    
    .alert-icon {
        font-size: 48px;
    }
    
    .alert-timer {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .logo-animation {
        width: 120px;
        height: 120px;
    }
    
    .logo-header-img {
        height: 45px;
    }
    
    .platform-container {
        margin-left: -15px;
        margin-right: -15px;
        width: calc(100% + 30px);
    }
    
    .signal-header {
        padding: 16px 20px;
    }
    
    .signal-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .chat-container {
        width: 320px;
        height: 480px;
        right: -15px;
    }
    
    .platform-frame-container {
        height: 550px;
    }
    
    .alert-box {
        padding: 25px 15px;
        max-width: 320px;
    }
    
    .alert-title {
        font-size: 20px;
    }
    
    .alert-icon {
        font-size: 40px;
    }
    
    .alert-timer {
        font-size: 32px;
    }
}