/* ==========================================================================
   Laboratorio de Cuotas Final Four — CourtBet
   Todo el CSS está acotado bajo #ff-cuotas-lab.
   Ajusta el bloque de variables para adaptarlo a la plantilla.
   ========================================================================== */

#ff-cuotas-lab {
	--ffcl-ink: #10233d;
	--ffcl-text: #1d2733;
	--ffcl-muted: #5d6b7d;
	--ffcl-bg: #ffffff;
	--ffcl-surface: #f5f7fa;
	--ffcl-surface-2: #eceff4;
	--ffcl-border: #d6dce5;
	--ffcl-border-strong: #b7c1cf;
	--ffcl-accent: #e2622a;
	--ffcl-accent-dark: #bd4d1c;
	--ffcl-accent-soft: #fdf0e8;
	--ffcl-good: #1a7a55;
	--ffcl-good-soft: #e7f5ef;
	--ffcl-bad: #b02a20;
	--ffcl-bad-soft: #fbecea;
	--ffcl-warn: #8a6100;
	--ffcl-warn-soft: #fdf4e0;
	--ffcl-radius: 12px;
	--ffcl-radius-sm: 8px;
	--ffcl-gap: 16px;
	--ffcl-font: inherit;
	--ffcl-fs-base: 1rem;
	--ffcl-fs-sm: 0.875rem;
	--ffcl-fs-xs: 0.8125rem;
	--ffcl-shadow: 0 1px 2px rgba(16, 35, 61, 0.06), 0 8px 24px rgba(16, 35, 61, 0.06);

	box-sizing: border-box;
	display: block;
	margin: 2.5rem 0;
	padding: clamp(16px, 3vw, 28px);
	border: 1px solid var(--ffcl-border);
	border-radius: var(--ffcl-radius);
	background-color: var(--ffcl-bg);
	box-shadow: var(--ffcl-shadow);
	color: var(--ffcl-text);
	font-family: var(--ffcl-font);
	font-size: var(--ffcl-fs-base);
	line-height: 1.55;
	text-align: left;
}

#ff-cuotas-lab *,
#ff-cuotas-lab *::before,
#ff-cuotas-lab *::after {
	box-sizing: border-box;
}

#ff-cuotas-lab [hidden] {
	display: none;
}

/* ------------------------------ Cabecera ------------------------------ */

#ff-cuotas-lab .ffcl__head {
	margin: 0 0 1.25rem;
}

#ff-cuotas-lab .ffcl__eyebrow {
	margin: 0 0 0.35rem;
	color: var(--ffcl-accent-dark);
	font-size: var(--ffcl-fs-xs);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

#ff-cuotas-lab .ffcl__title {
	margin: 0 0 0.5rem;
	color: var(--ffcl-ink);
	font-size: clamp(1.25rem, 1rem + 1.2vw, 1.6rem);
	font-weight: 700;
	line-height: 1.25;
}

#ff-cuotas-lab .ffcl__lead {
	margin: 0;
	color: var(--ffcl-muted);
	font-size: var(--ffcl-fs-sm);
}

/* ------------------------------ Pestañas ------------------------------ */

#ff-cuotas-lab .ffcl__tablist-wrap {
	overflow-x: auto;
	margin: 0 0 1.25rem;
	border-bottom: 2px solid var(--ffcl-border);
	-webkit-overflow-scrolling: touch;
}

#ff-cuotas-lab .ffcl__tablist {
	display: flex;
	flex-wrap: nowrap;
	gap: 4px;
	min-width: max-content;
}

#ff-cuotas-lab .ffcl__tab {
	appearance: none;
	margin: 0 0 -2px;
	padding: 0.7rem 1rem;
	border: 0;
	border-bottom: 2px solid transparent;
	border-radius: 0;
	background: none;
	color: var(--ffcl-muted);
	cursor: pointer;
	font-family: inherit;
	font-size: var(--ffcl-fs-sm);
	font-weight: 600;
	line-height: 1.3;
	white-space: nowrap;
	transition: color 0.18s ease, border-color 0.18s ease;
}

#ff-cuotas-lab .ffcl__tab:hover {
	color: var(--ffcl-ink);
}

