/* Personal AI Assistant - Stile condiviso delle pagine (installazione, privacy)
   Design Fluent / Office moderno, orientato al prodotto, nessuna emoji. Contrasti del testo principale calcolati >= 4.5:1; audit di accessibilita completo non ancora eseguito */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --surface-hover: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus: #0369a1;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;

  --primary: #0369a1;
  --primary-hover: #075985;
  --primary-active: #0c4a6e;
  --primary-contrast: #ffffff;
  --primary-bg: #e0f2fe;
  --primary-border: #bae6fd;

  --word-accent: #0284c7;
  --excel-accent: #15803d;
  --ppt-accent: #c2410c;
  --outlook-accent: #4338ca;

  --warn-bg: #fffbeb;
  --warn-border: #fde68a;
  --warn-text: #92400e;
  --warn-title: #78350f;

  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --success-text: #166534;

  --info-bg: #eff6ff;
  --info-border: #bfdbfe;
  --info-text: #1e40af;

  --code-bg: #f8fafc;
  --code-border: #e2e8f0;
  --code-text: #0f172a;

  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 20px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -4px rgba(15, 23, 42, 0.04);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 9999px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #090d16;
    --surface: #111827;
    --surface-alt: #1f293d;
    --surface-hover: #192237;
    --border: #26334d;
    --border-strong: #3b4d70;
    --border-focus: #38bdf8;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;

    --primary: #38bdf8;
    --primary-hover: #7dd3fc;
    --primary-active: #bae6fd;
    --primary-contrast: #082f49;
    --primary-bg: #082f49;
    --primary-border: #075985;

    --word-accent: #38bdf8;
    --excel-accent: #4ade80;
    --ppt-accent: #fb923c;
    --outlook-accent: #818cf8;

    --warn-bg: #291b05;
    --warn-border: #78350f;
    --warn-text: #fde68a;
    --warn-title: #fef08a;

    --success-bg: #052e16;
    --success-border: #14532d;
    --success-text: #86efac;

    --info-bg: #0f274a;
    --info-border: #1e3a8a;
    --info-text: #93c5fd;

    --code-bg: #0f172a;
    --code-border: #1e293b;
    --code-text: #e2e8f0;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 24px -3px rgba(0, 0, 0, 0.6);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, sans-serif;
  font-size: 15.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

/* Tipografia */
h1, h2, h3, h4 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 0;
}

h1 {
  font-size: 1.85rem;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

h2 {
  font-size: 1.35rem;
  letter-spacing: -0.015em;
  margin-top: 40px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.1rem;
  margin-top: 24px;
  margin-bottom: 8px;
}

p {
  margin: 0 0 12px;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--primary-hover);
}

/* Header & Nav */
.site-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.brand-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px;
}

.brand-meta {
  display: flex;
  flex-direction: column;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.brand-title {
  margin: 0;
  font-size: 1.65rem;
  line-height: 1.2;
}

.site-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: all 0.15s ease;
}

.nav-link:hover {
  color: var(--text-main);
  background: var(--surface);
  border-color: var(--border-strong);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-bg);
  border-color: var(--primary-border);
  font-weight: 600;
}

/* Hero Section */
.hero-product {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-alt) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  margin: 16px 0 20px;
  box-shadow: var(--shadow-md);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 24px;
  align-items: center;
}

.hero-text-col {
  display: flex;
  flex-direction: column;
}

.hero-tagline {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin-bottom: 8px;
  color: var(--text-main);
}

.hero-lead {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 20px;
}

.hero-actions-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-preview-col {
  display: flex;
  justify-content: center;
}

.hero-preview-img {
  width: 100%;
  max-width: 420px;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: block;
}

/* Griglia Schede Applicazione (Word, Excel, PowerPoint, Outlook) */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 20px 0 28px;
}

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
}

.app-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.app-card.word { border-top: 3px solid var(--word-accent); }
.app-card.excel { border-top: 3px solid var(--excel-accent); }
.app-card.powerpoint { border-top: 3px solid var(--ppt-accent); }
.app-card.outlook { border-top: 3px solid var(--outlook-accent); }

.app-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.app-card-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.app-card.word .app-card-icon { color: var(--word-accent); }
.app-card.excel .app-card-icon { color: var(--excel-accent); }
.app-card.powerpoint .app-card-icon { color: var(--ppt-accent); }
.app-card.outlook .app-card-icon { color: var(--outlook-accent); }

.app-card-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}

.app-card-list {
  padding-left: 18px;
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
}

.app-card-list li {
  margin: 4px 0;
  line-height: 1.45;
}

