/* =========================
   RESET & BASE
========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', 'Poppins', system-ui, sans-serif;
}

body {
  background: #0e0f12;
  color: #e5e7eb;
  min-height: 100vh;
  padding-bottom: 80px; /* spazio per navbar */
}

/* =========================
   COLORI GLOBALI
========================= */
:root {
  --bg-main: #0e0f12;
  --bg-card: #16181d;
  --bg-soft: #1e2128;

  --gold: #d4af37;
  --gold-dark: #b8962e;
  --green: #2ecc71;
  --red: #e74c3c;
  --gray: #9ca3af;
}

/* =========================
   CONTAINER
========================= */
.container {
  max-width: 420px;
  margin: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px; /* SPAZIATURA VERA */
}

/* =========================
   TITOLI
========================= */
h1 {
  font-size: 22px;
  color: #fff;
}

h2 {
  font-size: 18px;
  color: #fff;
}

/* =========================
   CARD
========================= */
.card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px; /* evita effetto “attaccato” */
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
}

/* =========================
   INPUT & FORM
========================= */
input, select {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid #2a2d35;
  border-radius: 12px;
  padding: 13px;
  color: white;
  font-size: 14px;
}

input::placeholder {
  color: var(--gray);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--gold);
}

/* =========================
   BOTTONI (FIX ATTACCATI)
========================= */
.btn {
  width: 100%;
  padding: 15px;
  border-radius: 14px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.btn + .btn {
  margin-top: 12px; /* SPAZIO TRA BOTTONI */
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #0e0f12;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(212,175,55,0.25);
}

.btn-danger {
  background: var(--red);
  color: white;
}

/* =========================
   DASHBOARD STATS
========================= */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-box {
  background: var(--bg-soft);
  padding: 14px;
  border-radius: 14px;
  text-align: center;
}

.stat-box span {
  font-size: 12px;
  color: var(--gray);
}

.stat-box strong {
  font-size: 17px;
  display: block;
  margin-top: 4px;
}

/* =========================
   TRADE LIST
========================= */
.trade {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: var(--bg-soft);
}

.trade + .trade {
  margin-top: 10px;
}

.trade.profit {
  border-left: 4px solid var(--green);
}

.trade.loss {
  border-left: 4px solid var(--red);
}

.trade .asset {
  font-weight: 600;
}

.trade .profit {
  font-weight: bold;
}

/* =========================
   CHECKLIST CONFERME
========================= */
.confirmations {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.confirm-button {
  background: var(--bg-soft);
  border: 1px solid #2a2d35;
  color: var(--gray);
  padding: 12px;
  border-radius: 12px;
  font-size: 13px;
  cursor: pointer;
  transition: .15s;
}

.confirm-button.active {
  background: rgba(212,175,55,0.15);
  border-color: var(--gold);
  color: var(--gold);
}

/* =========================
   GRAFICO (LINEA ONDULATA)
========================= */
.chart {
  background: var(--bg-soft);
  border-radius: 16px;
  padding: 16px;
}

.chart svg {
  width: 100%;
  height: 120px;
}

.chart path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================
   NAV BAR
========================= */
.navbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--bg-card);
  display: flex;
  justify-content: space-around;
  padding: 14px 0;
  border-top: 1px solid #2a2d35;
}

.navbar a {
  color: var(--gray);
  text-decoration: none;
  font-size: 12px;
}

.navbar a.active {
  color: var(--gold);
  font-weight: 600;
}
/* =========================
   AUTH BAR (PICCOLA)
========================= */
.auth-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 13px;
}

.auth-email {
  color: var(--gray);
  font-size: 12px;
}

/* Bottoni piccoli */
.auth-btn {
  background: transparent;
  border: 1px solid #2a2d35;
  color: var(--gray);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}

