/* public/css/base.css — Design system condiviso */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

:root {
  --navy:      #0F1C2E;
  --navy-mid:  #1A2F48;
  --navy-lite: #243B55;
  --teal:      #00B4D8;
  --teal-dim:  #0096C7;
  --amber:     #F4A226;
  --red:       #E63946;
  --green:     #2DC653;
  --violet:    #9B5DE5;
  --gray-1:    #E8EDF2;
  --gray-2:    #C8D0DA;
  --gray-3:    #8A97A8;
  --gray-4:    #3D5068;
  --white:     #F8FAFC;
  --text:      #D4DDE8;
  --text-dim:  #7A90A8;

  --radius:    10px;
  --radius-lg: 16px;
  --shadow:    0 4px 24px rgba(0,0,0,.35);
  --shadow-sm: 0 2px 10px rgba(0,0,0,.25);
  --font:      'DM Sans', sans-serif;
  --mono:      'DM Mono', monospace;
  --transition: 160ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--font);
  background: var(--navy);
  color: var(--text);
  line-height: 1.55;
  min-height: 100dvh;
}

/* ── Scrollbar ───────────────────────────────────────────────────────────────*/
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: var(--navy-mid); }
::-webkit-scrollbar-thumb  { background: var(--gray-4); border-radius: 3px; }

/* ── Tipografia ──────────────────────────────────────────────────────────────*/
h1 { font-size: 1.8rem; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.3rem; font-weight: 600; }
h3 { font-size: 1.05rem; font-weight: 600; }
p  { color: var(--text-dim); }

/* ── Bottoni ─────────────────────────────────────────────────────────────────*/
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .6rem 1.2rem; border-radius: var(--radius);
  border: none; cursor: pointer; font: 500 .9rem var(--font);
  transition: var(--transition); white-space: nowrap;
}
.btn-primary  { background: var(--teal);   color: var(--navy); }
.btn-danger   { background: var(--red);    color: #fff; }
.btn-ghost    { background: var(--navy-lite); color: var(--text); border: 1px solid var(--gray-4); }
.btn-sm       { padding: .4rem .85rem; font-size: .82rem; }
.btn:hover    { filter: brightness(1.12); transform: translateY(-1px); }
.btn:active   { transform: translateY(0); filter: brightness(.95); }
.btn:disabled { opacity: .45; pointer-events: none; }

/* ── Card ────────────────────────────────────────────────────────────────────*/
.card {
  background: var(--navy-mid);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
}

/* ── Badge ───────────────────────────────────────────────────────────────────*/
.badge {
  display: inline-flex; align-items: center;
  padding: .2rem .55rem; border-radius: 20px;
  font: 600 .72rem var(--font); text-transform: uppercase; letter-spacing: .04em;
}
.badge-green  { background: rgba(45,198,83,.18);  color: var(--green); }
.badge-amber  { background: rgba(244,162,38,.18); color: var(--amber); }
.badge-red    { background: rgba(230,57,70,.18);  color: var(--red); }
.badge-teal   { background: rgba(0,180,216,.18);  color: var(--teal); }
.badge-violet { background: rgba(155,93,229,.18); color: var(--violet); }
.badge-gray   { background: var(--navy-lite);     color: var(--gray-3); }

/* ── Input ───────────────────────────────────────────────────────────────────*/
.input {
  width: 100%; padding: .65rem .9rem;
  background: var(--navy-lite); border: 1px solid var(--gray-4);
  border-radius: var(--radius); color: var(--white);
  font: 400 .92rem var(--font); transition: var(--transition);
}
.input:focus  { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,180,216,.18); }
.input::placeholder { color: var(--text-dim); }

/* ── Toast ───────────────────────────────────────────────────────────────────*/
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  display: flex; flex-direction: column; gap: .6rem; z-index: 9999;
}
.toast {
  padding: .75rem 1.1rem; border-radius: var(--radius);
  font-size: .88rem; font-weight: 500;
  box-shadow: var(--shadow); animation: toastIn .22s ease;
  display: flex; align-items: center; gap: .6rem;
  max-width: 320px;
}
.toast-success { background: var(--green);  color: #fff; }
.toast-error   { background: var(--red);    color: #fff; }
.toast-info    { background: var(--teal);   color: var(--navy); }
.toast-warn    { background: var(--amber);  color: var(--navy); }
@keyframes toastIn { from { opacity:0; transform:translateX(16px); } to { opacity:1; transform:none; } }

/* ── Modal ───────────────────────────────────────────────────────────────────*/
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 8000; padding: 1rem;
}
.modal {
  background: var(--navy-mid); border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-lg); padding: 1.6rem;
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow); animation: modalIn .18s ease;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.2rem; }
.modal-close  { background: none; border: none; color: var(--gray-3); font-size: 1.4rem; cursor: pointer; line-height: 1; }
@keyframes modalIn { from { opacity:0; transform:scale(.96); } to { opacity:1; transform:none; } }

/* ── Spinner ─────────────────────────────────────────────────────────────────*/
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.15);
  border-top-color: var(--teal);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utility ─────────────────────────────────────────────────────────────────*/
.flex   { display: flex; }
.flex-c { display: flex; align-items: center; }
.gap-1  { gap: .5rem; }
.gap-2  { gap: 1rem; }
.mt-1   { margin-top: .5rem; }
.mt-2   { margin-top: 1rem; }
.w-full { width: 100%; }
.text-sm{ font-size: .85rem; }
.text-dim{ color: var(--text-dim); }
.text-center { text-align: center; }
.hidden { display: none !important; }
.mono   { font-family: var(--mono); }
