.caf-calculator,
.caf-calculator * {
	box-sizing: border-box;
}

.caf-calculator {
	width: 100%;
	max-width: 980px;
	margin: 30px auto;
	overflow: hidden;
	color: #1d2939;
	background: #ffffff;
	border: 1px solid #d9e2ea;
	border-radius: 18px;
	box-shadow: 0 12px 40px rgba(16, 24, 40, 0.10);
	font-family: Arial, Helvetica, sans-serif;
}

.caf-calculator [hidden] {
	display: none !important;
}

.caf-header {
	padding: 32px;
	color: #ffffff;
	background: linear-gradient(135deg, #164e72, #176b9c);
}

.caf-header h2 {
	margin: 0 0 10px;
	color: #ffffff;
	font-size: clamp(25px, 4vw, 31px);
	line-height: 1.2;
}

.caf-header p {
	max-width: 760px;
	margin: 0;
	font-size: 16px;
	line-height: 1.6;
}

.caf-form {
	padding: 32px;
}

.caf-field {
	display: block;
	margin: 0;
}

.caf-field > span:first-child,
.caf-field > label,
.caf-unit-field label {
	display: block;
	margin-bottom: 8px;
	color: #344054;
	font-size: 15px;
	font-weight: 700;
}

.caf-unit-field {
	max-width: 420px;
}

.caf-unit-field select {
	display: block;
	width: 100%;
	height: 50px;
	margin-top: 8px;
	padding: 0 14px;
	color: #1d2939;
	background: #ffffff;
	border: 1px solid #b8c3ce;
	border-radius: 9px;
	font-size: 16px;
}

.caf-selector {
	display: grid;
	grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
	gap: 24px;
	margin-top: 30px;
	padding: 22px;
	background: #f6fbff;
	border: 1px solid #d6e7f1;
	border-radius: 16px;
}

.caf-selector-copy h3 {
	margin: 0 0 10px;
	color: #164e72;
	font-size: 22px;
}

.caf-selector-copy p {
	margin: 0;
	color: #526071;
	line-height: 1.6;
}

.caf-selector-visual {
	display: grid;
	gap: 18px;
}

.caf-car-diagram {
	position: relative;
	width: min(100%, 330px);
	margin: 0 auto;
	padding: 12px;
	background: #ffffff;
	border: 1px solid #d7e4ec;
	border-radius: 18px;
	box-shadow: inset 0 0 0 1px #edf3f7;
}

.caf-car-image {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 12px;
}

.caf-axle-hotspot {
	position: absolute;
	left: 50%;
	width: 68%;
	padding: 9px 12px;
	transform: translate(-50%, -50%);
	color: #164e72;
	background: rgba(255, 255, 255, 0.86);
	border: 2px solid #176b9c;
	border-radius: 999px;
	backdrop-filter: blur(3px);
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.15s ease;
}

.caf-axle-hotspot:hover,
.caf-axle-hotspot:focus,
.caf-axle-hotspot.is-active {
	color: #ffffff;
	background: #176b9c;
	box-shadow: 0 6px 18px rgba(23, 107, 156, 0.22);
}

.caf-axle-hotspot[data-caf-target="front"] {
	top: 21%;
}

.caf-axle-hotspot[data-caf-target="rear"] {
	top: 79.5%;
}

.caf-panel-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
}

.caf-nav-button {
	padding: 10px 14px;
	color: #164e72;
	background: #ffffff;
	border: 1px solid #bfd4e1;
	border-radius: 999px;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.15s ease;
}

.caf-nav-button:hover,
.caf-nav-button:focus,
.caf-nav-button.is-active {
	color: #ffffff;
	background: #176b9c;
	border-color: #176b9c;
}

.caf-section {
	margin-top: 28px;
}

.caf-panel {
	padding: 22px;
	background: #ffffff;
	border: 1px solid #e3ebf1;
	border-radius: 16px;
}

.caf-panel.is-active {
	box-shadow: 0 0 0 3px rgba(23, 107, 156, 0.08);
}

