/* Stile condiviso nemo */
:root {
  --notte: #081522;
  --blu: #0E2435;
  --avorio: #EAE3D2;
  --oro: #C9A45C;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--notte);
  color: var(--avorio);
  font-family: 'Montserrat', system-ui, sans-serif;
}

a { color: var(--oro); }

/* L'attributo hidden deve sempre nascondere, anche su elementi con display impostato */
[hidden] { display: none !important; }

.wordmark {
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #FFFFFF;
  text-decoration: none;
}

/* --- Login e schermate centrate --- */
.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.card {
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.card .wordmark {
  display: block;
  font-size: 44px;
  margin-bottom: 0.15em;
}

.card .payoff {
  font-family: 'Turret Road', sans-serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--avorio);
  opacity: 0.75;
  margin: 0 0 2.25rem;
}

form { display: flex; flex-direction: column; gap: 0.85rem; text-align: left; }

label { font-size: 12px; letter-spacing: 0.06em; opacity: 0.8; margin-bottom: -0.5rem; }

input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(234, 227, 210, 0.22);
  border-radius: 8px;
  background: var(--blu);
  color: var(--avorio);
  font-size: 15px;
  font-family: inherit;
}
input:focus { outline: none; border-color: var(--oro); }

button {
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--oro);
  color: var(--notte);
  font-family: 'Orbitron', sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.05em;
  cursor: pointer;
}
button:disabled { opacity: 0.55; cursor: default; }

