:root {
  color-scheme: dark;
  --nt-primary:         #3B82F6;
  --nt-primary-dark:    #1D4ED8;
  --nt-primary-light:   #60A5FA;
  --nt-primary-glow:    rgba(59,130,246,0.22);
  --nt-cyan:            #38BDF8;
  --nt-cyan-glow:       rgba(56,189,248,0.20);
  --nt-violet:          #8B5CF6;
  --nt-accent:          #FACC15;
  --nt-bg-dark:         #050B14;
  --nt-bg-deep:         #03070E;
  --nt-bg-card:         #0B1626;
  --nt-bg-surface:      #0E1D33;
  --nt-bg-elevated:     #0F2542;
  --nt-bg-input:        #0B1A2D;
  /* token theme-aware per i builder inline (tokenizzazione 2026-06-17): valore DARK = letterale
     storico esatto → dark byte-identico; il valore LIGHT è nel blocco html[data-theme="light"]. */
  --nt-bg-track:        #0F172A;             /* track barre/progress (era #0F172A inline) */
  --nt-bg-glass:        rgba(17,24,39,0.75); /* shell card builder (era rgba(17,24,39,0.75)) */
  --nt-bg-glass-2:      rgba(30,41,59,0.5);  /* shell interna secondaria (era rgba(30,41,59,0.5)) */
  --nt-text-soft:       #A8C1CC;             /* testo corpo attenuato nelle card (era #A8C1CC) */
  --nt-border:          rgba(31,51,72,0.85);
  --nt-border-strong:   #1F3348;
  --nt-border-subtle:   rgba(31,51,72,0.45);
  --nt-border-focus:    rgba(59,130,246,0.55);
  --nt-text-primary:    #F8FAFC;
  --nt-text-secondary:  #94A3B8;
  --nt-text-muted:      #7E8CA0;   /* alzato per contrasto AA (~5:1 su navy); era #64748B (~3:1) */
  --nt-text-faint:      #64748B;   /* alzato (ex-muted); era #475569 (~1.9:1, sotto AA) */
  --nt-success:         #22C55E;
  --nt-success-bg:      rgba(34,197,94,0.12);
  --nt-danger:          #FF6B6B;
  --nt-danger-bg:       rgba(255,107,107,0.13);
  --nt-warning:         #FACC15;
  --nt-warning-bg:      rgba(250,204,21,0.13);
  /* Token semantici di mercato/dato (tokenizzazione builder 2026-06-16): centralizzano i
     colori prima hardcodati inline nei builder HTML (nowtrade_overview_widgets/fragments). */
  --nt-up:              #10B981;   /* esito/segnale positivo (verde smeraldo) */
  --nt-down:            #EF4444;   /* esito/segnale negativo (rosso) */
  --nt-info:            #3B82F6;   /* informativo (= primary) */
  --nt-goal:            #F59E0B;   /* gol / ambra */
  --nt-text-bright:     #E2E8F0;   /* testo quasi-bianco (tra primary e secondary) */
  --nt-profile-on-brand: #FFFFFF;
  --nt-radius-xs:       4px;
  --nt-radius-sm:       6px;
  --nt-radius-md:       10px;
  --nt-radius-lg:       14px;
  --nt-radius-xl:       22px;
  --nt-radius-pill:     999px;
  --nt-shadow-sm:       0 2px 6px rgba(0,0,0,.45),0 1px 2px rgba(0,0,0,.35);
  --nt-shadow-md:       0 8px 24px rgba(0,0,0,.55),0 2px 6px rgba(0,0,0,.40);
  --nt-shadow-lg:       0 16px 48px rgba(0,0,0,.65),0 4px 12px rgba(0,0,0,.45);
  --nt-font:            "Inter","Segoe UI",system-ui,-apple-system,sans-serif;
  /* Font unificato su INTER anche per valori/quote (2026-06-17): era JetBrains Mono.
     tabular-nums (su body) mantiene allineate le cifre. */
  --nt-font-mono:       var(--nt-font);
  /* alias mobile (per compatibilità frammenti) */
  --bg:     #07111d;
  --bg-2:   #0b1626;
  --panel:  rgba(15,23,42,0.96);
  --line:   rgba(148,163,184,0.18);
  --text:   #e2e8f0;
  --muted:  #94a3b8;
  --accent: #2dd4bf;
  --accent-2: #f59e0b;
  --danger: #fb7185;
  --good:   #34d399;
  --shadow: 0 24px 70px rgba(0,0,0,0.35);
}