#ff-cuotas-lab .ffcl__tab[aria-selected="true"] {
	border-bottom-color: var(--ffcl-accent);
	color: var(--ffcl-ink);
}

#ff-cuotas-lab .ffcl__tab:focus-visible {
	outline: 2px solid var(--ffcl-accent);
	outline-offset: 2px;
}

/* ------------------------------ Paneles ------------------------------ */

#ff-cuotas-lab .ffcl__panel:focus-visible {
	outline: 2px solid var(--ffcl-accent);
	outline-offset: 4px;
}

#ff-cuotas-lab .ffcl__panel-title {
	margin: 0 0 0.35rem;
	color: var(--ffcl-ink);
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.3;
}

#ff-cuotas-lab .ffcl__panel-note {
	margin: 0 0 1.15rem;
	color: var(--ffcl-muted);
	font-size: var(--ffcl-fs-sm);
}

/* ------------------------------ Formulario ------------------------------ */

#ff-cuotas-lab .ffcl__grid {
	display: grid;
	gap: var(--ffcl-gap);
	margin: 0 0 1.25rem;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

#ff-cuotas-lab .ffcl__field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	min-width: 0;
	margin: 0;
}

#ff-cuotas-lab .ffcl__field--check {
	flex-direction: row;
	align-items: center;
	gap: 0.55rem;
	align-self: end;
	padding-bottom: 0.6rem;
}

#ff-cuotas-lab .ffcl__label {
	color: var(--ffcl-ink);
	font-size: var(--ffcl-fs-xs);
	font-weight: 600;
	line-height: 1.35;
}

#ff-cuotas-lab .ffcl__label--check {
	font-weight: 500;
	cursor: pointer;
}

#ff-cuotas-lab .ffcl__input {
	appearance: none;
	width: 100%;
	min-width: 0;
	padding: 0.6rem 0.7rem;
	border: 1px solid var(--ffcl-border-strong);
	border-radius: var(--ffcl-radius-sm);
	background-color: var(--ffcl-bg);
	color: var(--ffcl-text);
	font-family: inherit;
	font-size: 16px;
	font-variant-numeric: tabular-nums;
	line-height: 1.3;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

#ff-cuotas-lab .ffcl__input:hover {
	border-color: var(--ffcl-accent);
}

#ff-cuotas-lab .ffcl__input:focus {
	border-color: var(--ffcl-accent);
	box-shadow: 0 0 0 3px var(--ffcl-accent-soft);
	outline: none;
}

#ff-cuotas-lab .ffcl__input:focus-visible {
	outline: 2px solid var(--ffcl-accent);
	outline-offset: 1px;
}

#ff-cuotas-lab .ffcl__check {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin: 0;
	accent-color: var(--ffcl-accent);
	cursor: pointer;
}

#ff-cuotas-lab .ffcl__check:focus-visible {
	outline: 2px solid var(--ffcl-accent);
	outline-offset: 2px;
}

/* ------------------------------ Semifinales ------------------------------ */

#ff-cuotas-lab .ffcl__sf {
	margin: 0 0 1.25rem;
	padding: 1rem;
	border: 1px solid var(--ffcl-border);
	border-radius: var(--ffcl-radius-sm);
	background-color: var(--ffcl-surface);
}

#ff-cuotas-lab .ffcl__sf-title {
	margin: 0 0 0.85rem;
	color: var(--ffcl-ink);
	font-size: var(--ffcl-fs-sm);
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 1.3;
	text-transform: uppercase;
}

#ff-cuotas-lab .ffcl__team {
	display: grid;
	gap: var(--ffcl-gap);
	padding: 0.9rem 0;
	border-top: 1px dashed var(--ffcl-border-strong);
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
}

#ff-cuotas-lab .ffcl__team:first-of-type {
	padding-top: 0;
	border-top: 0;
}

#ff-cuotas-lab .ffcl__team:last-of-type {
	padding-bottom: 0;
}

/* ------------------------------ Resultados ------------------------------ */

#ff-cuotas-lab .ffcl__result {
	padding: 1.1rem;
	border: 1px solid var(--ffcl-border);
	border-radius: var(--ffcl-radius-sm);
	background-color: var(--ffcl-surface);
}