.caf-panel-header h3 {
	margin: 0 0 10px;
	color: #164e72;
	font-size: 21px;
}

.caf-panel-header p {
	margin: 0 0 18px;
	color: #667085;
	line-height: 1.55;
}

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

.caf-input-group {
	display: flex;
	width: 100%;
}

.caf-input-group input {
	width: 100%;
	min-width: 0;
	height: 52px;
	margin: 0;
	padding: 10px 14px;
	color: #101828;
	background: #ffffff;
	border: 1px solid #b8c3ce;
	border-right: 0;
	border-radius: 9px 0 0 9px;
	outline: none;
	font-family: inherit;
	font-size: 17px;
	line-height: 1.2;
}

.caf-input-group input:focus,
.caf-unit-field select:focus {
	border-color: #176b9c;
	box-shadow: 0 0 0 3px rgba(23, 107, 156, 0.13);
}

.caf-input-group input.caf-invalid {
	border-color: #c62828;
	background: #fff7f7;
}

.caf-input-group em {
	display: flex;
	min-width: 62px;
	align-items: center;
	justify-content: center;
	padding: 0 10px;
	color: #344054;
	background: #eef3f6;
	border: 1px solid #b8c3ce;
	border-radius: 0 9px 9px 0;
	font-style: normal;
	font-weight: 700;
}

.caf-mass-field {
	max-width: 430px;
}

.caf-error {
	margin-top: 26px;
	padding: 14px 16px;
	color: #912018;
	background: #fef3f2;
	border: 1px solid #fecdca;
	border-radius: 9px;
	line-height: 1.5;
}

.caf-actions {
	display: flex;
	gap: 13px;
	margin-top: 32px;
}