/* Badge & Pill */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--primary-bg);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  letter-spacing: 0.02em;
}

.badge-beta {
  background: var(--warn-bg);
  color: var(--warn-text);
  border: 1px solid var(--warn-border);
}

.sub {
  color: var(--text-muted);
  font-size: 0.98rem;
  margin: 0;
}

/* Schede & Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  margin: 18px 0;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

/* Riquadro Avviso Chiave Obbligatoria (in cima) */
.note-key-requirement {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-left: 5px solid #d97706;
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin: 16px 0 24px;
  box-shadow: var(--shadow-sm);
}

.note-key-requirement .note-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--warn-title);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.note-key-requirement p {
  color: var(--warn-text);
  font-size: 14.5px;
  line-height: 1.6;
}

.note-key-requirement a {
  color: var(--warn-title);
  font-weight: 600;
  text-decoration-color: var(--warn-title);
}

.note-key-requirement a:hover {
  color: #b45309;
}

/* Note generiche */
.note {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 14px 0;
  font-size: 14px;
}

/* Pulsanti */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: var(--primary-contrast);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.btn:hover {
  background: var(--primary-hover);
  color: var(--primary-contrast);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn:active {
  background: var(--primary-active);
  transform: translateY(0);
}

.btn-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

/* Timeline / Passi installazione */
.steps-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 20px 0 32px;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease;
}

.step-card:hover {
  border-color: var(--border-strong);
}

.step-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  background: var(--primary-bg);
  color: var(--primary);
  border: 1.5px solid var(--primary-border);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  align-self: center;
}

.step-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Immagini screenshot */
.shot-container {
  margin: 14px 0;
  display: inline-block;
  max-width: 100%;
}

img.shot {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  display: block;
}

/* Liste */
ol, ul {
  padding-left: 22px;
  margin: 10px 0;
}

li {
  margin: 5px 0;
}

/* Codice */
code {
  background: var(--code-bg);
  color: var(--code-text);
  border: 1px solid var(--code-border);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', Menlo, Consolas, monospace;
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', Menlo, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.5;
  margin: 12px 0;
}

/* Tabelle */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin: 18px 0;
  background: var(--surface);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14.5px;
  text-align: left;
}

thead {
  background: var(--surface-alt);
}

th {
  padding: 12px 16px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text-main);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: var(--surface-hover);
}

/* Badge di stato per tabella */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.badge-status.success {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.badge-status.pending {
  background: var(--warn-bg);
  color: var(--warn-text);
  border: 1px solid var(--warn-border);
}

.badge-status.neutral {
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Footer */
footer.site-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.6;
}

/* Accessibilità e Focus */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .hero-preview-col {
    order: 0; /* su telefono prima il testo e il pulsante, poi l'illustrazione */
  }

  .hero-preview-img {
    max-width: 360px;
  }

  .apps-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 540px) {
  main {
    padding: 16px 14px 48px;
  }

  .brand-wrapper {
    gap: 12px;
  }

  .brand-icon {
    width: 44px;
    height: 44px;
  }

  .brand-title {
    font-size: 1.4rem;
  }

  .hero-product {
    padding: 20px 16px;
  }

  .apps-grid {
    grid-template-columns: 1fr;
  }

  .card, .step-card {
    padding: 16px 16px;
  }

  .step-header {
    gap: 10px;
  }

  .step-number {
    width: 24px;
    height: 24px;
    min-width: 24px;
    font-size: 12px;
  }

  .step-title {
    font-size: 1.05rem;
  }

  th, td {
    padding: 9px 12px;
  }
}

/* Frase breve sulla chiave accanto al pulsante Scarica (revisione Codex) */
.hero-key-chip {
  display: block;
  margin-top: 10px;
  padding: 8px 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--warn-text);
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius-md);
}
.hero-key-chip a { color: var(--warn-title); font-weight: 600; }
.hero-preview-caption { margin: 6px 0 0; font-size: 12px; color: var(--text-muted); text-align: center; }
.hero-preview-col { flex-direction: column; align-items: center; }

/* ---------- Pagina aperta dall'installatore (installa.html#installato) ---------- */
[hidden] { display: none !important; }

.done-banner {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.done-banner .done-title {
  font-size: 1.5rem;
  margin: 0 0 8px;
  color: var(--success-text);
}
.done-banner p, .done-banner ol { margin: 0 0 8px; }
.done-banner ol { padding-left: 1.4em; }
.done-banner a { color: inherit; font-weight: 600; text-decoration: underline; }
@media (max-width: 600px) { .done-banner { padding: 16px; } }