#ff-cuotas-lab .ffcl__probs {
	display: grid;
	gap: var(--ffcl-gap);
	margin: 0 0 1.1rem;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

#ff-cuotas-lab .ffcl__prob {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	min-width: 0;
	padding: 0.8rem;
	border: 1px solid var(--ffcl-border);
	border-radius: var(--ffcl-radius-sm);
	background-color: var(--ffcl-bg);
}

#ff-cuotas-lab .ffcl__prob-name {
	color: var(--ffcl-muted);
	font-size: var(--ffcl-fs-xs);
	font-weight: 600;
	overflow-wrap: break-word;
}

#ff-cuotas-lab .ffcl__prob-val {
	color: var(--ffcl-ink);
	font-size: 1.45rem;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	line-height: 1.1;
}

#ff-cuotas-lab .ffcl__bar {
	appearance: none;
	display: block;
	width: 100%;
	height: 8px;
	border: 0;
	border-radius: 999px;
	background-color: var(--ffcl-surface-2);
	color: var(--ffcl-accent);
}

#ff-cuotas-lab .ffcl__bar::-webkit-progress-bar {
	border-radius: 999px;
	background-color: var(--ffcl-surface-2);
}

#ff-cuotas-lab .ffcl__bar::-webkit-progress-value {
	border-radius: 999px;
	background-color: var(--ffcl-accent);
}

#ff-cuotas-lab .ffcl__bar::-moz-progress-bar {
	border-radius: 999px;
	background-color: var(--ffcl-accent);
}

#ff-cuotas-lab .ffcl__bar--alt {
	color: var(--ffcl-border-strong);
}

#ff-cuotas-lab .ffcl__bar--alt::-webkit-progress-value {
	background-color: var(--ffcl-border-strong);
}

#ff-cuotas-lab .ffcl__bar--alt::-moz-progress-bar {
	background-color: var(--ffcl-border-strong);
}

/* ------------------------------ Estadísticas ------------------------------ */

#ff-cuotas-lab .ffcl__stats {
	display: grid;
	gap: 10px;
	margin: 0 0 1.1rem;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
}

#ff-cuotas-lab .ffcl__stat {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	min-width: 0;
	padding: 0.7rem 0.8rem;
	border: 1px solid var(--ffcl-border);
	border-radius: var(--ffcl-radius-sm);
	background-color: var(--ffcl-bg);
}

#ff-cuotas-lab .ffcl__stat--wide {
	grid-column: 1 / -1;
}

#ff-cuotas-lab .ffcl__stat--hl {
	border-color: var(--ffcl-accent);
	background-color: var(--ffcl-accent-soft);
}

#ff-cuotas-lab .ffcl__stat dt {
	color: var(--ffcl-muted);
	font-size: var(--ffcl-fs-xs);
	font-weight: 600;
	line-height: 1.3;
}

#ff-cuotas-lab .ffcl__stat dd {
	margin: 0;
	color: var(--ffcl-ink);
	font-size: 1.1rem;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	line-height: 1.25;
	overflow-wrap: break-word;
}

/* ------------------------------ Tabla ------------------------------ */

#ff-cuotas-lab .ffcl__tablewrap {
	overflow-x: auto;
	margin: 0 0 1.1rem;
	border: 1px solid var(--ffcl-border);
	border-radius: var(--ffcl-radius-sm);
	background-color: var(--ffcl-bg);
	-webkit-overflow-scrolling: touch;
}

#ff-cuotas-lab .ffcl__table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--ffcl-fs-sm);
	font-variant-numeric: tabular-nums;
}

#ff-cuotas-lab .ffcl__caption {
	padding: 0.75rem 0.85rem;
	border-bottom: 1px solid var(--ffcl-border);
	color: var(--ffcl-muted);
	font-size: var(--ffcl-fs-xs);
	font-weight: 600;
	text-align: left;
}

#ff-cuotas-lab .ffcl__table th,
#ff-cuotas-lab .ffcl__table td {
	padding: 0.65rem 0.85rem;
	border-bottom: 1px solid var(--ffcl-border);
	color: var(--ffcl-text);
	text-align: right;
	white-space: nowrap;
}