.auth-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.auth-btn.logout {
  border-color: var(--red);
  color: var(--red);
}
.chart-center-text {
  position: relative;
  top: -120px;
  text-align: center;
  font-weight: 600;
  color: white;
  pointer-events: none;
}
.hidden {
  display: none !important;
}
/* ===== CONFERME OPERAZIONE ===== */
.conf {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.conf-btn {
  background: #FFD700;          /* giallo */
  color: #111;
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.conf-btn:hover {
  background: #e6c200;
}

/* STATO SELEZIONATO */
.conf-btn.active {
  background: #c9a600;          /* giallo scuro */
  color: #000;
  box-shadow: inset 0 0 0 2px #00000030;
}
/* ===== NOTE INPUT MODERNO ===== */
.notes-input {
  width: 100%;
  min-height: 42px;              /* 1 riga */
  max-height: 180px;             /* limite */
  padding: 10px 14px;
  background: #f7f7f4;           /* bianco sporco */
  color: #111;
  border: 1px solid #ddd;
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  resize: none;                  /* niente resize manuale */
  line-height: 1.4;
  transition: all 0.2s ease;
}

/* focus moderno */
.notes-input:focus {
  outline: none;
  border-color: #FFD700;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.25);
  background: #fffdf5;
}

/* placeholder soft */
.notes-input::placeholder {
  color: #999;
}
/* HERO SECTION */
.hero {
  padding: 32px 20px;
  margin: 20px auto 10px;
  max-width: 900px;
  text-align: center;
}

.hero-title {
  font-size: 28px;
  font-weight: 600;
  color: #f5c400; /* giallo principale */
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.85);
  max-width: 650px;
  margin: 0 auto 18px;
  line-height: 1.5;
}

.hero-points {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
}

.hero-points span {
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(245, 196, 0, 0.25);
}
/* GRAPH INFO SECTION */
.graph-info {
  max-width: 800px;
  margin: 24px auto 40px;
  padding: 0 20px;
  text-align: center;
}

.graph-info-title {
  font-size: 18px;
  font-weight: 600;
  color: #f5c400; /* giallo principale */
  margin-bottom: 10px;
}

.graph-info-text {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 8px;
}

.graph-info-text.muted {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
}

/* STATS – PILL STYLE */
#stats {
  max-width: 900px;
  margin: 30px auto 45px;
  padding: 0 20px;

  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;

  padding: 10px 14px;
  min-width: 120px;

  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(245, 196, 0, 0.25);
  border-radius: 999px; /* pill vera */

  backdrop-filter: blur(6px);
}

.stat-value {
  font-size: 18px;
  font-weight: 600;
  color: #f5c400; /* giallo */
  line-height: 1.2;
}

.stat-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
  white-space: nowrap;
}
/* SAVED TRADES SECTION */
.trades-section {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: #f5c400;
  text-align: center;
  margin-bottom: 6px;
}

.section-subtitle {
  font-size: 14px;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 20px;
}

/* LIST */
.trades-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* CARD */
.trade-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(245, 196, 0, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
}

.trade-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.trade-asset {
  font-size: 14px;
  font-weight: 500;
  color: white;
}

.trade-result {
  font-size: 14px;
  font-weight: 600;
}

.trade-result.positive {
  color: #4caf50;
}

.trade-result.negative {
  color: #f44336;
}

.trade-details {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}
/* WHY SAVE TRADES SECTION */
.why-section {
  max-width: 800px;
  margin: 30px auto 45px;
  padding: 0 20px;
  text-align: center;
}

.why-text {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 14px;
}

.why-points {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.why-points span {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(245, 196, 0, 0.25);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}
/* PERFORMANCE INSIGHTS SECTION */
.performance-section {
  max-width: 850px;
  margin: 40px auto 45px;
  padding: 0 20px;
  text-align: center;
}

.performance-text {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 18px;
}

.performance-tips {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.performance-tip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(245, 196, 0, 0.2);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
}
/* FINAL MESSAGE SECTION */
.final-section {
  max-width: 900px;
  margin: 60px auto 70px;
  padding: 0 20px;
  text-align: center;
}

.final-text {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.6;
  color: #f5c400; /* giallo focus */
}
.trade-pnl {
  font-weight: 600;
}

.trade-pnl.positive {
  color: #4caf50; /* verde */
}

.trade-pnl.negative {
  color: #f44336; /* rosso */
}
.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.8);
}

.btn.ghost:hover {
  border-color: #f5c400;
  color: #f5c400;
}
.trade {
  cursor: pointer;
}

.trade * {
  pointer-events: none;
}
/* ===== STATS CIRCLES ===== */
.stats-circles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.stat-circle {
  border: 2px solid #FFD700;
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(255, 215, 0, 0.05);
}

.stat-value {
  font-size: 24px;
  font-weight: bold;
  color: #FFD700;
}

.stat-label {
  font-size: 13px;
  opacity: 0.8;
  margin-top: 4px;
}

/* Responsive */
@media (max-width: 900px) {
  .stats-circles {
    grid-template-columns: repeat(2, 1fr);
  }
}

.fake-chart {
  background: linear-gradient(
    to top,
    rgba(212,175,55,0.08),
    transparent
  );
  border-radius: 22px;

  /* QUI È IL FIX */
  padding: 22px 14px;   /* meno spazio laterale */
  margin: 22px auto 18px;
  max-width: 94%;       /* grafico più “incassato” */
}

.fake-chart svg {
  width: 100%;
  height: 340px;
}

.fake-chart path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* =========================
   STATISTICHE — VALORI %
========================= */
.stat-box strong {
  color: var(--gold);
}


/* ===== WELCOME TEXT ===== */
.welcome-text {
  text-align: center;
  font-size: 28px;
  font-weight: 600;
  color: #FFD700;
  margin: 40px 0 30px;
  letter-spacing: 0.5px;
}

