/* ConcordatoFacile — stili condivisi delle pagine guida:
   calcolatori fiscali (.cfcalc-*), accordion FAQ (.faq-*), tabelle
   esempio (.cf-table), card dell'hub guide (.guide-*), callout.
   Caricato SOLO dalle pagine guida generate da _scaffold/build.py.
   Il sito Carrd rende su SFONDO SCURO (body rgb(16,17,25) da main.css):
   i token --cf-* replicano il set ".cf-dark" che i widget inline di
   calcolo-gratuito.html attivano via auto-detect — qui e' deterministico. */

:root {
	--cf-text: #f0f0f5;
	--cf-text-sub: #9a9bb8;
	--cf-accent: #6b93ff;
	--cf-accent-soft: rgba(107, 147, 255, 0.12);
	--cf-accent-glow: rgba(107, 147, 255, 0.18);
	--cf-good: #4ade80;
	--cf-good-soft: rgba(74, 222, 128, 0.10);
	--cf-card-bg: rgba(255, 255, 255, 0.06);
	--cf-card-border: rgba(255, 255, 255, 0.08);
	--cf-card-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 8px 24px -8px rgba(0,0,0,0.2);
	--cf-card-hover-shadow: 0 2px 8px rgba(107,147,255,0.08), 0 20px 44px -12px rgba(107,147,255,0.12);
	--cf-card-hover-border: rgba(107, 147, 255, 0.2);
	--cf-radius: 22px;
	--cf-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============================== FAQ accordion ==============================
   Stesso markup del widget inline di calcolo-gratuito.html (faq-container >
   faq-list > faq-item > faq-question + faq-answer). */

.faq-container {
	font-family: var(--cf-font);
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
	padding: 24px 16px;
	-webkit-font-smoothing: antialiased;
}

.faq-list {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.faq-item {
	background: var(--cf-card-bg);
	border-radius: var(--cf-radius);
	border: 1px solid var(--cf-card-border);
	box-shadow: var(--cf-card-shadow);
	overflow: hidden;
	position: relative;
	transition:
		opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
		transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
		box-shadow 0.35s ease,
		border-color 0.35s ease;
}

/* Reveal progressivo: visibili di default (senza JS/IntersectionObserver le FAQ
   devono comunque leggersi); guide.js aggiunge .faq-prep solo se puo' animare. */
.faq-item.faq-prep {
	opacity: 0;
	transform: translateY(20px);
}

.faq-item.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.faq-item:hover {
	box-shadow: var(--cf-card-hover-shadow);
	border-color: var(--cf-card-hover-border);
}

.faq-question {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 22px 24px;
	cursor: pointer;
	position: relative;
	z-index: 1;
	-webkit-tap-highlight-color: transparent;
}

.faq-icon {
	width: 42px;
	height: 42px;
	background: var(--cf-accent-soft);
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 19px;
	flex-shrink: 0;
	transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.faq-item:hover .faq-icon {
	transform: scale(1.08) rotate(-3deg);
}

.faq-question-text {
	flex: 1;
	font-size: 16px;
	font-weight: 700;
	color: var(--cf-text);
	line-height: 1.35;
	letter-spacing: -0.01em;
	padding-right: 36px;
}

.faq-toggle {
	position: absolute;
	right: 22px;
	top: 50%;
	transform: translateY(-50%);
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.faq-toggle svg {
	width: 16px;
	height: 16px;
	stroke: var(--cf-accent);
	stroke-width: 2.4;
	fill: none;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.faq-item.open .faq-toggle {
	transform: translateY(-50%) rotate(180deg);
}

.faq-answer {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.faq-answer-inner {
	padding: 0 24px 24px;
	padding-left: 80px;
}

.faq-answer-inner p {
	margin: 0 0 12px;
	font-size: 14px;
	line-height: 1.65;
	color: var(--cf-text-sub);
	font-weight: 500;
}

.faq-answer-inner p:last-child {
	margin-bottom: 0;
}

.faq-answer-inner strong {
	color: var(--cf-text);
	font-weight: 700;
}

.faq-answer-inner .faq-highlight {
	background: var(--cf-accent-soft);
	border-radius: 10px;
	padding: 14px 18px;
	margin: 10px 0;
	font-size: 13.5px;
	line-height: 1.6;
	color: var(--cf-text-sub);
	font-weight: 500;
	border-left: 3px solid var(--cf-accent);
}

.faq-answer-inner .faq-highlight strong {
	color: var(--cf-accent);
}

.faq-answer-inner ul {
	margin: 8px 0 12px;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.faq-answer-inner ul li {
	font-size: 14px;
	line-height: 1.55;
	color: var(--cf-text-sub);
	font-weight: 500;
	padding-left: 20px;
	position: relative;
}

.faq-answer-inner ul li::before {
	content: '';
	position: absolute;
	left: 2px;
	top: 8px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--cf-accent);
	opacity: 0.5;
}

@media (max-width: 768px) {
	.faq-container { padding: 16px 12px; }
	.faq-question { padding: 18px 18px; gap: 12px; }
	.faq-question-text { font-size: 14.5px; padding-right: 30px; }
	.faq-answer-inner { padding: 0 18px 20px; padding-left: 18px; }
	.faq-icon { width: 36px; height: 36px; font-size: 17px; border-radius: 10px; }
	.faq-toggle { right: 16px; }
}

/* ============================== Calcolatori ============================== */

.cfcalc {
	font-family: var(--cf-font);
	width: 100%;
	margin: 0 auto;
	padding: 8px 0 4px;
	-webkit-font-smoothing: antialiased;
}

.cfcalc-card {
	background: var(--cf-card-bg);
	border: 1px solid var(--cf-card-border);
	border-radius: var(--cf-radius);
	box-shadow: var(--cf-card-shadow);
	padding: 26px 24px;
	text-align: left;
}

.cfcalc-badge {
	display: inline-block;
	font-size: 11.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1.2px;
	color: var(--cf-accent);
	background: var(--cf-accent-soft);
	padding: 5px 14px;
	border-radius: 8px;
	margin-bottom: 16px;
}

.cfcalc-fields {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
}

.cfcalc-field label {
	display: block;
	font-size: 13px;
	font-weight: 700;
	color: var(--cf-text);
	margin-bottom: 7px;
	letter-spacing: -0.01em;
}

.cfcalc-field input[type="text"],
.cfcalc-field select {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 14px;
	border: 1.5px solid rgba(107, 147, 255, 0.28);
	border-radius: 12px;
	font-family: var(--cf-font);
	font-size: 16px; /* >=16px: evita lo zoom automatico su iOS */
	font-weight: 600;
	color: var(--cf-text);
	background: rgba(255, 255, 255, 0.07);
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	appearance: none;
	-webkit-appearance: none;
}

.cfcalc-field input[type="text"]::placeholder {
	color: var(--cf-text-sub);
	opacity: 0.7;
}

.cfcalc-field select option {
	background: #14151f; /* il popup delle option non eredita lo sfondo translucido */
	color: var(--cf-text);
}

.cfcalc-field select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b93ff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 16px;
	padding-right: 38px;
}

.cfcalc-field input[type="text"]:focus,
.cfcalc-field select:focus {
	border-color: var(--cf-accent);
	box-shadow: 0 0 0 3px var(--cf-accent-glow);
}

.cfcalc-hint {
	display: block;
	font-size: 12px;
	font-weight: 500;
	color: var(--cf-text-sub);
	margin-top: 6px;
	line-height: 1.45;
}

.cfcalc-hint a {
	color: var(--cf-accent);
}

/* Segmented control (radio nascosti + pill) */
.cfcalc-seg {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.cfcalc-seg input[type="radio"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.cfcalc-seg label {
	display: inline-block;
	margin: 0;
	padding: 10px 16px;
	border: 1.5px solid rgba(107, 147, 255, 0.28);
	border-radius: 999px;
	font-size: 13.5px;
	font-weight: 700;
	color: var(--cf-text-sub);
	cursor: pointer;
	transition: all 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.cfcalc-seg input[type="radio"]:checked + label {
	background: var(--cf-accent);
	border-color: var(--cf-accent);
	color: #fff;
}

.cfcalc-seg input[type="radio"]:focus-visible + label {
	box-shadow: 0 0 0 3px var(--cf-accent-glow);
}

/* Risultati */
.cfcalc-results {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 22px;
}

.cfcalc-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 14px;
	padding: 14px 18px;
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.06);
}

.cfcalc-row-label {
	font-size: 14px;
	font-weight: 700;
	color: var(--cf-text);
	line-height: 1.35;
}

.cfcalc-row-sub {
	display: block;
	font-size: 12px;
	font-weight: 500;
	color: var(--cf-text-sub);
	margin-top: 3px;
}

.cfcalc-row-value {
	font-size: 18px;
	font-weight: 800;
	color: var(--cf-text);
	white-space: nowrap;
	letter-spacing: -0.02em;
}

.cfcalc-row.cfcalc-best {
	background: var(--cf-accent-soft);
	border: 1.5px solid rgba(107, 147, 255, 0.35);
}

.cfcalc-row.cfcalc-best .cfcalc-row-value {
	color: var(--cf-accent);
}

.cfcalc-best-badge {
	display: inline-block;
	font-size: 10px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	color: #fff;
	background: var(--cf-accent);
	border-radius: 6px;
	padding: 3px 8px;
	margin-left: 8px;
	vertical-align: 2px;
	white-space: nowrap;
}

.cfcalc-delta {
	margin-top: 14px;
	padding: 16px 18px;
	border-radius: 14px;
	background: var(--cf-good-soft);
	border: 1.5px solid rgba(74, 222, 128, 0.30);
	font-size: 14.5px;
	font-weight: 700;
	color: var(--cf-text);
	line-height: 1.5;
}

.cfcalc-delta strong {
	color: var(--cf-good);
	font-size: 17px;
	font-weight: 800;
}

.cfcalc-delta:empty {
	display: none;
}

.cfcalc-note {
	margin: 16px 0 0;
	font-size: 12.5px;
	font-weight: 500;
	color: var(--cf-text-sub);
	line-height: 1.55;
}

.cfcalc-note a {
	color: var(--cf-accent);
}

.cfcalc-disclaimer {
	margin: 10px 0 0;
	font-size: 11.5px;
	font-weight: 500;
	color: var(--cf-text-sub);
	opacity: 0.8;
	line-height: 1.5;
}

@media (max-width: 768px) {
	.cfcalc-card { padding: 20px 16px; }
	.cfcalc-row { flex-direction: column; align-items: flex-start; gap: 6px; }
	.cfcalc-row-value { font-size: 17px; }
}

/* ========================= Tabelle esempio statiche ========================= */

.cf-table-wrap {
	font-family: var(--cf-font);
	overflow-x: auto;
	margin: 12px 0;
	border: 1px solid var(--cf-card-border);
	border-radius: 16px;
	box-shadow: var(--cf-card-shadow);
	background: var(--cf-card-bg);
}

.cf-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	min-width: 480px;
}

.cf-table th {
	text-align: left;
	padding: 12px 16px;
	background: var(--cf-accent-soft);
	color: var(--cf-text);
	font-weight: 800;
	font-size: 12.5px;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	white-space: nowrap;
}

.cf-table td {
	padding: 12px 16px;
	border-top: 1px solid rgba(255, 255, 255, 0.07);
	color: var(--cf-text-sub);
	font-weight: 500;
	line-height: 1.45;
}

.cf-table td strong {
	color: var(--cf-text);
	font-weight: 700;
}

.cf-table .cf-table-best td {
	background: var(--cf-good-soft);
}

.cf-table .cf-table-best td strong {
	color: var(--cf-good);
}

/* ============================== Callout ============================== */

.cf-callout {
	font-family: var(--cf-font);
	background: var(--cf-accent-soft);
	border-left: 3px solid var(--cf-accent);
	border-radius: 12px;
	padding: 16px 20px;
	margin: 14px 0;
	font-size: 14px;
	font-weight: 500;
	color: var(--cf-text-sub);
	line-height: 1.6;
	text-align: left;
}

.cf-callout strong {
	color: var(--cf-text);
}

.cf-callout a {
	color: var(--cf-accent);
}

/* ============================== Hub guide ============================== */

.guide-groups {
	font-family: var(--cf-font);
	text-align: left;
}

.guide-group-title {
	font-size: 13px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 1.2px;
	color: var(--cf-accent);
	margin: 30px 0 14px;
}

.guide-groups .guide-group-title:first-child {
	margin-top: 8px;
}

.guide-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 14px;
}

a.guide-card,
.guide-card {
	display: block;
	background: var(--cf-card-bg);
	border: 1px solid var(--cf-card-border);
	border-radius: var(--cf-radius);
	box-shadow: var(--cf-card-shadow);
	padding: 20px 22px;
	text-decoration: none;
	border-bottom: 1px solid var(--cf-card-border); /* annulla underline-border di Carrd sugli <a> */
	transition: transform 0.25s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

a.guide-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--cf-card-hover-shadow);
	border-color: var(--cf-card-hover-border);
}

.guide-card-emoji {
	font-size: 24px;
	line-height: 1;
	display: block;
	margin-bottom: 10px;
}

.guide-card-title {
	font-size: 15.5px;
	font-weight: 800;
	color: var(--cf-text);
	letter-spacing: -0.02em;
	line-height: 1.3;
	margin: 0 0 6px;
}

.guide-card-desc {
	font-size: 13px;
	font-weight: 500;
	color: var(--cf-text-sub);
	line-height: 1.5;
	margin: 0;
}

.guide-card-tag {
	display: inline-block;
	font-size: 10px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	color: var(--cf-good);
	background: var(--cf-good-soft);
	border-radius: 6px;
	padding: 3px 8px;
	margin-top: 10px;
}

.guide-card.is-soon {
	opacity: 0.55;
	border-style: dashed;
	box-shadow: none;
}

.guide-card.is-soon .guide-card-tag {
	color: var(--cf-text-sub);
	background: rgba(255, 255, 255, 0.08);
}
