/*
 * @copyright: CAFFEINAPURA Srls All right reserved
 * DynamicShare — Design system (Fase 3)
 * Token e componenti derivati da auth-flow-mockup.html, estesi per la
 * dashboard (sidebar/topbar/kpi/badge/tabelle). Caricato insieme a
 * Tailwind (CDN, vedi inc/theme-tokens) che consuma questi stessi
 * colori via tailwind.config.theme.extend.colors — qui restano solo
 * i componenti che le utility Tailwind da sole non esprimono bene.
 */

:root {
  --navy-950: #0A0F1C;
  --navy-900: #0E1526;
  --navy-850: #121A2E;
  --navy-800: #182242;
  --navy-line: #293761;
  --navy-muted: #8492B4;
  --text-onDark: #E7ECF6;
  --text-onDark-dim: #A6B1CC;

  --paper: #F5F6F9;
  --paper-card: #FFFFFF;
  --line: #DCE1EB;
  --ink: #101826;
  --muted: #5B6B85;

  --brass: #C79A4B;
  --brass-deep: #9C7530;
  --brass-tint: #F3E7CE;

  --teal: #3E8E82;
  --teal-tint: #DCEEEC;
  --brick: #B0503A;
  --brick-tint: #F5E2DC;

  --font: 'Space Grotesk', -apple-system, sans-serif;
}

body { font-family: var(--font); }

/* ===================== AUTH: shell a due colonne ===================== */

.auth-shell {
  display: grid;
  grid-template-columns: 400px 1fr;
  min-height: 100vh;
}
.brand-pane {
  background: var(--navy-950);
  color: var(--text-onDark);
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.brand-pane .mark { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; }
.brand-pane .mark .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brass); box-shadow: 0 0 0 3px rgba(199,154,75,.18); }
.brand-pane .tagline { margin-top: 26px; font-size: 22px; font-weight: 600; line-height: 1.35; max-width: 280px; }
.brand-pane .sub { margin-top: 12px; font-size: 13.5px; color: var(--text-onDark-dim); max-width: 280px; line-height: 1.6; }
.brand-pane .bullets { margin-top: auto; display: flex; flex-direction: column; gap: 14px; }
.brand-pane .bullets .b { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-onDark-dim); }
.brand-pane .bullets .b .pip { width: 7px; height: 7px; border-radius: 50%; background: var(--brass); flex-shrink: 0; }
.brand-pane .compass { position: absolute; right: -70px; bottom: -70px; opacity: .5; }

.form-pane { background: var(--paper); display: flex; align-items: flex-start; justify-content: center; padding: 56px 32px; min-height: 100vh; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card.wide { max-width: 640px; }
.auth-card h1 { font-size: 23px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.auth-card p.hint { font-size: 13.5px; color: var(--muted); margin-bottom: 28px; }

@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .brand-pane { display: none; }
}

/* ===================== AUTH: campi e bottoni ===================== */

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.field input, .field select {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 13.5px;
}
.field input:focus, .field select:focus { border-color: var(--brass); outline: 2px solid transparent; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

.checkline { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--muted); margin: 18px 0; }
.checkline input { margin-top: 2px; }
.checkline a { color: var(--brass-deep); font-weight: 600; text-decoration: none; }

.btn-primary {
  width: 100%; background: var(--brass); color: #241804;
  border: none; padding: 12px 18px; border-radius: 8px;
  font-weight: 700; font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s, color .15s;
}
.btn-primary:hover { background: var(--brass-deep); color: #fff; }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.btn-ghost {
  width: 100%; background: transparent; color: var(--ink);
  border: 1px solid var(--line); padding: 11px 18px; border-radius: 8px;
  font-weight: 600; font-size: 13.5px; cursor: pointer; margin-top: 10px;
}
.btn-ghost:hover { border-color: var(--navy-muted); }

.switch-line { margin-top: 22px; font-size: 13px; color: var(--muted); text-align: center; }
.switch-line a { color: var(--brass-deep); font-weight: 700; text-decoration: none; }

.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--navy-muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.social-row { display: flex; flex-direction: column; gap: 9px; margin-bottom: 4px; }
.social-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 9px;
  background: #fff; border: 1.5px solid var(--line); color: var(--ink);
  padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer;
  text-decoration: none;
}
.social-btn:hover { border-color: var(--navy-muted); background: var(--paper); }
.social-btn svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }

/* ===================== AUTH: codice OTP ===================== */

.otp-row { display: flex; gap: 10px; margin-bottom: 4px; }
.otp-row input {
  width: 48px; height: 56px; text-align: center; font-size: 20px; font-weight: 700;
  border: 1.5px solid var(--line); border-radius: 8px; color: var(--ink);
}
.otp-row input:focus { border-color: var(--brass); }
@media (max-width: 400px) { .otp-row input { width: 40px; height: 48px; font-size: 17px; } }