.msg { min-height: 1.2em; font-size: 13px; margin: 0.4rem 0 0; }
.msg.error { color: #E58B7B; }
.msg.info { color: var(--avorio); opacity: 0.8; }

/* --- Data room --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--notte);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid rgba(234, 227, 210, 0.12);
}
.topbar .wordmark { font-size: 24px; }
.topbar .user { font-size: 12px; opacity: 0.7; display: flex; align-items: center; gap: 1rem; }
.topbar button {
  margin: 0;
  padding: 0.5rem 0.9rem;
  background: transparent;
  border: 1px solid rgba(234, 227, 210, 0.3);
  color: var(--avorio);
  font-size: 12px;
}

.content { max-width: 820px; margin: 0 auto; padding: 3rem 1.5rem; }
.content h1 { font-family: 'Orbitron', sans-serif; font-weight: 600; }

.gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; opacity: 0.6; font-size: 14px; }

/* --- Data room: sezione numeri --- */
.content.wide { max-width: 940px; }
.content h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 0.2em; }
.content h2 {
  font-family: 'Orbitron', sans-serif; font-weight: 600;
  font-size: clamp(19px, 2.4vw, 24px); margin: 3rem 0 0.8rem;
  padding-bottom: 0.5rem; border-bottom: 1px solid rgba(234, 227, 210, 0.12);
}
.content h3 {
  font-family: 'Orbitron', sans-serif; font-weight: 600;
  font-size: clamp(15px, 1.9vw, 18px); margin: 2.2rem 0 0.4rem; color: #FFF;
}
.content p { line-height: 1.7; color: #D8D0BE; }
.content ol, .content ul { color: #D8D0BE; line-height: 1.7; padding-left: 1.5rem; margin: 0.6rem 0; }
.content li { margin: 0.45rem 0; }
.content strong { color: #EAE3D2; }
.content.prose { max-width: 720px; }
.content.prose .lead { font-size: 1.05rem; color: var(--avorio); }
.content .closing { font-style: italic; color: var(--avorio); }
.subtitle { font-size: 13px; letter-spacing: 0.04em; color: var(--oro); margin-top: 0; }
.disclaimer { font-size: 12px; opacity: 0.6; }

.back { display: inline-block; font-size: 12px; letter-spacing: 0.06em; text-decoration: none; margin-bottom: 1.5rem; opacity: 0.8; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin: 1.5rem 0 0.5rem; }
.kpi { background: var(--blu); border: 1px solid rgba(234, 227, 210, 0.1); border-radius: 10px; padding: 1rem 1.1rem; }
.kpi .val { font-family: 'Orbitron', sans-serif; font-weight: 600; font-size: 22px; color: #FFF; }
.kpi .lab { font-size: 11px; letter-spacing: 0.05em; opacity: 0.65; margin-top: 0.35rem; }

/* Grafici */
figure.chart { margin: 1.5rem 0 0; }
figure.chart figcaption { font-size: 12px; opacity: 0.6; margin-top: 0.6rem; text-align: center; }
.legend { display: flex; flex-wrap: wrap; gap: 1.2rem; justify-content: center; margin: 0.4rem 0 0.2rem; font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 0.45rem; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.chart-tip {
  position: fixed; z-index: 50; display: none; pointer-events: none;
  background: #06111c; border: 1px solid rgba(234, 227, 210, 0.2); border-radius: 8px;
  padding: 0.5rem 0.7rem; font-size: 12px; color: var(--avorio);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); font-family: 'Montserrat', sans-serif;
}
.chart-tip b { color: #FFF; }

/* Tabelle finanziarie */
.tbl-wrap { overflow-x: auto; margin: 1rem 0; }
table.fin { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
table.fin th, table.fin td { padding: 0.6rem 0.8rem; text-align: right; border-bottom: 1px solid rgba(234, 227, 210, 0.1); }
table.fin th:first-child, table.fin td:first-child { text-align: left; }
table.fin thead th { font-size: 12px; letter-spacing: 0.04em; color: var(--oro); font-weight: 600; border-bottom-color: rgba(201, 164, 92, 0.4); }
table.fin tr.total td { font-weight: 700; color: #FFF; border-top: 1px solid rgba(234, 227, 210, 0.25); }
table.fin tr.strong td { font-weight: 600; color: #FFF; }
table.fin td.neg { color: #E58B7B; }
table.fin .muted { opacity: 0.55; }
table.fin caption { text-align: left; font-size: 12px; opacity: 0.6; margin-bottom: 0.5rem; caption-side: top; }

/* Download protetto */
.download { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--blu); border: 1px solid rgba(201, 164, 92, 0.35); border-radius: 10px;
  padding: 1.1rem 1.3rem; margin: 1.5rem 0; flex-wrap: wrap; }
.download .desc { font-size: 13px; }
.download .desc b { color: #FFF; font-weight: 600; }
.download a.btn, .download button.btn {
  background: var(--oro); color: var(--notte); text-decoration: none; font-family: 'Orbitron', sans-serif;
  font-weight: 600; font-size: 13px; padding: 0.6rem 1.1rem; border-radius: 8px; border: none; cursor: pointer; white-space: nowrap; }
.download .pending { font-size: 12px; opacity: 0.6; font-style: italic; }

.updated { margin-top: 3rem; padding-top: 1.2rem; border-top: 1px solid rgba(234, 227, 210, 0.12); font-size: 12px; opacity: 0.6; }

/* Landing data room */
.sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: 2rem; }
.section-card { display: block; background: var(--blu); border: 1px solid rgba(234, 227, 210, 0.12); border-radius: 12px;
  padding: 1.4rem 1.5rem; text-decoration: none; color: var(--avorio); transition: border-color 0.2s; }
.section-card:hover { border-color: var(--oro); }
.section-card h3 { font-family: 'Orbitron', sans-serif; font-weight: 600; margin: 0 0 0.4rem; font-size: 16px; color: #FFF; }
.section-card p { margin: 0; font-size: 13px; opacity: 0.7; line-height: 1.5; }
.section-card.soon { opacity: 0.5; pointer-events: none; }

/* Welcome: 4 pillole al primo accesso */
.welcome-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(4, 10, 17, 0.8); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); padding: 1.25rem; }
.welcome-overlay[hidden] { display: none; }
.welcome-card { position: relative; background: linear-gradient(180deg, #10293c, #081522);
  border: 1px solid rgba(201, 164, 92, 0.35); border-radius: 16px; width: 100%; max-width: 480px;
  padding: 2.1rem 1.8rem 1.5rem; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  max-height: calc(100vh - 2.5rem); overflow-y: auto; }
.welcome-slide .lead { font-size: 14px; line-height: 1.55; margin: 0.6rem 0; }
.w-skip { position: absolute; top: 0.9rem; right: 1.1rem; background: none; border: none; color: var(--avorio);
  opacity: 0.55; font-size: 12px; letter-spacing: 0.04em; cursor: pointer; font-family: 'Montserrat', sans-serif; }
.w-skip:hover { opacity: 1; }
.welcome-slide[hidden] { display: none; }
.welcome-slide .step { font-family: 'Montserrat', sans-serif; font-size: 11px; letter-spacing: 0.12em; color: var(--oro); text-transform: uppercase; }
.welcome-slide h3 { font-family: 'Orbitron', sans-serif; font-weight: 600; color: #FFF; font-size: 22px; margin: 0.5rem 0 0; }
.welcome-slide .narr { font-family: 'Turret Road', sans-serif; font-weight: 500; color: var(--oro); font-size: 13px; letter-spacing: 0.05em; margin-top: 0.25rem; }
.welcome-slide .lead { color: #D8D0BE; line-height: 1.6; margin: 1rem 0; font-size: 15px; }
.welcome-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; }
.welcome-chips > span { background: rgba(234, 227, 210, 0.08); border: 1px solid rgba(234, 227, 210, 0.14);
  border-radius: 20px; padding: 0.35rem 0.75rem; font-size: 12px; color: var(--avorio); }
.welcome-chips > span span[data-round] { color: #FFF; font-weight: 600; }
.welcome-slide .lead + .lead { margin-top: -0.4rem; }
.welcome-slide .where { font-size: 13px; color: #C9BFA9; margin-top: 1.2rem; padding-top: 0.9rem;
  border-top: 1px solid rgba(234, 227, 210, 0.12); }
.welcome-slide .where b { color: var(--oro); font-weight: 600; }
.welcome-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 1.6rem; }
.welcome-dots { display: flex; gap: 0.4rem; }
.welcome-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(234, 227, 210, 0.25); display: block; transition: background 0.2s; }
.welcome-dots i.on { background: var(--oro); }
.welcome-btns { display: flex; gap: 0.6rem; align-items: center; }
.welcome-btns button { font-family: 'Montserrat', sans-serif; font-size: 13px; border-radius: 8px; padding: 0.55rem 1rem; cursor: pointer; border: 1px solid transparent; }
.w-prev { background: transparent; color: var(--avorio); border-color: rgba(234, 227, 210, 0.25); }
.w-next { background: var(--oro); color: var(--notte); font-weight: 600; }
.welcome-reopen { display: inline-block; margin: 2.5rem 0 0; font-size: 12px; color: var(--avorio); opacity: 0.55; text-decoration: none; cursor: pointer; }
.welcome-reopen:hover { opacity: 1; color: var(--oro); }
@media (max-width: 520px) { .welcome-card { max-width: none; min-height: calc(100vh - 2.5rem); display: flex; flex-direction: column; } .welcome-nav { margin-top: auto; } }

/* Team: scheda guida e organigramma */
.lead-card { background: var(--blu); border: 1px solid rgba(201, 164, 92, 0.35); border-radius: 12px;
  padding: 1.4rem 1.6rem; margin: 1.5rem 0; max-width: 560px; }
.lead-card .name { font-family: 'Orbitron', sans-serif; font-weight: 600; color: #FFF; font-size: 18px; }
.lead-card .role { font-size: 12px; letter-spacing: 0.06em; color: var(--oro); text-transform: uppercase; margin: 0.25rem 0 0.8rem; }
.lead-card p { margin: 0; }

.org { display: flex; flex-direction: column; align-items: center; margin: 2rem 0 1rem; }
.org .node { background: var(--blu); border: 1px solid rgba(234, 227, 210, 0.16); border-radius: 10px;
  padding: 0.85rem 1.2rem; text-align: center; min-width: 150px; }
.org .node.lead { border-color: var(--oro); }
.org .node .nm { font-weight: 600; color: #FFF; }
.org .node .role { display: block; font-size: 10px; letter-spacing: 0.06em; opacity: 0.6; text-transform: uppercase; margin-top: 0.25rem; }
.org .node .cnt { display: block; font-size: 11px; color: var(--oro); margin-top: 0.3rem; }
.org .node .hc { display: block; font-size: 10px; opacity: 0.55; margin-top: 0.2rem; }
.org .node.consult { border-style: dashed; }
.org .node .tagc { display: block; font-size: 10px; letter-spacing: 0.05em; opacity: 0.6; font-style: italic; margin-top: 0.2rem; }
.org .trunk { width: 2px; height: 24px; background: rgba(234, 227, 210, 0.22); }
.org .row { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.org .branch { position: relative; padding-top: 24px; display: flex; flex-direction: column; align-items: center; }
/* stelo verticale dal ramo alla barra orizzontale */
.org .branch::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 2px; height: 24px; background: rgba(234, 227, 210, 0.22); }
/* barra orizzontale continua che collega tutti i rami (estesa oltre il gap) */
.org .branch::after { content: ""; position: absolute; top: 0; left: -0.5rem; right: -0.5rem;
  height: 2px; background: rgba(234, 227, 210, 0.22); }
.org .branch:first-child::after { left: 50%; }
.org .branch:last-child::after { right: 50%; }
.org-note { text-align: center; font-size: 12px; opacity: 0.6; }

/* Documento lungo (analisi detox) in stile data room */
.kicker { font-family: 'Montserrat', sans-serif; font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--oro); margin: 2.4rem 0 0.2rem; }
.content h2.tight { margin-top: 0.2rem; }
.content .lede { font-size: 1.05rem; color: var(--avorio); }
.content hr.rule { border: 0; border-top: 1px solid rgba(234, 227, 210, 0.12); margin: 2.6rem 0; }

.content figure { margin: 1.5rem 0; }
.content figure img { width: 100%; height: auto; display: block;
  border: 1px solid rgba(234, 227, 210, 0.14); border-radius: 8px; background: var(--blu); }
.content figure figcaption { font-size: 12px; opacity: 0.6; margin-top: 0.5rem; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .duo { grid-template-columns: 1fr; } }

.callout { background: var(--blu); border: 1px solid rgba(234, 227, 210, 0.14);
  border-left: 3px solid var(--oro); border-radius: 8px; padding: 1rem 1.2rem; margin: 1.3rem 0; }
.callout .tag { font-family: 'Montserrat', sans-serif; font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--oro); display: block; margin-bottom: 0.4rem; }
.callout p { margin: 0; }

ul.clean { list-style: none; padding: 0; margin: 1rem 0; }
ul.clean li { padding: 0.7rem 0; border-bottom: 1px solid rgba(234, 227, 210, 0.1);
  color: #D8D0BE; line-height: 1.6; }
ul.clean li:last-child { border-bottom: none; }

.linkdir { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.9rem; margin-top: 1rem; }
.linkdir .card { background: var(--blu); border: 1px solid rgba(234, 227, 210, 0.12);
  border-radius: 10px; padding: 0.9rem 1.1rem; font-size: 13px; line-height: 1.9; }
.linkdir .card .cat { font-family: 'Montserrat', sans-serif; font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--oro); margin-bottom: 0.4rem; }
.tnote { font-size: 12px; opacity: 0.55; margin-top: 0.5rem; }

table.fin.txt th, table.fin.txt td { text-align: left; }

/* Elenco documenti numerato (sotto-cartelle) */
.doclist { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 2rem; }
.docrow { display: flex; align-items: flex-start; gap: 1rem; background: var(--blu);
  border: 1px solid rgba(234, 227, 210, 0.12); border-radius: 10px; padding: 1rem 1.2rem;
  text-decoration: none; color: var(--avorio); transition: border-color 0.2s; }
.docrow:hover { border-color: var(--oro); }
.docrow .n { font-family: 'Orbitron', sans-serif; color: var(--oro); font-weight: 600; font-size: 14px; min-width: 1.4em; }
.docrow .body { flex: 1; }
.docrow .t { display: block; font-weight: 600; color: #FFF; }
.docrow .d { display: block; font-size: 12px; opacity: 0.6; margin-top: 0.2rem; }
.docrow .tag { font-size: 11px; letter-spacing: 0.05em; opacity: 0.6; font-style: italic; white-space: nowrap; align-self: center; }
.docrow.soon:hover { border-color: rgba(234, 227, 210, 0.12); }

/* Segnaposto documento in preparazione */
.placeholder { text-align: center; padding: 4rem 1rem; }
.placeholder .big { font-family: 'Orbitron', sans-serif; color: var(--oro); font-size: 15px; letter-spacing: 0.08em; }
.placeholder p { max-width: 460px; margin: 1rem auto 0; opacity: 0.7; }
