/* =============================================================================
 * Widget [broker_card] — Stylesheet
 *
 * Card editoriale per pagine listicle merceologiche (/piattaforme-trading/,
 * /migliori-broker-azioni/, ecc.). Sostituisce le vecchie sezioni broker-per-broker
 * con sistema di valutazione 0-10 incoerente.
 *
 * Design: bianco con lavanda chiarissima, spina + linea top viola→rosa
 * (firma editoriale sistema), bordo viola tenue, ombre layered con tinta viola.
 *
 * Created: 11 Maggio 2026
 * ========================================================================== */

.brk-card {
	position: relative;
	background:
		linear-gradient(90deg, #4907d9 0%, #d4537e 100%) top / 100% 2px no-repeat,
		linear-gradient(180deg, #ffffff 0%, #fafaff 100%);
	border: 1px solid rgba(73, 7, 217, 0.08);
	border-top: none;
	border-radius: 16px;
	padding: 24px 26px 22px 30px;
	margin: 0 0 28px 0;
	overflow: hidden;
	box-shadow:
		0 1px 2px rgba(20, 22, 30, 0.02),
		0 12px 32px rgba(73, 7, 217, 0.05);
	font-family: 'Roboto', sans-serif;
}

/* Spina viola→rosa sx (firma editoriale del sistema) */
.brk-card::before {
	content: '';
	position: absolute;
	left: 0;
	top: 22px;
	bottom: 22px;
	width: 3px;
	background: linear-gradient(180deg, #4907d9 0%, #d4537e 100%);
	border-radius: 0 3px 3px 0;
}
/* Glow viola lavanda decorativo angolare */
.brk-card::after {
	content: '';
	position: absolute;
	top: -50px;
	right: -50px;
	width: 180px;
	height: 180px;
	background: radial-gradient(circle, rgba(106, 63, 237, 0.07) 0%, transparent 65%);
	pointer-events: none;
}
.brk-card > * {
	position: relative;
	z-index: 1;
}

/* ====== HEADER: H2 numerato + cluster badge ====== */
.brk-card-head {
	display: flex;
	align-items: baseline;
	gap: 12px;
	margin-bottom: 16px;
	flex-wrap: wrap;
}
.brk-card-title {
	font-family: 'Roboto', sans-serif;
	font-weight: 800;
	font-size: 28px;
	letter-spacing: -0.5px;
	color: #1a1c25;
	line-height: 1.15;
	margin: 0;
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
}
.brk-card-title-rank {
	color: #4907d9;
	font-weight: 800;
}
.brk-card-cluster {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 3px 10px;
	background: #efe8fb;
	color: #4907d9;
	border-radius: 999px;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}
.brk-card-cluster i { font-size: 9px; opacity: 0.85; }

/* ====== RIGA SCORE: logo + ⓘ + voto stelle + voto/100 + CTA verde ====== */
.brk-card-score-row {
	position: relative;
	display: grid;
	grid-template-columns: auto 1fr auto;
	gap: 22px;
	align-items: center;
	background: #ffffff;
	border-radius: 12px;
	padding: 16px 18px;
	margin-bottom: 18px;
	box-shadow:
		0 1px 2px rgba(20, 22, 30, 0.03),
		0 4px 12px rgba(73, 7, 217, 0.04),
		inset 0 1px 0 rgba(255, 255, 255, 0.9);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Bordo sfumato gradient con tecnica double-background */
.brk-card-score-row {
	background:
		linear-gradient(#ffffff, #ffffff) padding-box,
		linear-gradient(135deg,
			rgba(73, 7, 217, 0.18) 0%,
			rgba(212, 83, 126, 0.14) 50%,
			rgba(73, 7, 217, 0.18) 100%) border-box;
	border: 1px solid transparent;
}
.brk-card-score-row:hover {
	transform: translateY(-2px);
	box-shadow:
		0 1px 2px rgba(20, 22, 30, 0.03),
		0 12px 28px rgba(73, 7, 217, 0.12),
		inset 0 1px 0 rgba(255, 255, 255, 0.9);
	background:
		linear-gradient(#ffffff, #fcfaff) padding-box,
		linear-gradient(135deg,
			rgba(73, 7, 217, 0.28) 0%,
			rgba(212, 83, 126, 0.24) 50%,
			rgba(73, 7, 217, 0.28) 100%) border-box;
}

/* Logo container normalizzato — uniforme per tutti i broker */
.brk-card-logo-wrap {
	position: relative;
	width: 80px;
	height: 80px;
	background: linear-gradient(180deg, #ffffff 0%, #fafaff 100%);
	border: 1px solid rgba(73, 7, 217, 0.10);
	border-radius: 14px;
	padding: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	box-shadow:
		0 2px 8px rgba(73, 7, 217, 0.06),
		inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.brk-card-logo-wrap img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}
.brk-card-logo-fallback {
	font-weight: 800;
	font-size: 14px;
	color: #4907d9;
	letter-spacing: 0.5px;
}

/* ⓘ tooltip metodologia in alto-dx del logo */
.brk-card-logo-info {
	position: absolute;
	top: -6px;
	right: -6px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #ffffff;
	border: 1px solid rgba(73, 7, 217, 0.18);
	color: #4907d9;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(73, 7, 217, 0.12);
	transition: all 0.18s ease;
	font-size: 10px;
	padding: 0;
	z-index: 2;
	-webkit-appearance: none;
	appearance: none;
}
.brk-card-logo-info:hover,
.brk-card-logo-info:focus {
	background: #4907d9;
	color: #ffffff;
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(73, 7, 217, 0.25);
	outline: none;
}
.brk-card-logo-info i {
	font-size: 10px;
	line-height: 1;
}

/* Voto centrale */
.brk-card-rating {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}
.brk-card-stars {
	display: inline-flex;
	gap: 2px;
	font-size: 18px;
	color: #f0b428;
}
.brk-card-stars i { font-size: 18px; }
.brk-card-stars .fa-regular { color: #d9dae3; }
.brk-card-voto-line {
	display: inline-flex;
	align-items: baseline;
	gap: 8px;
	font-size: 13.5px;
	color: #6b6e7d;
	flex-wrap: wrap;
}
.brk-card-voto-num {
	font-size: 22px;
	font-weight: 800;
	color: #4907d9;
	letter-spacing: -0.5px;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}
.brk-card-voto-max {
	font-size: 14px;
	color: #8d92a3;
	font-weight: 500;
	margin-left: -2px;
}
.brk-card-voto-100 {
	display: inline-flex;
	align-items: center;
	padding: 3px 9px;
	background: linear-gradient(135deg, #4907d9 0%, #6a3fed 100%);
	color: #ffffff;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.3px;
}

/* CTA verde "Visita Broker" tappa-pollice rapido a destra */
.brk-card-quick-cta,
.brk-card-quick-cta:link,
.brk-card-quick-cta:visited {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 11px 18px;
	background: #04be68;
	color: #ffffff !important;
	border-radius: 10px;
	font-weight: 700;
	font-size: 13px;
	text-decoration: none;
	white-space: nowrap;
	transition: all 0.18s ease;
}
.brk-card-quick-cta span,
.brk-card-quick-cta i {
	color: #ffffff !important;
}
.brk-card-quick-cta:hover {
	background: #02a85a;
	color: #ffffff !important;
	transform: translateY(-1px);
	box-shadow: 0 6px 14px rgba(4, 190, 104, 0.30);
}
.brk-card-quick-cta:hover span,
.brk-card-quick-cta:hover i {
	color: #ffffff !important;
}
.brk-card-quick-cta i { font-size: 10px; }

/* ====== 6 CRITERI MINI-SCORE ====== */
.brk-card-criteria {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 10px;
	border-radius: 12px;
	padding: 14px 16px;
	margin-bottom: 22px;
	box-shadow:
		0 1px 2px rgba(20, 22, 30, 0.03),
		0 4px 12px rgba(73, 7, 217, 0.04),
		inset 0 1px 0 rgba(255, 255, 255, 0.9);
	/* Bordo sfumato gradient */
	background:
		linear-gradient(#ffffff, #ffffff) padding-box,
		linear-gradient(135deg,
			rgba(73, 7, 217, 0.18) 0%,
			rgba(212, 83, 126, 0.14) 50%,
			rgba(73, 7, 217, 0.18) 100%) border-box;
	border: 1px solid transparent;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.brk-card-criteria:hover {
	box-shadow:
		0 1px 2px rgba(20, 22, 30, 0.03),
		0 10px 24px rgba(73, 7, 217, 0.10),
		inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.brk-card-crit {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 5px;
	text-align: center;
	padding: 8px 4px;
	border-radius: 8px;
	cursor: help;
	transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.brk-card-crit:hover {
	transform: translateY(-2px);
	background: linear-gradient(180deg, rgba(73, 7, 217, 0.04) 0%, rgba(73, 7, 217, 0.08) 100%);
	box-shadow: 0 6px 16px rgba(73, 7, 217, 0.10);
}
.brk-card-crit:hover .brk-card-crit-label {
	color: #4907d9;
}
.brk-card-crit:hover .brk-card-crit-val {
	color: #4907d9;
	transform: scale(1.08);
}
.brk-card-crit:hover .brk-card-crit-fill {
	filter: brightness(1.08) saturate(1.15);
	box-shadow: 0 0 8px rgba(73, 7, 217, 0.30);
}
.brk-card-crit-label {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.3px;
	text-transform: uppercase;
	color: #6b6e7d;
	line-height: 1.2;
	transition: color 0.22s ease;
}
.brk-card-crit-bar {
	width: 100%;
	height: 5px;
	background: #f0ecf7;
	border-radius: 3px;
	overflow: hidden;
}
.brk-card-crit-fill {
	height: 100%;
	border-radius: 3px;
	transition: width 0.4s ease, filter 0.22s ease, box-shadow 0.22s ease;
}
.brk-card-crit-fill-top   { background: linear-gradient(90deg, #4907d9 0%, #6a3fed 100%); }
.brk-card-crit-fill-high  { background: linear-gradient(90deg, #6a3fed 0%, #8c5dee 100%); }
.brk-card-crit-fill-mid   { background: linear-gradient(90deg, #f0b428 0%, #f6c95a 100%); }
.brk-card-crit-fill-low   { background: linear-gradient(90deg, #d44a4a 0%, #e26c6c 100%); }
.brk-card-crit-fill-empty { background: #d9dae3; }
.brk-card-crit-val {
	font-size: 12.5px;
	font-weight: 800;
	color: #1a1c25;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.3px;
	transition: color 0.22s ease, transform 0.22s ease;
	transform-origin: center;
}

/* ====== H3 SECTIONS ====== */
.brk-card-section-title {
	font-family: 'Roboto', sans-serif;
	font-size: 16px;
	font-weight: 800;
	color: #1a1c25;
	margin: 0 0 12px;
	letter-spacing: -0.2px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.brk-card-section-title i {
	color: #4907d9;
	font-size: 13px;
}

/* Punti di forza grid */
.brk-card-keyfeat {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-bottom: 22px;
}
.brk-card-keyfeat-item {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 12px 14px;
	background: linear-gradient(180deg, #ffffff 0%, #fcfcff 100%);
	border: 1px solid rgba(73, 7, 217, 0.09);
	border-radius: 10px;
	font-size: 13px;
	font-weight: 600;
	color: #1a1c25;
	line-height: 1.4;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow:
		0 1px 2px rgba(20, 22, 30, 0.02),
		inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.brk-card-keyfeat-item:hover {
	border-color: rgba(73, 7, 217, 0.20);
	background: linear-gradient(180deg, #ffffff 0%, #faf7ff 100%);
	box-shadow:
		0 1px 2px rgba(20, 22, 30, 0.02),
		0 8px 20px rgba(73, 7, 217, 0.10),
		inset 0 1px 0 rgba(255, 255, 255, 0.9);
	transform: translateY(-2px);
}
.brk-card-keyfeat-icon {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: linear-gradient(135deg, #04be68 0%, #06d574 100%);
	color: #ffffff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	flex-shrink: 0;
	box-shadow: 0 2px 6px rgba(4, 190, 104, 0.25);
}

/* Cos'è */
.brk-card-desc {
	font-size: 14px;
	line-height: 1.6;
	color: #3c404d;
	margin: 0 0 18px;
}
.brk-card-desc p { margin: 0 0 8px; }
.brk-card-desc p:last-child { margin-bottom: 0; }

/* ====== FOOTER: singolo link approfondimento ====== */
.brk-card-footer {
	margin-top: 4px;
	padding-top: 16px;
	border-top: 1px solid rgba(73, 7, 217, 0.10);
	text-align: right;
	position: relative;
}
.brk-card-footer::before {
	content: '';
	position: absolute;
	top: -1px;
	left: 25%;
	right: 25%;
	height: 1px;
	background: linear-gradient(90deg, transparent 0%, rgba(73, 7, 217, 0.20) 50%, transparent 100%);
	pointer-events: none;
}
.brk-card-cta-secondary {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px 8px 12px;
	border-radius: 8px;
	color: #4907d9;
	font-weight: 700;
	font-size: 13.5px;
	text-decoration: none;
	transition: all 0.18s ease;
	background: transparent;
	border: 1px solid transparent;
}
.brk-card-cta-secondary:hover {
	background: #efe8fb;
	border-color: rgba(73, 7, 217, 0.15);
	color: #4907d9;
}
.brk-card-cta-secondary i:first-child { font-size: 13px; }
.brk-card-cta-arrow {
	font-size: 11px;
	transition: transform 0.2s ease;
}
.brk-card-cta-secondary:hover .brk-card-cta-arrow {
	transform: translateX(3px);
}

/* ============ MOBILE ============ */
@media (max-width: 768px) {
	.brk-card {
		padding: 18px 18px 18px 22px;
		border-radius: 14px;
		margin-bottom: 22px;
	}
	.brk-card::before {
		top: 18px;
		bottom: 18px;
		width: 2.5px;
	}
	.brk-card::after {
		width: 120px;
		height: 120px;
		top: -35px;
		right: -35px;
	}

	.brk-card-head {
		gap: 8px;
		margin-bottom: 12px;
	}
	.brk-card-title {
		font-size: 22px;
		letter-spacing: -0.3px;
	}
	.brk-card-cluster {
		font-size: 9.5px;
		padding: 2px 8px;
	}

	/* Score row mobile: logo + voto in riga, CTA verde sotto full-width */
	.brk-card-score-row {
		grid-template-columns: auto 1fr;
		gap: 14px;
		padding: 14px;
	}
	.brk-card-logo-wrap {
		width: 64px;
		height: 64px;
		border-radius: 12px;
		padding: 8px;
	}
	.brk-card-logo-info {
		width: 22px;
		height: 22px;
		font-size: 10px;
		top: -4px;
		right: -4px;
	}
	.brk-card-rating { gap: 4px; }
	.brk-card-stars i { font-size: 16px; }
	.brk-card-voto-num { font-size: 20px; }
	.brk-card-voto-max { font-size: 13px; }
	.brk-card-voto-100 { font-size: 10.5px; padding: 2px 8px; }
	.brk-card-quick-cta {
		grid-column: 1 / -1;
		justify-content: center;
		padding: 11px 18px;
		font-size: 13px;
		margin-top: 4px;
	}

	/* 6 criteri: 3+3 (2 righe) su mobile */
	.brk-card-criteria {
		grid-template-columns: repeat(3, 1fr);
		gap: 10px 8px;
		padding: 12px;
		margin-bottom: 18px;
	}
	.brk-card-crit {
		padding: 6px 2px;
		cursor: default;
	}
	.brk-card-crit-label { font-size: 9.5px; }
	.brk-card-crit-val { font-size: 12px; }

	.brk-card-section-title {
		font-size: 15px;
		margin-bottom: 10px;
	}

	.brk-card-keyfeat {
		grid-template-columns: 1fr;
		gap: 8px;
		margin-bottom: 18px;
	}
	.brk-card-keyfeat-item {
		padding: 10px 12px;
		font-size: 12.5px;
		gap: 10px;
	}
	.brk-card-keyfeat-icon {
		width: 26px;
		height: 26px;
		font-size: 10px;
	}

	.brk-card-desc {
		font-size: 13.5px;
		line-height: 1.55;
		margin-bottom: 14px;
	}

	.brk-card-footer {
		padding-top: 12px;
		text-align: center;
	}
	.brk-card-cta-secondary {
		padding: 9px 14px;
		font-size: 13px;
	}
}
