/* Revobit theme - fully CSS-variable driven */
:root {
  --primary: #0ecb81;
  --secondary: #06d6a0;
  --bg: #0b0e11;
  --card: #1e2329;
  --surface: #1e2638;
  --surface-2: #2a2e39;
  --text: #ffffff;
  --muted: #848e9c;
  --danger: #f6465d;
  --primary-rgb: 14, 203, 129;
  --border: rgba(var(--primary-rgb), 0.18);
  --glow: 0 0 20px rgba(var(--primary-rgb), 0.35);
  --radius: 14px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

    body { box-sizing: border-box; }
    * { margin: 0; padding: 0; box-sizing: border-box; }
    html, body { height: 100%; font-family: var(--font); background: var(--bg); color: var(--text); }

    /* Navigation */
    nav { background: var(--card); border-bottom: 1px solid var(--surface); padding: 1rem 2rem; position: sticky; top: 0; z-index: 1000; display: flex; justify-content: space-between; align-items: center; backdrop-filter: blur(20px); }
    .logo { font-size: 1.75rem; font-weight: 900; background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; display: flex; align-items: center; gap: 0.5rem; }
    .nav-links { display: flex; gap: 2rem; align-items: center; flex-wrap: wrap; }
    .nav-link { color: var(--muted); text-decoration: none; font-weight: 600; cursor: pointer; transition: all 0.3s; position: relative; white-space: nowrap; }
    .nav-link:hover { color: var(--primary); }
    .nav-link::after { content: ''; position: absolute; bottom: -5px; left: 0; width: 0; height: 2px; background: var(--primary); transition: width 0.3s; }
    .nav-link:hover::after { width: 100%; }

    /* Hero Section */
    .hero { padding: 8rem 2rem 6rem; text-align: center; background: radial-gradient(circle at 50% 0%, rgba(var(--primary-rgb), 0.15) 0%, transparent 70%); position: relative; overflow: hidden; }
    .hero::before { content: ''; position: absolute; top: -50%; left: 50%; transform: translateX(-50%); width: 1000px; height: 1000px; background: radial-gradient(circle, rgba(var(--primary-rgb), 0.2) 0%, transparent 70%); animation: pulse 8s ease-in-out infinite; }
    @keyframes pulse { 0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.5; } 50% { transform: translateX(-50%) scale(1.2); opacity: 0.8; } }
    .hero-content { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; }
    .hero h1 { font-size: 5rem; font-weight: 900; margin-bottom: 1.5rem; background: linear-gradient(135deg, var(--text) 0%, var(--primary) 50%, var(--secondary) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1.1; letter-spacing: -2px; }
    .hero p { font-size: 1.5rem; color: var(--muted); margin-bottom: 3rem; line-height: 1.6; }
    .hero-buttons { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; }
    .btn { padding: 1.25rem 3rem; background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); color: var(--text); border: none; border-radius: 12px; font-size: 1.1rem; font-weight: 700; cursor: pointer; transition: all 0.3s; text-decoration: none; display: inline-block; box-shadow: 0 10px 30px rgba(var(--primary-rgb), 0.3); }
    .btn:hover { transform: translateY(-3px); box-shadow: 0 15px 40px rgba(var(--primary-rgb), 0.4); }
    .btn-secondary { background: var(--surface); box-shadow: none; }
    .btn-secondary:hover { background: var(--surface-2); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3); }

    /* Stats Grid */
    .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; padding: 4rem 2rem; max-width: 1400px; margin: 0 auto; }
    .stat-card { background: linear-gradient(135deg, var(--card) 0%, var(--surface) 100%); border: 1px solid var(--surface-2); border-radius: 20px; padding: 2.5rem; text-align: center; transition: all 0.3s; position: relative; overflow: hidden; }
    .stat-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: linear-gradient(90deg, var(--primary), var(--secondary)); }
    .stat-card:hover { transform: translateY(-8px); box-shadow: 0 20px 40px rgba(var(--primary-rgb), 0.2); }
    .stat-value { font-size: 3rem; font-weight: 900; color: var(--primary); margin-bottom: 0.5rem; }
    .stat-label { color: var(--muted); font-size: 1.1rem; font-weight: 600; }

    /* Features */
    .features-section { padding: 6rem 2rem; background: var(--bg); }
    .section-title { text-align: center; font-size: 3rem; font-weight: 900; margin-bottom: 1rem; color: var(--text); }
    .section-subtitle { text-align: center; color: var(--muted); font-size: 1.2rem; margin-bottom: 4rem; }
    .features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2.5rem; max-width: 1400px; margin: 0 auto; }
    .feature-card { background: var(--card); border: 1px solid var(--surface); border-radius: 20px; padding: 2.5rem; transition: all 0.3s; position: relative; overflow: hidden; }
    .feature-card::before { pointer-events: none;  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.05) 0%, transparent 100%); opacity: 0; transition: opacity 0.3s; }
    .feature-card:hover::before { opacity: 1; }
    .feature-card:hover { transform: translateY(-8px); border-color: var(--primary); box-shadow: 0 20px 40px rgba(var(--primary-rgb), 0.2); }
    .feature-icon { font-size: 3.5rem; margin-bottom: 1.5rem; }
    .feature-card h3 { font-size: 1.5rem; font-weight: 700; color: var(--text); margin-bottom: 1rem; }
    .feature-card p { color: var(--muted); line-height: 1.7; }

    /* Markets Section */
    .markets-preview { padding: 6rem 2rem; }
    .markets-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; max-width: 1400px; margin: 0 auto; }
    .market-preview-card { background: var(--card); border: 1px solid var(--surface); border-radius: 16px; padding: 1.5rem; display: flex; justify-content: space-between; align-items: center; transition: all 0.3s; cursor: pointer; }
    .market-preview-card:hover { border-color: var(--primary); transform: translateX(5px); }
    .market-info h4 { font-size: 1.1rem; color: var(--text); font-weight: 700; margin-bottom: 0.25rem; }
    .market-info p { color: var(--muted); font-size: 0.9rem; }
    .market-price { text-align: right; }
    .market-price .price { font-size: 1.3rem; font-weight: 700; color: var(--text); }
    .market-price .change { font-size: 0.9rem; font-weight: 600; }
    .positive { color: var(--primary); }
    .negative { color: #f6465d; }

    /* Pages */
    .page { display: none; min-height: calc(100% - 80px); }
    .page.active { display: block; }

    /* Auth */
    .auth-container { max-width: 500px; margin: 4rem auto; padding: 3rem; background: var(--card); border: 1px solid var(--surface); border-radius: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4); }
    .auth-title { font-size: 2.5rem; font-weight: 900; margin-bottom: 2rem; text-align: center; background: linear-gradient(135deg, var(--text) 0%, var(--primary) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
    .input-group { margin-bottom: 1.5rem; }
    .input-group label { display: block; margin-bottom: 0.5rem; color: var(--muted); font-size: 0.95rem; font-weight: 600; }
    .input-group input, .input-group select { width: 100%; padding: 1rem; background: var(--surface); border: 2px solid var(--surface-2); border-radius: 12px; color: var(--text); font-size: 1rem; transition: all 0.3s; }
    .input-group input:focus, .input-group select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1); }

    /* Dashboard */
    .dashboard { padding: 2rem; max-width: 1600px; margin: 0 auto; }
    .dashboard-header { margin-bottom: 2rem; }
    .dashboard-title { font-size: 2.5rem; font-weight: 900; color: var(--text); margin-bottom: 0.5rem; }
    .dashboard-subtitle { color: var(--muted); font-size: 1.1rem; }
    .balance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
    .balance-card { background: linear-gradient(135deg, var(--card) 0%, var(--surface) 100%); border: 1px solid var(--surface-2); border-radius: 16px; padding: 2rem; transition: all 0.3s; position: relative; overflow: hidden; }
    .balance-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: linear-gradient(90deg, var(--primary), var(--secondary)); }
    .balance-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(var(--primary-rgb), 0.2); }
    .balance-label { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.75rem; font-weight: 600; }
    .balance-value { font-size: 2.5rem; font-weight: 900; color: var(--text); }
    .balance-change { font-size: 1rem; margin-top: 0.5rem; font-weight: 600; }

    /* Trade Steps */
    .trade-step { display: none; }
    .trade-step.active { display: block; }
    
    /* Trading Professional Layout */
    .trading-professional-layout { 
      display: grid; 
      grid-template-columns: 280px 1fr 360px; 
      height: calc(100vh - 80px); 
      overflow: hidden;
      gap: 0;
    }
    
    /* Sidebar Mercati */
    .trading-sidebar { 
      background: var(--bg); 
      border-right: 1px solid var(--surface); 
      display: flex; 
      flex-direction: column;
      overflow: hidden;
    }
    .sidebar-header { 
      background: var(--card);
      padding: 1.5rem; 
      border-bottom: 2px solid var(--primary);
    }
    .sidebar-header h3 { 
      color: var(--text); 
      font-size: 1.2rem; 
      font-weight: 900; 
      margin: 0;
    }
    .sidebar-markets { 
      flex: 1; 
      overflow-y: auto; 
      padding: 1rem;
    }
    
    /* Area Grafico Centrale */
    .trading-chart-area { 
      background: var(--bg); 
      display: flex; 
      flex-direction: column;
      overflow: hidden;
    }
    .chart-container { 
      flex: 1; 
      display: flex; 
      flex-direction: column; 
      padding: 2rem;
    }
    .chart-top-bar { 
      display: flex; 
      justify-content: space-between; 
      align-items: center; 
      margin-bottom: 2rem;
      padding-bottom: 1.5rem;
      border-bottom: 2px solid var(--surface);
    }
    .chart-symbol-info h2 { 
      font-size: 2.5rem; 
      font-weight: 900; 
      color: var(--text); 
      margin: 0 0 0.5rem 0;
    }
    .chart-desc { 
      color: var(--muted); 
      font-size: 1rem;
    }
    .chart-price-info { 
      text-align: right;
    }
    .chart-current-price { 
      font-size: 3.5rem; 
      font-weight: 900; 
      color: var(--primary);
      line-height: 1;
      margin-bottom: 0.5rem;
    }
    .chart-change { 
      font-size: 1.2rem; 
      font-weight: 700;
    }
    
    /* Pannello Ordini Destra */
    .trading-order-panel { 
      background: var(--card); 
      border-left: 1px solid var(--surface);
      display: flex;
      flex-direction: column;
      overflow-y: auto;
    }
    .order-panel-header { 
      padding: 1.5rem; 
      border-bottom: 2px solid var(--surface);
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: var(--bg);
    }
    .order-panel-header h3 { 
      color: var(--text); 
      font-size: 1.3rem; 
      font-weight: 900; 
      margin: 0;
    }
    .balance-display { 
      color: var(--primary); 
      font-size: 1.1rem; 
      font-weight: 700;
    }
    .order-tabs { 
      display: grid; 
      grid-template-columns: 1fr 1fr; 
      gap: 0;
      padding: 1rem;
      background: var(--bg);
    }
    .order-tab { 
      padding: 1rem; 
      background: var(--surface); 
      border: 2px solid var(--surface-2);
      color: var(--muted); 
      font-weight: 700; 
      cursor: pointer; 
      transition: all 0.3s;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.5rem;
      font-size: 0.95rem;
    }
    .order-tab:first-child { border-radius: 12px 0 0 12px; }
    .order-tab:last-child { border-radius: 0 12px 12px 0; }
    .order-tab .tab-icon { font-size: 1.5rem; }
    .order-tab.active { 
      background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); 
      color: var(--text); 
      border-color: var(--primary);
      transform: scale(1.02);
    }
    .order-tab.active.sell-active {
      background: linear-gradient(135deg, #f6465d 0%, #e03d52 100%);
      border-color: #f6465d;
    }
    .order-form { 
      padding: 1.5rem;
      flex: 1;
    }
    .form-field { 
      margin-bottom: 1.5rem;
    }
    .form-field label { 
      display: block; 
      color: var(--muted); 
      font-size: 0.9rem; 
      font-weight: 600; 
      margin-bottom: 0.75rem;
    }
    .form-field input, .form-field select { 
      width: 100%; 
      padding: 1rem; 
      background: var(--surface); 
      border: 2px solid var(--surface-2); 
      border-radius: 12px; 
      color: var(--text); 
      font-size: 1rem;
      font-weight: 600;
      transition: all 0.3s;
    }
    .form-field input:focus, .form-field select:focus { 
      outline: none; 
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
    }
    .order-summary { 
      background: var(--surface); 
      padding: 1.25rem; 
      border-radius: 12px; 
      margin-bottom: 1.5rem;
      border-left: 4px solid var(--primary);
    }
    .summary-row { 
      display: flex; 
      justify-content: space-between; 
      margin-bottom: 0.75rem;
      font-size: 0.95rem;
    }
    .summary-row:last-child { margin-bottom: 0; }
    .summary-row span:first-child { color: var(--muted); }
    .summary-row span:last-child { color: var(--text); font-weight: 700; }
    .btn-order { 
      width: 100%; 
      padding: 1.25rem; 
      border: none; 
      border-radius: 12px; 
      font-size: 1.1rem; 
      font-weight: 900; 
      cursor: pointer; 
      transition: all 0.3s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.75rem;
    }
    .btn-order.buy-btn { 
      background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); 
      color: var(--text);
      box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.3);
    }
    .btn-order.buy-btn:hover { 
      transform: translateY(-2px);
      box-shadow: 0 12px 30px rgba(var(--primary-rgb), 0.4);
    }
    .btn-order.sell-btn { 
      background: linear-gradient(135deg, #f6465d 0%, #e03d52 100%); 
      color: var(--text);
      box-shadow: 0 8px 20px rgba(246, 70, 93, 0.3);
    }
    .btn-order.sell-btn:hover { 
      transform: translateY(-2px);
      box-shadow: 0 12px 30px rgba(246, 70, 93, 0.4);
    }
    .btn-icon { font-size: 1.3rem; }
    .market-category { margin-bottom: 2rem; }
    .category-title { color: var(--primary); font-size: 0.85rem; font-weight: 700; text-transform: uppercase; margin-bottom: 1rem; letter-spacing: 1px; }
    .market-item { padding: 1rem; background: var(--surface); border-radius: 12px; margin-bottom: 0.75rem; cursor: pointer; transition: all 0.3s; border: 2px solid transparent; display: flex; justify-content: space-between; align-items: center; }
    .market-item:hover, .market-item.active { border-color: var(--primary); transform: translateX(5px); background: rgba(var(--primary-rgb), 0.1); }
    .market-name { font-weight: 700; color: var(--text); font-size: 0.95rem; }
    .market-symbol { color: var(--muted); font-size: 0.85rem; }
    .market-price-col { text-align: right; }
    .market-price-value { color: var(--text); font-weight: 700; font-size: 1rem; }

    /* Chart - DESIGN MIGLIORATO */
    .chart-area { background: var(--card); border: 1px solid var(--surface); border-radius: 16px; padding: 2rem; display: flex; flex-direction: column; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); }
    .chart-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 2px solid var(--surface); }
    .chart-symbol { font-size: 2rem; font-weight: 900; color: var(--text); margin-bottom: 0.5rem; }
    .chart-desc { color: var(--muted); font-size: 1rem; }
    .chart-price { font-size: 3rem; font-weight: 900; color: var(--primary); line-height: 1; }
    .chart-canvas { flex: 1; position: relative; min-height: 450px; background: linear-gradient(180deg, var(--bg) 0%, var(--card) 100%); border-radius: 12px; overflow: hidden; border: 1px solid var(--surface); display: flex; align-items: flex-end; padding: 20px 10px; }
    .candle { position: relative; width: 8px; border-radius: 2px; margin: 0 2px; transition: all 0.3s; }
    .candle.green { background: var(--primary); box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.3); }
    .candle.red { background: #f6465d; box-shadow: 0 0 10px rgba(246, 70, 93, 0.3); }

    /* Trade Panel - MIGLIORATO */
    .trade-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1.5rem; }
    .trade-tab { padding: 1.25rem; background: var(--surface); border: none; border-radius: 12px; color: var(--muted); font-weight: 700; cursor: pointer; transition: all 0.3s; font-size: 1rem; }
    .trade-tab.active.buy { background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); color: var(--text); box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.4); transform: translateY(-2px); }
    .trade-tab.active.sell { background: linear-gradient(135deg, #f6465d 0%, #e03d52 100%); color: var(--text); box-shadow: 0 8px 20px rgba(246, 70, 93, 0.4); transform: translateY(-2px); }
    .leverage-selector { margin-bottom: 1.5rem; }
    .leverage-buttons { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; margin-top: 0.75rem; }
    .leverage-btn { padding: 0.75rem; background: var(--surface); border: 2px solid var(--surface-2); border-radius: 10px; color: var(--muted); font-weight: 700; cursor: pointer; transition: all 0.3s; }
    .leverage-btn.active { background: var(--primary); color: var(--text); border-color: var(--primary); transform: scale(1.05); box-shadow: 0 5px 15px rgba(var(--primary-rgb), 0.3); }
    .trade-info-box { background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%); padding: 1.5rem; border-radius: 12px; margin-bottom: 1.5rem; border-left: 4px solid var(--primary); }
    .trade-info-row { display: flex; justify-content: space-between; margin-bottom: 0.75rem; }
    .trade-info-row:last-child { margin-bottom: 0; }
    .trade-info-label { color: var(--muted); font-size: 0.9rem; }
    .trade-info-value { color: var(--text); font-weight: 700; font-size: 1.1rem; }

    /* Positions */
    .positions-section { margin-top: 2rem; background: var(--card); border: 1px solid var(--surface); border-radius: 16px; padding: 2rem; }
    .positions-header { font-size: 1.5rem; font-weight: 900; color: var(--text); margin-bottom: 1.5rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
    .position-card { background: var(--surface); border-radius: 16px; padding: 1.75rem; margin-bottom: 1.25rem; border-left: 4px solid var(--primary); transition: all 0.3s; }
    .position-card.short { border-left-color: #f6465d; }
    .position-card:hover { box-shadow: 0 10px 30px rgba(var(--primary-rgb), 0.2); transform: translateY(-3px); }
    .position-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; flex-wrap: wrap; gap: 1rem; }
    .position-symbol { font-size: 1.3rem; font-weight: 900; color: var(--text); }
    .position-type { padding: 0.4rem 1rem; border-radius: 8px; font-size: 0.9rem; font-weight: 700; text-transform: uppercase; }
    .position-type.long { background: rgba(var(--primary-rgb), 0.2); color: var(--primary); }
    .position-type.short { background: rgba(246, 70, 93, 0.2); color: #f6465d; }
    .position-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1.5rem; margin-bottom: 1.25rem; }
    .position-detail { display: flex; flex-direction: column; }
    .position-detail-label { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.5rem; font-weight: 600; }
    .position-detail-value { color: var(--text); font-weight: 700; font-size: 1.1rem; }
    .position-pnl { font-size: 1.75rem; font-weight: 900; text-align: center; padding: 1rem; background: rgba(var(--primary-rgb), 0.1); border-radius: 12px; margin-bottom: 1rem; }
    .position-pnl.negative { background: rgba(246, 70, 93, 0.1); color: #f6465d; }
    .btn-danger { background: linear-gradient(135deg, #f6465d 0%, #e03d52 100%); }
    .btn-danger:hover { box-shadow: 0 10px 30px rgba(246, 70, 93, 0.4); }

    /* Wallet */
    .wallet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; margin-top: 2rem; }
    .wallet-card { background: var(--card); border: 1px solid var(--surface); border-radius: 16px; padding: 2rem; }
    .wallet-card h3 { font-size: 1.5rem; font-weight: 900; color: var(--text); margin-bottom: 1.5rem; }
    .crypto-list { display: grid; gap: 1rem; }
    .crypto-item { background: var(--surface); padding: 1.25rem; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; transition: all 0.3s; flex-wrap: wrap; gap: 1rem; }
    .crypto-item:hover { background: var(--surface-2); transform: translateX(5px); }
    .crypto-icon { font-size: 2rem; margin-right: 1rem; }
    .crypto-info { flex: 1; min-width: 150px; }
    .crypto-name { font-weight: 700; color: var(--text); font-size: 1.1rem; }
    .crypto-balance { color: var(--muted); font-size: 0.9rem; margin-top: 0.25rem; }
    .crypto-value { text-align: right; }
    .crypto-price { font-weight: 700; color: var(--text); font-size: 1.1rem; }
    .crypto-eur { color: var(--primary); font-size: 0.9rem; margin-top: 0.25rem; }

    /* Support/FAQ */
    .support-container { max-width: 1200px; margin: 0 auto; padding: 2rem; }
    .chat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; margin-top: 2rem; }
    .chat-box { background: var(--card); border: 1px solid var(--surface); border-radius: 16px; padding: 2rem; }
    .chat-messages { max-height: 500px; overflow-y: auto; margin-bottom: 1.5rem; background: var(--bg); border-radius: 12px; padding: 1.5rem; }
    .message { margin-bottom: 1.25rem; display: flex; gap: 1rem; animation: slideIn 0.3s ease-out; }
    @keyframes slideIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
    .message.user { flex-direction: row-reverse; }
    .message-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
    .message.ai .message-avatar { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); }
    .message-bubble { background: var(--surface); padding: 1rem 1.25rem; border-radius: 16px; max-width: 80%; word-wrap: break-word; }
    .message.user .message-bubble { background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); }
    .message-text { color: var(--text); line-height: 1.6; }
    .message-time { font-size: 0.8rem; color: var(--muted); margin-top: 0.5rem; }
    .chat-input-form { display: flex; gap: 1rem; flex-wrap: wrap; }
    .chat-input { flex: 1; min-width: 200px; padding: 1rem; background: var(--surface); border: 2px solid var(--surface-2); border-radius: 12px; color: var(--text); }
    .chat-input:focus { outline: none; border-color: var(--primary); }
    .faq-list { display: grid; gap: 1.25rem; margin-top: 2rem; }
    .faq-item { background: var(--card); border: 1px solid var(--surface); border-radius: 16px; overflow: hidden; transition: all 0.3s; }
    .faq-item:hover { border-color: var(--primary); }
    .faq-question { padding: 1.5rem; font-weight: 700; color: var(--text); cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-size: 1.1rem; }
    .faq-answer { padding: 0 1.5rem 1.5rem; color: var(--muted); line-height: 1.8; display: none; }
    .faq-item.active .faq-answer { display: block; }
    .faq-icon { color: var(--primary); font-size: 1.5rem; transition: transform 0.3s; }
    .faq-item.active .faq-icon { transform: rotate(45deg); }

    /* Admin - SISTEMA RETTANGOLO NERO */
    .admin-grid { display: grid; grid-template-columns: 280px 1fr; gap: 2rem; height: auto; min-height: calc(100vh - 150px); }
    .admin-sidebar { background: var(--card); border: 1px solid var(--surface); border-radius: 16px; padding: 1.5rem; height: fit-content; }
    .admin-menu-item { padding: 1rem 1.25rem; background: var(--surface); border-radius: 12px; margin-bottom: 0.75rem; cursor: pointer; transition: all 0.3s; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 0.75rem; }
    .admin-menu-item:hover { background: var(--surface-2); color: var(--text); }
    .admin-menu-item.active { background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); color: var(--text); transform: translateX(5px); }
    .admin-content { background: var(--card); border: 1px solid var(--surface); border-radius: 16px; padding: 2rem; overflow-y: visible; max-height: none; height: auto; }
    .admin-section { display: none; }
    .admin-section.active { display: block; }
    .table { width: 100%; border-collapse: collapse; margin-bottom: 2rem; overflow-x: auto; display: block; }
    .table thead { display: table; width: 100%; table-layout: fixed; }
    .table tbody { display: table; width: 100%; table-layout: fixed; }
    .table th { text-align: left; padding: 1.25rem; background: var(--surface); color: var(--muted); font-weight: 700; font-size: 0.9rem; border-bottom: 2px solid var(--surface-2); position: sticky; top: 0; z-index: 10; }
    .table td { padding: 1.25rem; border-bottom: 1px solid var(--surface); color: var(--text); word-wrap: break-word; }
    .table tr:hover { background: rgba(var(--primary-rgb), 0.05); }
    .badge { padding: 0.4rem 0.9rem; border-radius: 8px; font-size: 0.85rem; font-weight: 700; white-space: nowrap; }
    .badge-success { background: rgba(var(--primary-rgb), 0.2); color: var(--primary); }
    .badge-warning { background: rgba(246, 189, 96, 0.2); color: #f6bd60; }
    .badge-danger { background: rgba(246, 70, 93, 0.2); color: #f6465d; }
    .btn-small { padding: 0.6rem 1.2rem; font-size: 0.9rem; white-space: nowrap; }

    /* Modal - SENZA OVERLAY NERO */
    .modal { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 10000; max-width: 90%; max-height: 90%; }
    .modal.active { display: block; }
    .modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); z-index: 9999; backdrop-filter: blur(5px); }
    .modal-overlay.active { display: block; }
    .modal-content { background: var(--card); border: 2px solid var(--primary); border-radius: 20px; max-width: 600px; width: 90vw; max-height: 85vh; overflow-y: auto; box-shadow: 0 25px 60px rgba(var(--primary-rgb), 0.3); }
    .modal-header { padding: 2rem; border-bottom: 1px solid var(--surface); display: flex; justify-content: space-between; align-items: center; background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1) 0%, transparent 100%); }
    .modal-title { font-size: 1.8rem; font-weight: 900; color: var(--text); }
    .modal-close { background: var(--surface); border: none; color: var(--muted); font-size: 1.5rem; cursor: pointer; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 10px; transition: all 0.3s; }
    .modal-close:hover { background: #f6465d; color: var(--text); transform: rotate(90deg); }
    .modal-body { padding: 2rem; }

    /* Notification */
    .notification { position: fixed; top: 100px; right: 20px; background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); color: var(--text); padding: 1.25rem 1.75rem; border-radius: 12px; box-shadow: 0 10px 30px rgba(var(--primary-rgb), 0.4); z-index: 10001; font-weight: 700; animation: slideInRight 0.3s ease-out; max-width: 90%; word-wrap: break-word; }
    .notification.error { background: linear-gradient(135deg, #f6465d 0%, #e03d52 100%); box-shadow: 0 10px 30px rgba(246, 70, 93, 0.4); }
    @keyframes slideInRight { from { transform: translateX(400px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

    /* Responsive */
    @media (max-width: 1400px) { 
      .trading-professional-layout { 
        grid-template-columns: 1fr; 
        grid-template-rows: auto 1fr auto;
        height: auto; 
      }
      .trading-sidebar { 
        border-right: none; 
        border-bottom: 1px solid var(--surface); 
        max-height: 300px; 
      }
      .trading-order-panel { 
        border-left: none; 
        border-top: 1px solid var(--surface); 
      }
      .admin-grid { grid-template-columns: 1fr; } 
    }
    @media (max-width: 768px) { 
      nav { 
        padding: 0.75rem 1rem; 
        flex-wrap: wrap; 
        gap: 0.75rem;
      }
      .logo { 
        font-size: 1.4rem; 
        gap: 0.4rem;
      }
      .logo svg {
        width: 40px;
        height: 40px;
      }
      .nav-links { 
        width: 100%;
        justify-content: space-around;
        gap: 0.5rem; 
        font-size: 0.85rem;
        flex-wrap: wrap;
      }
      .nav-link {
        padding: 0.4rem 0.75rem;
        white-space: nowrap;
      }
      .hero { 
        padding: 3rem 1.25rem 2.5rem; 
      }
      .hero h1 { 
        font-size: 2.2rem; 
        line-height: 1.2;
        letter-spacing: -1px;
      } 
      .hero p { 
        font-size: 1rem; 
        line-height: 1.5;
      } 
      .hero-buttons { 
        flex-direction: column; 
        gap: 1rem;
      }
      .btn { 
        padding: 1.1rem 2rem; 
        font-size: 1rem; 
        width: 100%; 
      }
      .stats-grid { 
        grid-template-columns: 1fr; 
        padding: 2rem 1.25rem; 
        gap: 1.25rem;
      }
      .stat-card {
        padding: 2rem 1.5rem;
      }
      .stat-value { 
        font-size: 2.2rem; 
      }
      .features-grid { 
        grid-template-columns: 1fr; 
        gap: 1.5rem;
        padding: 0 0.5rem;
      }
      .feature-card {
        padding: 2rem 1.5rem;
      }
      .markets-grid { 
        grid-template-columns: 1fr; 
        gap: 1rem;
      }
      .section-title { 
        font-size: 1.9rem; 
        line-height: 1.2;
      }
      .section-subtitle { 
        font-size: 0.95rem; 
      }
      .features-section {
        padding: 4rem 1.25rem;
      }
      .markets-preview {
        padding: 4rem 1.25rem;
      }
      .dashboard { 
        padding: 1.25rem; 
      }
      .dashboard-title { 
        font-size: 1.8rem; 
        line-height: 1.2;
      }
      .dashboard-subtitle {
        font-size: 0.95rem;
      }
      .balance-grid { 
        grid-template-columns: 1fr; 
        gap: 1.25rem;
      }
      .balance-card {
        padding: 1.75rem;
      }
      .balance-value { 
        font-size: 2rem; 
      }
      .wallet-grid, .chat-grid { 
        grid-template-columns: 1fr; 
        gap: 1.5rem;
      } 
      .position-details { 
        grid-template-columns: 1fr 1fr; 
        gap: 1.25rem;
      }
      .position-card {
        padding: 1.5rem;
      }
      .chart-symbol-info h2 { 
        font-size: 1.6rem; 
      }
      .chart-current-price { 
        font-size: 2.2rem; 
      }
      .positions-header { 
        font-size: 1.2rem; 
        flex-direction: row; 
        align-items: center; 
        gap: 1rem;
      }
      .position-header { 
        flex-direction: row; 
        align-items: center; 
        justify-content: space-between;
      }
      .position-symbol {
        font-size: 1.2rem;
      }
      .crypto-item { 
        padding: 1.25rem;
      }
      .crypto-info {
        flex: 1;
      }
      .crypto-value { 
        text-align: right; 
      }
      .table { 
        font-size: 0.8rem; 
        display: block;
        overflow-x: auto;
      }
      .table th, .table td { 
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
      }
      .modal { 
        max-width: 95%; 
        max-height: 90%;
      }
      .modal-content { 
        width: 95vw; 
        max-height: 85vh;
      }
      .modal-title { 
        font-size: 1.4rem; 
      }
      .modal-header {
        padding: 1.5rem;
      }
      .modal-body {
        padding: 1.5rem;
      }
      .notification { 
        right: 10px; 
        left: 10px; 
        padding: 1rem 1.25rem;
        font-size: 0.95rem;
      }
      .auth-container {
        padding: 2rem 1.5rem;
        margin: 2rem 1rem;
      }
      .auth-title {
        font-size: 2rem;
      }
      .input-group input,
      .input-group select {
        padding: 0.9rem;
        font-size: 0.95rem;
      }
      .chat-messages {
        max-height: 400px;
        padding: 1.25rem;
      }
      .message-bubble {
        padding: 0.9rem 1rem;
        max-width: 85%;
      }
      .support-container {
        padding: 1.5rem 1.25rem;
      }
      .faq-question {
        padding: 1.25rem;
        font-size: 1rem;
      }
      .faq-answer {
        padding: 0 1.25rem 1.25rem;
      }
      .order-tabs {
        padding: 0.75rem;
      }
      .order-tab {
        padding: 0.9rem 0.75rem;
        font-size: 0.9rem;
      }
      .order-form {
        padding: 1.25rem;
      }
      .form-field input,
      .form-field select {
        padding: 0.9rem;
        font-size: 0.95rem;
      }
      .order-summary {
        padding: 1.1rem;
      }
      .btn-order {
        padding: 1.1rem;
        font-size: 1rem;
      }
      .chart-top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
      }
      .chart-price-info {
        text-align: left;
      }
      .admin-sidebar {
        padding: 1.25rem;
      }
      .admin-menu-item {
        padding: 0.9rem 1.1rem;
        font-size: 0.95rem;
      }
      .admin-content {
        padding: 1.5rem;
      }
      .wallet-card {
        padding: 1.75rem;
      }
      .wallet-card h3 {
        font-size: 1.3rem;
      }
    }
  