/* Sottile separatore elegante */
.welcome-text::after {
  content: "";
  display: block;
  width: 80px;
  height: 3px;
  margin: 14px auto 0;
  background: linear-gradient(90deg, transparent, #FFD700, transparent);
  border-radius: 2px;
}

/* Mobile */
@media (max-width: 600px) {
  .welcome-text {
    font-size: 22px;
    margin: 25px 0 20px;
  }
}
.trial-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.trial-box {
  background: #111;
  border: 1px solid #FFD700;
  padding: 30px;
  max-width: 420px;
  width: 90%;
  border-radius: 12px;
  text-align: center;
}

.trial-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.hidden {
  display: none;
}
.premium-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.premium-box {
  background: #0f0f0f;
  border: 1px solid #FFD700;
  padding: 32px;
  max-width: 520px;
  width: 92%;
  border-radius: 14px;
  text-align: center;
}

.premium-title {
  color: #FFD700;
  margin-bottom: 20px;
}

.premium-graph {
  height: 120px;
  margin: 20px 0;
  position: relative;
  background: rgba(255,215,0,0.05);
  border-radius: 8px;
}

.graph-line {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  height: 3px;
  background: linear-gradient(90deg, #FFD700, #4caf50);
  transform: rotate(-5deg);
}

.premium-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.premium-stats .stat strong {
  color: #FFD700;
  font-size: 20px;
}

.premium-stats .stat span {
  font-size: 12px;
  opacity: 0.8;
}

.premium-plans {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
.close-premium {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 20px;
  color: #aaa;
  cursor: pointer;
}

.close-premium:hover {
  color: #fff;
}

/* === FIX DEFINITIVO PULSANTI PREMIUM === */
.premium-plans button {
  flex: 1 !important;
  height: 48px !important;
  padding: 0 !important;

  display: flex !important;
  align-items: center;
  justify-content: center;

  font-size: 14px !important;
  font-weight: 600 !important;

  border-radius: 10px;
  box-sizing: border-box !important;
}

/* --- CALC WRAPPER --- */
.calc-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.calc-link {
  width: 92%;
  max-width: 420px;
  background: #141720;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  font-size: 14px;
  cursor: pointer;
  color: #fff;
  border: none;
}

/* ===== MODAL BACKDROP ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 18px;
}

.hidden {
  display: none !important;
}

/* ===== MODAL CONTENT ===== */
.modal-content {
  width: 100%;
  max-width: 420px;
  background: #0f1115;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  animation: slideUp .18s ease-out;
}

/* Title */
.modal-content h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

/* Inputs */
.modal-content input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  outline: none;
  background: #1a1d24;
  color: #fff;
  font-size: 15px;
  text-align: center;
}

/* Results */
.results {
  background: #141720;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.results p {
  margin: 0;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.results strong { font-weight: 600; }

/* Buttons */
.modal-content .btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn.primary {
  background: linear-gradient(180deg, #ffd84d 0%, #f5c400 100%);
  color: #000;
  border: none;
  box-shadow:
    0 4px 10px rgba(245, 196, 0, 0.35),
    inset 0 1px 0 rgba(255,255,255,0.4);
}

.btn.ghost {
  background: transparent;
  border: 1px solid #2a2e3a;
  color: #ccc;
}

.note {
  font-size: 12px;
  opacity: 0.75;
}

@keyframes slideUp {
  from { transform: translateY(14px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* small screens adjustments (optional but safe) */
@media (max-width: 420px) {
  .modal-content { padding: 16px; border-radius: 14px; }
  .calc-link { padding: 10px; font-size: 14px; }
}

.calc-link {
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 15px;
}



.app-footer {
  margin-top: 40px;
  padding: 20px 12px;
  text-align: center;
  font-size: 12px;
  opacity: 0.55;
}

.app-footer p {
  margin: 6px 0;
}

.footer-links a {
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.footer-note {
  max-width: 420px;
  margin: 10px auto 0;
  line-height: 1.4;
  text-align: center;
}


/* ===== LEGAL MODALS ===== */
.modal-content.legal {
  max-height: 80vh;
  overflow-y: auto;
}

.legal-text {
  text-align: left;
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.85;
}

.legal-text p {
  margin-bottom: 10px;
}

/* ===== FOOTER CENTER FIX DEFINITIVO ===== */

.footer-center {
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
}

.footer-center p {
  text-align: center;
}

.footer-note-center {
  margin-top: 10px;
  line-height: 1.4;
  opacity: 0.75;
}


.disclaimer-text {
  opacity: 0.7;
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
}

.card-title {
  text-align: center;
}

#openCalcBtn {
   background: linear-gradient(180deg, #ffd84d 0%, #f5c400 100%);
  color: #000;
  border: none;
  box-shadow:
    0 4px 10px rgba(245, 196, 0, 0.35),
    inset 0 1px 0 rgba(255,255,255,0.4);

  /* 👇 QUESTO è il punto chiave per il testo */
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1;
  text-align: center;

  cursor: pointer;
}