/* ===================== AUTH: indicatore robustezza password ===================== */

.pw-meter { margin-top: 8px; }
.pw-bars { display: flex; gap: 4px; margin-bottom: 5px; }
.pw-bars span { flex: 1; height: 4px; border-radius: 3px; background: var(--line); transition: background .15s; display: block; }
.pw-label { font-size: 11.5px; color: var(--muted); font-weight: 600; }

/* ===================== AUTH: stepper multi-pagina ===================== */

.stepper { display: flex; align-items: center; gap: 6px; margin-bottom: 28px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 6px; }
.step .num {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700;
  border: 1.5px solid var(--line); color: var(--muted); background: #fff;
}
.step.done .num { background: var(--brass); border-color: var(--brass); color: #241804; }
.step.current .num { border-color: var(--brass); color: var(--brass-deep); }
.step .lbl { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.step.done .lbl, .step.current .lbl { color: var(--ink); }
.step .bar { height: 1.5px; width: 18px; background: var(--line); }
.step.done .bar { background: var(--brass); }

/* ===================== AUTH: schermate di conferma ===================== */

.auth-success { text-align: center; padding: 20px 0; }
.auth-success .tick {
  width: 56px; height: 56px; border-radius: 50%; background: var(--teal-tint); color: var(--teal);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 20px;
}
.auth-success .tick svg { width: 26px; height: 26px; }

/* ===================== DASHBOARD: sidebar ===================== */

.ds-sidebar { background: var(--navy-950); color: var(--text-onDark); }
.ds-sidebar .mark { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 16px; color: var(--text-onDark); }
.ds-sidebar .mark .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brass); box-shadow: 0 0 0 3px rgba(199,154,75,.18); }

.ds-nav-group-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--navy-muted); font-weight: 700; }

.ds-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  font-size: 13.5px; font-weight: 500; color: var(--text-onDark-dim); text-decoration: none;
  transition: background .12s, color .12s;
}
.ds-nav-item:hover { background: var(--navy-850); color: var(--text-onDark); }
.ds-nav-item.active { background: var(--navy-800); color: var(--text-onDark); box-shadow: inset 2px 0 0 var(--brass); }
.ds-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.ds-nav-subitem {
  display: block; padding: 7px 12px 7px 40px; border-radius: 8px;
  font-size: 12.5px; color: var(--navy-muted); text-decoration: none;
}
.ds-nav-subitem:hover { color: var(--text-onDark); background: var(--navy-850); }
.ds-nav-subitem.active { color: var(--brass); font-weight: 600; }

/* ===================== DASHBOARD: topbar ===================== */

.ds-topbar { background: var(--paper-card); border-bottom: 1px solid var(--line); }

.ds-context-switch {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; font-size: 12.5px; font-weight: 600; color: var(--ink);
  cursor: pointer;
}
.ds-context-switch:hover { border-color: var(--navy-muted); }
.ds-context-switch .sep { color: var(--line); }
.ds-context-switch .lbl-muted { color: var(--muted); font-weight: 500; }

/* ===================== DASHBOARD: badge di stato ===================== */

.ds-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.ds-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ds-badge-success { background: var(--teal-tint); color: var(--teal); }
.ds-badge-warning { background: var(--brass-tint); color: var(--brass-deep); }
.ds-badge-danger  { background: var(--brick-tint); color: var(--brick); }
.ds-badge-muted   { background: var(--line); color: var(--muted); }

/* ===================== DASHBOARD: card KPI ===================== */

.ds-kpi-card { background: var(--paper-card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.ds-kpi-card .kpi-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ds-kpi-card .kpi-value { font-size: 28px; font-weight: 700; color: var(--ink); margin-top: 6px; }
.ds-kpi-card .kpi-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--brass-tint); color: var(--brass-deep); }

/* ===================== DASHBOARD: card app attivabile ===================== */

.ds-app-card { background: var(--paper-card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.ds-app-card .app-icon { width: 36px; height: 36px; border-radius: 9px; background: var(--navy-950); color: var(--brass); display: flex; align-items: center; justify-content: center; }
.ds-app-card .app-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.ds-app-card .app-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ===================== DASHBOARD: tabelle ===================== */

.ds-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ds-table thead th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.ds-table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--ink); }
.ds-table tbody tr:hover { background: var(--paper); }

/* ===================== Bottone tondo dark-mode toggle ===================== */

.ds-theme-toggle {
  position: fixed; bottom: 24px; right: 24px; padding: 12px; background: var(--paper-card);
  border: 1px solid var(--line); border-radius: 50%; box-shadow: 0 4px 14px rgba(16,24,38,.12);
  cursor: pointer; z-index: 40;
}