* { box-sizing: border-box; }
body { margin: 0; font-family: var(--nt-font); }
#login-screen {
  display: none;
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1200px 700px at 18% -8%, rgba(59,130,246,0.10) 0%, rgba(59,130,246,0) 60%),
    radial-gradient(900px 540px at 88% 0%, rgba(56,189,248,0.06) 0%, rgba(56,189,248,0) 65%),
    radial-gradient(800px 480px at 50% 110%, rgba(139,92,246,0.05) 0%, rgba(139,92,246,0) 65%),
    linear-gradient(135deg, #050B14 0%, #060F1D 50%, #03070E 100%);
  z-index: 200;
  overflow-y: auto;
  align-items: flex-start;          /* top-align come .block-container Streamlit (no centratura verticale) */
  justify-content: center;
}
#login-screen.visible { display: flex; }

/* Two-column layout ~1.15 : 0.85 — colonne allineate in ALTO come st.columns Streamlit
   (Streamlit usa .block-container padding-top:4rem, colonne top-aligned, NON centrate). */
.nt-login-layout {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 80px;
  padding: 4rem 2rem;
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
}

/* ---- LEFT panel ---- */
.nt-login-brand-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
  padding: 12px 4px 12px 0;
  flex: 1.15;
  min-width: 0;
}
.nt-login-logo-hero {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 380px;
  max-width: 100%;
  filter:
    drop-shadow(0 22px 36px rgba(0,0,0,0.62))
    drop-shadow(0 0 28px rgba(76,175,47,0.20));
}
.nt-login-logo-hero-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}
.nt-login-logo-fallback {
  width: 190px;
  height: 190px;
  border-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  font-weight: 900;
  color: #F8FAFC;
  background:
    linear-gradient(145deg, rgba(59,130,246,0.10) 0%, rgba(56,189,248,0.02) 30%, rgba(255,255,255,0) 60%),
    linear-gradient(135deg, #0C1828 0%, #060F1D 46%, #03070F 100%);
  border: 1px solid #1F3348;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 18px 30px rgba(0,0,0,0.50),
    0 0 0 1px rgba(59,130,246,0.06);
}
.nt-login-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: #93C5FD;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.nt-login-kicker::before {
  content: "";
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #38BDF8, transparent);
}
.nt-login-wordmark {
  margin: 0;
  font-family: "Inter","Segoe UI",system-ui,sans-serif;
  font-size: 74px;
  font-weight: 900;
  line-height: .94;
  letter-spacing: -.02em;
}
.nt-login-wordmark-now {
  color: #F8FAFC;
  text-shadow: 0 2px 0 rgba(255,255,255,0.12), 0 18px 28px rgba(0,0,0,0.55);
}
.nt-login-wordmark-trade {
  background: linear-gradient(135deg, #8BD44F 0%, #4CAF2F 50%, #63C534 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 28px rgba(76,175,47,0.34));
}
.nt-login-copy {
  font-size: 16px;
  line-height: 1.6;
  color: #94A3B8;
  max-width: 560px;
  font-weight: 500;
}

/* ---- RIGHT card ---- */
.nt-login-card-wrap {
  flex: 0.85;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
}
.nt-login-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(420px 220px at 100% 0%, rgba(59,130,246,0.10) 0%, rgba(59,130,246,0) 70%),
    linear-gradient(115deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.008) 28%, rgba(255,255,255,0) 52%),
    linear-gradient(135deg, #0C1828 0%, #060F1D 46%, #03070F 100%);
  border: 1px solid #1F3348;
  border-radius: 22px;
  padding: 36px 38px 38px;
  width: 100%;
  max-width: 440px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 28px 64px rgba(0,0,0,0.55),
    0 0 0 1px rgba(59,130,246,0.05);
  backdrop-filter: blur(14px);
}
.nt-login-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 21px;
  border: 1px solid rgba(59,130,246,0.10);
  pointer-events: none;
}
.nt-login-card::after {
  content: "";
  position: absolute;
  top: 0; left: 14%; right: 14%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #3B82F6 35%, #38BDF8 75%, transparent 100%);
  opacity: .55;
  pointer-events: none;
}
.nt-login-card-head {
  margin-bottom: 22px;
}
.nt-login-card-title {
  font-family: "Inter","Segoe UI",system-ui,sans-serif;
  font-size: 26px;
  font-weight: 900;
  color: #F8FAFC;
  letter-spacing: -.01em;
  margin: 0;
}
.nt-login-card-sub {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #38BDF8;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nt-login-card-sub::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #38BDF8, transparent);
}
.nt-login-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(31,51,72,0.85), transparent);
  margin-bottom: 24px;
}

