:root{
  --bg:#0e0f13; --panel:#151821; --muted:#7b8496; --text:#e6e9f0; --accent:#7c5cff; --ok:#26d07c; --warn:#ff6b6b;
  --card:#191d27; --border:#262b36;
}
*{box-sizing:border-box}
html,body{min-height:100%}
body{
  margin:0;
  font-family:Inter,system-ui,Segoe UI,Roboto,Arial,sans-serif;

  /* fondo pieno + gradiente che si adatta e resta fisso dietro */
  background-color: var(--bg);
  background-image: radial-gradient(120% 90% at 20% -10%, #1b1f2a 0%, #0e0f13 60%);
  background-repeat: no-repeat;
  background-attachment: fixed;

  color:var(--text);
}

/* layout */
.container{max-width:960px;margin:0 auto;padding:32px}
.header{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}
.app-title{font-size:20px;font-weight:600;letter-spacing:.3px;opacity:.9}
.center {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh; /* Usa l'unità vh per l'altezza del viewport */
}
/* card & form */
.card{
  background:linear-gradient(180deg, var(--card), #131722);
  border:1px solid var(--border); border-radius:16px; padding:20px;
  box-shadow:0 8px 24px rgba(0,0,0,.35);
}
.form{width:100%;max-width:420px}
.input{width:100%;padding:12px 14px;border-radius:12px;border:1px solid var(--border);background:#0f131b;color:var(--text)}
.row{display:flex;gap:12px}
.btn{
  width:100%;padding:12px 14px;border-radius:12px;border:1px solid transparent;
  background:var(--accent);color:white;font-weight:600;cursor:pointer
}
.btn:hover{filter:brightness(1.05)}
.helper{color:var(--muted);font-size:12px;margin-top:10px;text-align:center}

/* dashboard */
.grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-top:16px}
.comp{padding:18px;border-radius:14px;border:1px solid var(--border);background:linear-gradient(180deg,#1a1f2c,#141925)}
.comp h3{margin:0 0 6px 0;font-size:16px}
.badge{display:inline-block;padding:4px 10px;border-radius:999px;font-size:12px;font-weight:700;letter-spacing:.3px}
.badge.ok{background:rgba(38,208,124,.12);color:var(--ok);border:1px solid rgba(38,208,124,.35)}
.badge.off{background:rgba(255,107,107,.12);color:var(--warn);border:1px solid rgba(255,107,107,.35)}
.sub{color:var(--muted);font-size:12px;margin-top:4px}
.topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}
.logout{color:var(--muted);text-decoration:none}
.logout:hover{color:#fff}

.flash{margin:12px 0;padding:12px 14px;border-radius:12px;border:1px solid rgba(255,255,255,.06);font-size:14px}
.flash.ok{background:rgba(38,208,124,.12);color:#26d07c;border-color:rgba(38,208,124,.35)}
.flash.err{background:rgba(255,107,107,.12);color:#ff6b6b;border-color:rgba(255,107,107,.35)}

/* buttons */
.actions{margin-top:12px}
.btn-pill{
  appearance:none;border:none;cursor:pointer;
  background:linear-gradient(180deg,#7c5cff,#6a4df0);
  color:#fff;font-weight:700;padding:10px 14px;border-radius:999px;
  box-shadow:0 6px 16px rgba(124,92,255,.3);
}
.btn-pill:hover{filter:brightness(1.05)}
.btn-ghost{
  appearance:none;border:1px solid var(--border);background:#23293a;color:#e6e9f0;
  padding:10px 14px;border-radius:999px;cursor:pointer
}
.btn-ghost:hover{filter:brightness(1.05)}
.global-actions{
  display:flex;
  justify-content:center;   /* centrato */
  margin: 8px 0 10px;
}

/* modal: nascosto di default */
.modal-overlay{
  position:fixed;inset:0;background:rgba(2,6,15,.6);
  display:none; /* HIDDEN BY DEFAULT */
  align-items:center;justify-content:center;z-index:9999;
}
.modal-overlay.show{ display:flex; } /* SHOW STATE */
.modal{
  width:100%;max-width:520px;background:linear-gradient(180deg,#1a1f2c,#141925);
  border:1px solid var(--border);border-radius:16px;padding:18px;
  box-shadow:0 20px 60px rgba(0,0,0,.55);animation:pop .15s ease-out
}
@keyframes pop{from{transform:scale(.98);opacity:.9}to{transform:scale(1);opacity:1}}
.modal h4{margin:0 0 8px 0}
.modal .modal-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:14px}

/* change password centrato */
.centered-narrow .header {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.centered-narrow .app-title {
  text-align: center;
}
/* varianti colore per bottoni mercato */
.btn-pill.green{
  background:linear-gradient(180deg,#33d07a,#2bb76b);
  box-shadow:0 6px 16px rgba(51,208,122,.28);
}
.btn-pill.warn{
  background:linear-gradient(180deg,#ff6b6b,#ff5252);
  box-shadow:0 6px 16px rgba(255,107,107,.3);
}

a.btn-pill, a.btn-ghost { display:inline-block; text-decoration:none }
a.btn-ghost, a.btn-pill { text-decoration: none; }

/* Link-bottoni senza sottolineato in QUALSIASI stato */
a.btn-ghost,
a.btn-ghost:visited,
a.btn-ghost:hover,
a.btn-ghost:active,
a.btn-ghost:focus,
a.btn-pill,
a.btn-pill:visited,
a.btn-pill:hover,
a.btn-pill:active,
a.btn-pill:focus {
  text-decoration: none !important;
  color: #e6e9f0; /* garantisce che il :visited non cambi colore */
}