.caf-button {
	min-height: 52px;
	padding: 12px 24px;
	cursor: pointer;
	border-radius: 9px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.caf-button:active {
	transform: translateY(1px);
}

.caf-button-primary {
	color: #ffffff;
	background: #176b9c;
	border: 2px solid #176b9c;
}

.caf-button-primary:hover,
.caf-button-primary:focus {
	color: #ffffff;
	background: #10587f;
	border-color: #10587f;
}

.caf-button-secondary {
	color: #344054;
	background: #ffffff;
	border: 2px solid #b8c3ce;
}

.caf-button-secondary:hover,
.caf-button-secondary:focus {
	color: #1d2939;
	background: #f5f7f9;
}

.caf-results {
	padding: 32px;
	background: #f5f8fa;
	border-top: 1px solid #dbe4eb;
}

.caf-results-heading {
	margin-bottom: 24px;
	text-align: center;
}

.caf-results-heading h3 {
	margin: 0 0 8px;
	color: #164e72;
	font-size: 25px;
}

.caf-results-heading p {
	max-width: 720px;
	margin: auto;
	color: #667085;
	line-height: 1.5;
}

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

.caf-result-card {
	padding: 24px;
	text-align: center;
	background: #ffffff;
	border: 1px solid #d8e2e9;
	border-radius: 13px;
	box-shadow: 0 4px 14px rgba(16, 24, 40, 0.04);
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.caf-result-title {
	display: block;
	min-height: 42px;
	margin-bottom: 9px;
	color: #475467;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.35;
}

.caf-result-card strong {
	display: block;
	margin: 3px 0 10px;
	color: #176b9c;
	font-size: clamp(33px, 6vw, 40px);
	line-height: 1.1;
}

.caf-result-card small {
	display: block;
	min-height: 18px;
	color: #667085;
	font-size: 13px;
	line-height: 1.4;
}

.caf-total-card {
	background: #edf6fc;
	border-color: #c4ddec;
}

.caf-total-card strong {
	color: #155b89;
}

.caf-status-label {
	display: table;
	margin: 2px auto 14px;
	padding: 8px 13px;
	border-radius: 7px;
	font-size: 14px;
	font-weight: 800;
	line-height: 1.2;
}

.caf-status-card.caf-status-ok {
	background: #edf8f3;
	border-color: #9fcdb4;
}

.caf-status-card.caf-status-ok strong {
	color: #16834f;
}

.caf-status-card.caf-status-warning {
	background: #fff8d9;
	border-color: #e3bd3c;
}

.caf-status-card.caf-status-warning strong {
	color: #9a6500;
}

.caf-status-card.caf-status-warning .caf-status-label {
	color: #6f4800;
	background: #ffe58a;
	border: 1px solid #dbad22;
}

.caf-status-card.caf-status-danger {
	background: #fff0f0;
	border-color: #df7777;
}

.caf-status-card.caf-status-danger strong {
	color: #c62828;
}

.caf-status-card.caf-status-danger .caf-status-label {
	color: #ffffff;
	background: #c62828;
	border: 1px solid #a91f1f;
}

.caf-status-card.caf-status-critical {
	background: #ffe5e5;
	border: 3px solid #b00000;
}

.caf-status-card.caf-status-critical strong {
	color: #a00000;
}

.caf-status-card.caf-status-critical .caf-status-label {
	color: #ffffff;
	background: #a00000;
	border: 1px solid #760000;
	font-size: 15px;
}

.caf-summary {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	max-width: 780px;
	margin: 25px auto 0;
	overflow: hidden;
	background: #ffffff;
	border: 1px solid #d8e2e9;
	border-radius: 11px;
}

.caf-summary div {
	padding: 16px;
	border-bottom: 1px solid #e7edf1;
}

.caf-summary div:nth-child(odd) {
	border-right: 1px solid #e7edf1;
}

.caf-summary span {
	display: block;
	margin-bottom: 5px;
	color: #667085;
	font-size: 13px;
}

.caf-summary b {
	color: #1d2939;
	font-size: 17px;
}

.caf-formulas {
	max-width: 780px;
	margin: 22px auto 0;
	padding: 15px 18px;
	color: #475467;
	background: #ffffff;
	border: 1px solid #d8e2e9;
	border-radius: 10px;
	font-size: 14px;
	line-height: 1.6;
}

.caf-formulas p {
	margin: 4px 0;
}

@media (max-width: 850px) {
	.caf-selector {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 700px) {
	.caf-header,
	.caf-form,
	.caf-results {
		padding: 24px 20px;
	}

	.caf-grid,
	.caf-result-grid,
	.caf-summary {
		grid-template-columns: 1fr;
	}

	.caf-summary div:nth-child(odd) {
		border-right: 0;
	}

	.caf-actions {
		flex-direction: column;
	}

	.caf-button {
		width: 100%;
	}

	.caf-car-diagram {
		width: 100%;
	}
}

/* Datos de masa y ocupantes */
.caf-select {
	display: block;
	width: 100%;
	height: 52px;
	margin: 0;
	padding: 0 14px;
	color: #1d2939;
	background: #ffffff;
	border: 1px solid #b8c3ce;
	border-radius: 9px;
	font-family: inherit;
	font-size: 16px;
}

.caf-select:focus {
	border-color: #176b9c;
	outline: none;
	box-shadow: 0 0 0 3px rgba(23, 107, 156, 0.13);
}

.caf-vehicle-grid {
	align-items: end;
}

.caf-vehicle-grid .caf-input-group em {
	min-width: 78px;
	white-space: nowrap;
}

.caf-occupant-note {
	margin-top: 20px;
	padding: 17px 18px;
	color: #5f4700;
	background: #fff8d9;
	border: 1px solid #e4c768;
	border-left: 5px solid #d5a900;
	border-radius: 10px;
	line-height: 1.55;
}

.caf-occupant-note strong {
	display: block;
	margin-bottom: 6px;
	color: #6f4f00;
	font-size: 16px;
}

.caf-occupant-note ul {
	margin: 6px 0 8px 20px;
	padding: 0;
}

.caf-occupant-note li {
	margin: 5px 0;
}

.caf-occupant-note p {
	margin: 8px 0 0;
	font-weight: 700;
}