/* Login form */
.nt-login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.nt-login-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nt-login-field-label {
  color: #94A3B8;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .14em;
  margin-bottom: 4px;
}
.nt-login-pass-wrap {
  position: relative;
}
.nt-login-input {
  width: 100%;
  background: #0B1A2D;
  border: 1px solid #1F3348;
  border-radius: 10px;
  color: #F8FAFC;
  padding: 13px 15px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.30);
  box-sizing: border-box;
}
.nt-login-input::placeholder {
  color: #475569;
  font-weight: 500;
}
.nt-login-input:hover {
  border-color: rgba(59,130,246,0.40);
  background: #0D1F36;
}
.nt-login-input:focus {
  border-color: rgba(59,130,246,0.55);
  box-shadow:
    0 0 0 3px rgba(59,130,246,0.18),
    inset 0 1px 2px rgba(0,0,0,0.30);
  background: #0D1F36;
}
.nt-login-pass-wrap .nt-login-input {
  padding-right: 44px;
}
.nt-login-eye-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s;
}
.nt-login-eye-btn:hover { color: #F8FAFC; }
.nt-login-submit {
  width: 100%;
  background: linear-gradient(135deg, #1D4ED8 0%, #3B82F6 55%, #38BDF8 100%);
  border: 1px solid rgba(96,165,250,0.45);
  color: #fff;
  border-radius: 10px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 12px 18px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.16),
    0 12px 28px rgba(59,130,246,0.32);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease, filter .15s ease;
  margin-top: 8px;
  font: inherit;
  font-weight: 800;
  font-size: 13px;
}
.nt-login-submit:hover {
  border-color: rgba(147,197,253,0.65);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.22),
    0 16px 36px rgba(59,130,246,0.40);
  transform: translateY(-1px);
  filter: brightness(1.06);
}
.nt-login-submit:active {
  transform: translateY(0);
  filter: brightness(0.96);
}
.nt-login-submit:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}
.nt-login-turnstile {
  display: flex;
  justify-content: center;
}
.nt-login-turnstile:empty {
  display: none;
}
.nt-login-error {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(251,113,133,0.12);
  border: 1px solid rgba(251,113,133,0.28);
  color: #fecdd3;
  font-size: 13px;
  display: none;
  margin-bottom: 4px;
  white-space: pre-line;
}
.nt-login-error.visible { display: block; }
.nt-login-error.nt-login-ok {
  background: rgba(74,222,128,0.12);
  border-color: rgba(74,222,128,0.28);
  color: #bbf7d0;
}
.nt-login-forgot {
  width: 100%;
  background: none;
  border: none;
  color: #94A3B8;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  padding: 4px;
  margin-top: 2px;
  transition: color .15s;
}
.nt-login-forgot:hover { color: #38BDF8; }

/* "Accedi con Google" (2026-09-26) - stesso pannello scuro degli input, non lo stile pieno del
   pulsante ACCEDI: e' un metodo alternativo, non l'azione primaria dello schermo. */
.nt-login-divider-or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #64748B;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 4px 0;
}
.nt-login-divider-or::before,
.nt-login-divider-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #1F3348;
}
.nt-login-google-btn {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #0B1A2D;
  border: 1px solid #1F3348;
  border-radius: 10px;
  color: #F8FAFC;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 15px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.nt-login-google-btn:hover {
  border-color: #38BDF8;
  background: #0F2136;
}

