:root{
  --bg:#0b0e14;
  --card:#121826;
  --text:#e6e9ef;
  --muted:#9aa3b2;
  --line:#22304a;
  --accent:#4ea1ff;
  --danger:#ff4d4d;
  --green:#36d399;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background:var(--bg);
  color:var(--text);
}

a{color:var(--accent); text-decoration:none}
a:hover{
  text-decoration:none;
  color:white;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 18px;
  border-bottom:1px solid var(--line);
  background: rgba(10, 13, 19, 0.8);
  backdrop-filter: blur(10px);
  position:sticky;
  top:0;
  z-index:10;
}

.brand{font-weight:800; letter-spacing:.3px}
.nav{
  display:flex;
  gap:12px;
  align-items:center;
}

/* HAMBURGER NASCOSTO SU DESKTOP */
.menu-toggle {
  display: none;
}

.nav a{
  transition: 0.2s;
}
.container{max-width:1100px; margin:18px auto; padding:0 14px}

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:14px;
  padding:16px;
  margin-bottom:16px;
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
}

h1,h2{margin:0 0 10px 0}
h1{font-size:22px}
h2{font-size:18px; color:#d7deea}

.muted{color:var(--muted)}
.small{font-size:12px}

.btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:9px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#0d1320;
  color:var(--text);
  cursor:pointer;
  font-weight:600;
}
.btn:hover{filter:brightness(1.08); text-decoration:none}
.btn.primary{background:rgba(78,161,255,.18); border-color:rgba(78,161,255,.35)}
.btn.danger{background:rgba(255,77,77,.12); border-color:rgba(255,77,77,.35)}
.btn.small{padding:6px 10px; border-radius:9px; font-size:12px}

.form{display:flex; flex-direction:column; gap:10px; margin-top:10px}
.form label{font-weight:700; font-size:13px; color:#cdd6e7}
.form input, .form select{
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--line);
  background:#0b1220;
  color:var(--text);
}
.form input:focus, .form select:focus{outline:2px solid rgba(78,161,255,.25)}

.grid{display:grid; grid-template-columns: 1fr 1fr; gap:16px}
@media (max-width: 900px){ .grid{grid-template-columns:1fr} }

.grid2{display:grid; grid-template-columns: 1fr 1fr; gap:12px}
.grid2 .span2{grid-column: span 2}
@media (max-width: 700px){ .grid2{grid-template-columns:1fr} .grid2 .span2{grid-column:1} }

