/**
 * Calculateur de résistances — styles.
 * Themes can override the custom properties below on .rescalc.
 *
 * @package CalculateurResistances
 * @license GPL-2.0-or-later
 */

.rescalc {
	--rescalc-bg: #fff;
	--rescalc-text: #1e293b;
	--rescalc-muted: #475569;
	--rescalc-border: #dce3ea;
	--rescalc-input-border: #94a3b8;
	--rescalc-accent: #2563eb;
	--rescalc-result-bg: #eff6ff;
	--rescalc-body: #d8ad77;
	--rescalc-lead: #9aa3ad;
	--rescalc-radius: 14px;

	box-sizing: border-box;
	max-width: 760px;
	margin: 1.5em auto;
	padding: 26px;
	border: 1px solid var(--rescalc-border);
	border-radius: var(--rescalc-radius);
	background: var(--rescalc-bg);
	color: var(--rescalc-text);
	box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}

.rescalc *,
.rescalc *::before,
.rescalc *::after {
	box-sizing: inherit;
}

/* The theme's display rules must not override the hidden attribute. */
.rescalc [hidden] {
	display: none !important;
}

.rescalc .rescalc__title {
	margin: 0 0 8px;
	font-size: 1.45rem;
	line-height: 1.3;
}

.rescalc .rescalc__intro {
	margin: 0 0 22px;
	color: var(--rescalc-muted);
}

.rescalc__field {
	display: grid;
	gap: 6px;
	align-content: start;
}

.rescalc__count {
	max-width: 220px;
	margin-bottom: 6px;
}

.rescalc__bands {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

.rescalc label {
	font-weight: 600;
	font-size: 0.92rem;
}

.rescalc select {
	width: 100%;
	max-width: none;
	min-height: 42px;
	padding: 8px 10px;
	border: 1px solid var(--rescalc-input-border);
	border-radius: 7px;
	background-color: var(--rescalc-bg);
	color: inherit;
	font: inherit;
}

.rescalc select:focus-visible {
	outline: 2px solid var(--rescalc-accent);
	outline-offset: 2px;
}

/* Resistor preview. */
.rescalc__resistor {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 24px 0;
}

.rescalc__lead {
	flex: 0 1 70px;
	height: 4px;
	border-radius: 2px;
	background: var(--rescalc-lead);
}

.rescalc__body {
	display: flex;
	align-items: stretch;
	gap: 12px;
	height: 64px;
	padding: 0 28px;
	border-radius: 32px;
	background: var(--rescalc-body);
	box-shadow: inset 0 -8px 12px rgba(0, 0, 0, 0.12), inset 0 6px 10px rgba(255, 255, 255, 0.25);
}

.rescalc__band {
	display: block;
	width: 12px;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

/* Visual gap before the tolerance band, as on real parts. */
.rescalc__band--tolerance {
	width: 16px;
	margin-left: 18px;
}

.rescalc__band.is-empty {
	background: transparent;
	box-shadow: none;
}

/* Result. */
.rescalc__result {
	padding: 17px;
	border-radius: 8px;
	background: var(--rescalc-result-bg);
	font-size: 1.1rem;
}

.rescalc__value {
	font-weight: 700;
}

.rescalc__details {
	display: block;
	margin-top: 6px;
	color: var(--rescalc-muted);
	font-size: 0.85rem;
}

.rescalc__details span {
	display: block;
}

.rescalc__noscript {
	margin: 12px 0 0;
	font-weight: 600;
}

@media (max-width: 560px) {
	.rescalc {
		padding: 18px;
	}

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

	.rescalc__body {
		gap: 8px;
		padding: 0 18px;
	}

	.rescalc__band {
		width: 9px;
	}

	.rescalc__band--tolerance {
		width: 12px;
		margin-left: 10px;
	}

	.rescalc__lead {
		flex-basis: 30px;
	}
}