/* Responsive login */
@media (max-width: 980px) {
  .nt-login-layout {
    flex-direction: column;
    gap: 40px;
    padding: 2.5rem 1.5rem;
  }
  .nt-login-brand-panel { align-items: center; padding: 0; }
  .nt-login-logo-hero { width: 240px; }
  .nt-login-wordmark { font-size: 48px; }
  .nt-login-copy { font-size: 15px; text-align: center; }
  .nt-login-kicker { align-self: center; }
  .nt-login-card-wrap { align-items: center; width: 100%; }
  .nt-login-card { max-width: none; padding: 30px 24px 32px; }
}
@media (max-width: 640px) {
  .nt-login-logo-hero { width: 200px; }
  .nt-login-wordmark { font-size: 40px; }
}


html[data-theme="light"] #login-screen {
  background:
    radial-gradient(1200px 700px at 15% -10%, rgba(37,99,235,0.10) 0%, rgba(37,99,235,0) 55%),
    radial-gradient(900px 600px at 85% 110%, rgba(14,165,233,0.10) 0%, rgba(14,165,233,0) 60%),
    #EAEEF6;
}
html[data-theme="light"] .nt-login-card {
  background: #FFFFFF;
  border: 1px solid rgba(15,23,42,0.08);
  box-shadow: 0 1px 3px rgba(15,23,42,.08), 0 24px 64px rgba(15,23,42,.14);
}
html[data-theme="light"] .nt-login-card-title { color: #0F172A; }
html[data-theme="light"] .nt-login-card-sub { color: #2563EB; }
html[data-theme="light"] .nt-login-copy,
html[data-theme="light"] .nt-login-label,
html[data-theme="light"] .nt-login-eye { color: #475569; }
html[data-theme="light"] .nt-login-input {
  background: #FFFFFF; border: 1px solid #D5DDEA; color: #0F172A;
}
html[data-theme="light"] .nt-login-input::placeholder { color: #94A3B8; }
html[data-theme="light"] .nt-login-input:hover { background: #FFFFFF; border-color: #B9C5D8; }
html[data-theme="light"] .nt-login-input:focus { background: #FFFFFF; border-color: var(--nt-primary); }
html[data-theme="light"] .nt-login-submit {
  background: linear-gradient(135deg,#1D4ED8,#2563EB,#0EA5E9); color: #fff;
  box-shadow: 0 4px 14px rgba(37,99,235,.30);
}
html[data-theme="light"] .nt-login-error { color: #B42318; background: rgba(220,38,38,0.08); }
html[data-theme="light"] .nt-login-error.nt-login-ok { color: #15803D; background: rgba(34,197,94,0.10); }
html[data-theme="light"] .nt-login-forgot { color: #64748B; }
html[data-theme="light"] .nt-login-forgot:hover { color: #2563EB; }
html[data-theme="light"] .nt-login-divider-or { color: #94A3B8; }
html[data-theme="light"] .nt-login-divider-or::before,
html[data-theme="light"] .nt-login-divider-or::after { background: #E2E8F0; }
html[data-theme="light"] .nt-login-google-btn {
  background: #FFFFFF;
  border-color: #E2E8F0;
  color: #0F172A;
}


html[data-theme="light"] .nt-login-wordmark-now { color: #0F172A; }