.stats{display:grid; grid-template-columns: repeat(3, 1fr); gap:10px}
.stat{border:1px solid var(--line); border-radius:12px; padding:12px; background:#0b1220}
.stat .k{font-size:12px; color:var(--muted); margin-bottom:8px}
.stat .v{font-size:18px; font-weight:800}

.table{
  width:100%;
  border-collapse:collapse;
  overflow:hidden;
  border-radius:12px;
}
.table th, .table td{
  border-bottom:1px solid var(--line);
  padding:10px 10px;
  font-size:13px;
  vertical-align:top;
}
.table th{color:#cdd6e7; text-align:left; font-weight:800}
.table tr:hover td{background:rgba(255,255,255,.02)}
.note{max-width:260px; color:var(--muted)}
.buy{color:var(--green); font-weight:800}
.sell{color:var(--danger); font-weight:800}

.flash-wrap{margin-bottom:12px; display:flex; flex-direction:column; gap:8px}
.flash{
  border:1px solid var(--line);
  background:#0b1220;
  border-radius:12px;
  padding:10px 12px;
  font-weight:700;
}
.flash.success{border-color:rgba(54,211,153,.35); background:rgba(54,211,153,.08)}
.flash.error{border-color:rgba(255,77,77,.35); background:rgba(255,77,77,.08)}

.row{display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px}
.row-right{display:flex; gap:10px; flex-wrap:wrap}
.actions{display:flex; gap:8px; align-items:center}
.actions form{margin:0}
.check{display:flex; align-items:center; gap:8px; font-weight:700; color:var(--muted)}

/* ===== EXPERT ADVISOR HERO ===== */
.hero-ea {
  height: 100vh;
  background: url("/static/images/expert-bg.jpg") no-repeat center center;
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-ea .overlay {
  background: rgba(0, 0, 0, 0.6);
  padding: 40px;
  border-radius: 10px;
  text-align: center;
  color: white;
}

/* ===== MONTE CARLO HERO LINES (HOME ONLY) ===== */

#mc-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* importantissimo: non blocca click */
  z-index: 1;
  opacity: 0.25;
}

/* ===== DROPDOWN LABORATORIO FIX ===== */

.dropdown {
  position: relative;
  display: inline-block;
}

/* bottone */
.dropbtn {
  cursor: pointer;
}

/* menu */
.dropdown-content {
  display: none;
  position: absolute;

  top: 100%; 
  left: 0;

  background: #121826;
  min-width: 220px;
  border: 1px solid #22304a;
  border-radius: 10px;
  padding: 10px;
  margin-top: 5px;

  z-index: 999;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

/* hover */
.dropdown:hover .dropdown-content {
  display: block;
}

/* sezioni */
.dropdown-section {
  margin-bottom: 10px;
}

/* titoli */
.dropdown-title {
  font-size: 12px;
  color: #6c8cff;
  display: block;
  margin-bottom: 5px;
  padding-left: 5px;
}

/* link */
.dropdown-content a {
  display: block;
  padding: 8px 10px;
  color: #ccc;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
}

.dropdown-content a:hover {
  background: #1e293b;
  color: white;
}

/* =========================
   MOBILE RESPONSIVE FIX
========================= */

@media (max-width: 768px) {

  /* nasconde freccia laboratorio */
  .lab-arrow {
    display: none;
  }

  /* stile testo laboratorio */
  .lab-text {
    font-weight: normal;
  }

  /* ===== NAVBAR ===== */
  .menu-toggle {
    display: block;
    font-size: 26px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    z-index: 1001;
  }

  .topbar {
    position: relative;
  }

  .nav {
    display: none !important;
    flex-direction: column;
    position: absolute;
    top: 60px;
    right: 0;
    width: 100%;
    background: #0b1220;
    padding: 20px;
    z-index: 1000;
  }

  .nav.active {
    display: flex !important;
  }

  .nav a {
    padding: 12px 0;
    font-size: 16px;
    border-bottom: 1px solid #1e2a3a;
  }


  /* ===== DROPDOWN MOBILE DISABLED ===== */
  .dropdown-content {
    display: none !important;
  }

  /* ===== HERO FIX ===== */
  .hero {
    padding: 20px !important;
    text-align: center;
  }

  .hero h1 {
    font-size: 28px !important;
  }

  .hero p {
    font-size: 14px !important;
  }

  /* ===== BOTTONI ===== */
  .hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .hero-buttons a {
    width: 100%;
  }

  /* ===== MODALI ===== */
  #loginModal div,
  #registerModal div,
  #forgotModal div {
    width: 90% !important;
    max-width: none !important;
    padding: 20px !important;
  }

}

/* =========================
   HERO MOBILE FIX
========================= */

@media (max-width: 768px) {

  .hero-ea,
  .hero {
    align-items: flex-start !important;
    padding-top: 60px !important;
  }

  .hero-ea .overlay,
  .hero .overlay {
    padding: 20px !important;
    margin: 0 10px;
    width: 100%;
    max-width: 320px;
    border-radius: 12px;
  }

  .hero-ea h1,
  .hero h1 {
    font-size: 24px !important;
  }

  .hero-ea p,
  .hero p {
    font-size: 14px !important;
  }

}

.hero-box {
  background: rgba(0,0,0,0.6);
  padding:25px 30px;
  border-radius:12px;
  max-width:400px;
  position: relative;
  
}

.hero-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 18px;
  cursor: pointer;
  color: white;
}

/* SOLO MOBILE */
@media (max-width: 768px) {

  .hero-box {
    padding: 18px;
    max-width: 300px;
  }
  

  .hero-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 18px;
    cursor: pointer;
    color: white;
  }

}

.hero-overlay {
  position: absolute;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background: rgba(0,0,0,0.65);
}

/* MOBILE */
@media (max-width: 768px) {

  .hero-overlay {
    background: rgba(0,0,0,0.5); /* leggermente meno scuro */
  }

}