#ff-cuotas-lab .ffcl__table thead th {
	background-color: var(--ffcl-surface-2);
	color: var(--ffcl-ink);
	font-size: var(--ffcl-fs-xs);
	font-weight: 700;
}

#ff-cuotas-lab .ffcl__table th:first-child,
#ff-cuotas-lab .ffcl__table td:first-child {
	text-align: left;
}

#ff-cuotas-lab .ffcl__table tbody th {
	color: var(--ffcl-ink);
	font-weight: 700;
}

#ff-cuotas-lab .ffcl__table tbody tr:last-child th,
#ff-cuotas-lab .ffcl__table tbody tr:last-child td {
	border-bottom: 0;
}

#ff-cuotas-lab .ffcl__table tbody tr.is-good {
	background-color: var(--ffcl-good-soft);
}

#ff-cuotas-lab .ffcl__table tbody tr.is-bad {
	background-color: var(--ffcl-bad-soft);
}

#ff-cuotas-lab .ffcl__cell-prob {
	min-width: 120px;
}

#ff-cuotas-lab .ffcl__cell-prob .ffcl__bar {
	margin-top: 0.3rem;
	height: 6px;
}

/* ------------------------------ Veredicto ------------------------------ */

#ff-cuotas-lab .ffcl__verdict {
	margin: 0;
	padding: 0.85rem 1rem;
	border: 1px solid var(--ffcl-border);
	border-left: 4px solid var(--ffcl-border-strong);
	border-radius: var(--ffcl-radius-sm);
	background-color: var(--ffcl-bg);
	color: var(--ffcl-text);
	font-size: var(--ffcl-fs-sm);
}

#ff-cuotas-lab .ffcl__verdict.is-good {
	border-left-color: var(--ffcl-good);
	background-color: var(--ffcl-good-soft);
	color: var(--ffcl-good);
}

#ff-cuotas-lab .ffcl__verdict.is-warn {
	border-left-color: var(--ffcl-warn);
	background-color: var(--ffcl-warn-soft);
	color: var(--ffcl-warn);
}

#ff-cuotas-lab .ffcl__verdict.is-bad {
	border-left-color: var(--ffcl-bad);
	background-color: var(--ffcl-bad-soft);
	color: var(--ffcl-bad);
}

/* ------------------------------ Pie ------------------------------ */

#ff-cuotas-lab .ffcl__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: var(--ffcl-gap);
	margin: 1.25rem 0 0;
	padding-top: 1.1rem;
	border-top: 1px solid var(--ffcl-border);
}

#ff-cuotas-lab .ffcl__reset {
	appearance: none;
	flex: 0 0 auto;
	padding: 0.6rem 1.1rem;
	border: 1px solid var(--ffcl-border-strong);
	border-radius: var(--ffcl-radius-sm);
	background-color: var(--ffcl-bg);
	color: var(--ffcl-ink);
	cursor: pointer;
	font-family: inherit;
	font-size: var(--ffcl-fs-sm);
	font-weight: 600;
	line-height: 1.3;
	transition: background-color 0.18s ease, border-color 0.18s ease;
}

#ff-cuotas-lab .ffcl__reset:hover {
	border-color: var(--ffcl-accent);
	background-color: var(--ffcl-accent-soft);
}

#ff-cuotas-lab .ffcl__reset:focus-visible {
	outline: 2px solid var(--ffcl-accent);
	outline-offset: 2px;
}

#ff-cuotas-lab .ffcl__disclaimer {
	flex: 1 1 260px;
	min-width: 0;
	margin: 0;
	color: var(--ffcl-muted);
	font-size: var(--ffcl-fs-xs);
	line-height: 1.5;
}

#ff-cuotas-lab .ffcl__link {
	color: var(--ffcl-accent-dark);
	text-decoration: underline;
}

#ff-cuotas-lab .ffcl__link:focus-visible {
	outline: 2px solid var(--ffcl-accent);
	outline-offset: 2px;
}

/* ------------------------------ Preferencias ------------------------------ */

@media (prefers-reduced-motion: reduce) {
	#ff-cuotas-lab .ffcl__tab,
	#ff-cuotas-lab .ffcl__input,
	#ff-cuotas-lab .ffcl__reset {
		transition: none;
	}
}
