/* Midtex Fuel Tank Calculator. Colors, fonts and sizes come from Fuel Calculator > Settings > Design. */

.mfc-calc, .mfc-calc *, .mfc-dialog * { box-sizing: border-box; }

.mfc-calc {
	container-type: inline-size;
	font-size: 16px;
	font-family: var(--mfc-body-font, "DM Sans", Arial, sans-serif);
	color: var(--mfc-text, #2D2D2D);
	line-height: 1.55;
	max-width: var(--mfc-max-width, 1140px);
	margin: 0 auto;
	background: transparent;
}
.mfc-calc [hidden] { display: none !important; }
/* Guard against themes/page builders that inject <br> and empty <p> tags or restyle form elements. */
.mfc-calc br { display: none !important; }
.mfc-calc p:empty { display: none !important; }
.mfc-calc .mfc-grid > p, .mfc-calc .mfc-card > p:empty { display: none !important; }
.mfc-calc, .mfc-calc .mfc-grid { border: 0; outline: 0; box-shadow: none; }
.mfc-calc label, .mfc-calc legend, .mfc-calc fieldset { float: none; width: auto; text-transform: none; }

/* Shield the calculator from theme typography; specific rules below override this. */
.mfc-calc :where(p, span, label, legend, a, button, input, strong) { font-size: inherit; line-height: inherit; letter-spacing: normal; }
.mfc-calc :where(p) { margin: 0 0 1em; }

.mfc-calc .mfc-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 24px; align-items: stretch; }
@media (max-width: 860px) { .mfc-calc .mfc-grid { grid-template-columns: 1fr; } }
@container (max-width: 780px) { .mfc-calc .mfc-grid { grid-template-columns: 1fr; } }

/* ---------- Form card ---------- */
.mfc-calc .mfc-card {
	background: var(--mfc-card, #F0F0F0);
	border-radius: var(--mfc-radius, 12px);
	padding: clamp(22px, 3.5vw, 36px);
	margin: 0;
}
.mfc-calc .mfc-step {
	display: flex; align-items: center; gap: 12px;
	font-family: var(--mfc-heading-font, "Oswald", "Arial Narrow", sans-serif);
	font-weight: 500; font-size: 1.4rem; line-height: 1.2;
	text-transform: uppercase; letter-spacing: 0.02em;
	color: var(--mfc-text, #2D2D2D);
	margin: 0 0 18px;
}
.mfc-calc .mfc-step-num {
	display: inline-grid; place-items: center; flex-shrink: 0;
	width: 34px; height: 34px; border-radius: 6px;
	background: var(--mfc-primary, #EB4229); color: #fff;
	font-size: 1.1rem; font-weight: 700;
}
.mfc-calc .mfc-divider { border: 0; border-top: 1px solid var(--mfc-border, #CFCFCF); margin: 26px 0; }

.mfc-calc .mfc-field { margin: 0 0 18px; border: 0; padding: 0; min-width: 0; }
.mfc-calc .mfc-field > label, .mfc-calc .mfc-field > legend { display: block; font-weight: 700; margin: 0 0 6px; padding: 0; color: var(--mfc-text, #2D2D2D); font-size: 1rem; }
.mfc-calc .mfc-req { color: var(--mfc-primary, #EB4229); font-weight: 500; font-size: 0.85em; }
.mfc-calc .mfc-optional { color: var(--mfc-muted, #6B6B6B); font-weight: 400; font-size: 0.85em; }
.mfc-calc .mfc-hint { display: block; font-size: 0.875rem; color: var(--mfc-muted, #6B6B6B); margin-top: 6px; }

.mfc-calc input[type="number"], .mfc-calc input[type="email"], .mfc-calc input[type="text"], .mfc-calc input[type="tel"] {
	width: 100%; margin: 0;
	font: inherit; font-size: 1.05rem; color: var(--mfc-text, #2D2D2D);
	background: #fff; border: 1px solid var(--mfc-border, #CFCFCF); border-radius: 4px;
	padding: 12px 14px; min-height: 50px; box-shadow: none;
}
.mfc-calc input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.mfc-calc input[type="number"]::-webkit-outer-spin-button, .mfc-calc input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.mfc-calc .mfc-input-wrap { position: relative; }
.mfc-calc .mfc-input-wrap input { padding-right: 90px !important; font-family: var(--mfc-heading-font, "Oswald", sans-serif) !important; font-size: 1.35rem !important; font-weight: 500; }
.mfc-calc .mfc-unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--mfc-muted, #6B6B6B); pointer-events: none; }

.mfc-calc input:focus-visible, .mfc-calc button:focus-visible, .mfc-calc a:focus-visible, .mfc-dialog button:focus-visible, .mfc-open-button:focus-visible { outline: 3px solid var(--mfc-primary, #EB4229); outline-offset: 2px; }
.mfc-calc input[aria-invalid="true"] { border-color: var(--mfc-primary, #EB4229); box-shadow: inset 0 0 0 1px var(--mfc-primary, #EB4229); }
.mfc-calc .mfc-error { color: var(--mfc-primary-dark, #C7331D); font-size: 0.875rem; font-weight: 500; margin-top: 6px; }
.mfc-calc .mfc-error:empty { display: none; }

.mfc-calc .mfc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .mfc-calc .mfc-row { grid-template-columns: 1fr; } }
@container (max-width: 480px) { .mfc-calc .mfc-row { grid-template-columns: 1fr; } }

/* Day picker */
.mfc-calc .mfc-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.mfc-calc .mfc-days input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.mfc-calc .mfc-days label {
	display: grid; place-items: center; margin: 0; min-height: 50px;
	font-family: var(--mfc-heading-font, "Oswald", sans-serif); font-weight: 500; font-size: 1.35rem;
	background: #fff; color: var(--mfc-text, #2D2D2D);
	border: 1px solid var(--mfc-border, #CFCFCF); border-radius: 6px; cursor: pointer;
}
.mfc-calc .mfc-days label:hover { border-color: var(--mfc-selected, #2D2D2D); }
.mfc-calc .mfc-days input:checked + label { background: var(--mfc-selected, #2D2D2D); border-color: var(--mfc-selected, #2D2D2D); color: #fff; }
.mfc-calc .mfc-days input:focus-visible + label { outline: 3px solid var(--mfc-primary, #EB4229); outline-offset: 2px; }

.mfc-calc .mfc-weekly {
	display: flex; justify-content: space-between; align-items: center; gap: 12px;
	background: #fff; border-left: 4px solid var(--mfc-primary, #EB4229); border-radius: 4px;
	padding: 12px 16px;
}
.mfc-calc .mfc-weekly > span { font-weight: 500; }
.mfc-calc .mfc-math { display: block; font-weight: 400; font-size: 0.85rem; color: var(--mfc-muted, #6B6B6B); }
.mfc-calc .mfc-weekly strong { font-family: var(--mfc-heading-font, "Oswald", sans-serif); font-weight: 700; font-size: 1.8rem; line-height: 1; white-space: nowrap; }

/* Consent */
.mfc-calc .mfc-consent { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.mfc-calc .mfc-consent input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--mfc-primary, #EB4229); }
.mfc-calc .mfc-consent label { font-weight: 400 !important; font-size: 0.925rem; margin: 0 !important; }
.mfc-calc .mfc-consent .mfc-error { grid-column: 1 / -1; }

/* Honeypot */
.mfc-calc .mfc-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.mfc-calc .mfc-button, .mfc-open-button {
	display: inline-flex; align-items: center; justify-content: center;
	font-family: var(--mfc-body-font, "DM Sans", Arial, sans-serif); font-weight: 700; font-size: 1.1rem; line-height: 1.2;
	color: #fff; background: var(--mfc-primary, #EB4229);
	border: 0; border-radius: var(--mfc-button-radius, 8px); padding: 14px 24px; min-height: 56px; cursor: pointer;
	text-decoration: none; transition: background-color 150ms ease;
}
.mfc-calc .mfc-button { width: 100%; }
.mfc-calc .mfc-button:hover, .mfc-open-button:hover { background: var(--mfc-primary-dark, #C7331D); color: #fff; }
.mfc-calc .mfc-button[disabled] { opacity: 0.6; cursor: wait; }

.mfc-calc .mfc-privacy { font-size: 0.85rem; color: var(--mfc-muted, #6B6B6B); margin: 12px 0 0; }
.mfc-calc .mfc-privacy a { color: var(--mfc-primary-dark, #C7331D); text-decoration: underline; }
.mfc-calc .mfc-status { margin: 14px 0 0; font-weight: 700; color: var(--mfc-text, #2D2D2D); }
.mfc-calc .mfc-status.is-error { color: var(--mfc-primary-dark, #C7331D); }

/* ---------- Result panel ---------- */
.mfc-calc .mfc-result {
	background: var(--mfc-panel, #262626); color: var(--mfc-panel-text, #fff);
	border-radius: var(--mfc-radius, 12px); border-bottom: 4px solid var(--mfc-primary, #EB4229);
	padding: clamp(24px, 3.5vw, 36px);
	display: flex; flex-direction: column; justify-content: center; text-align: center;
}
.mfc-calc .mfc-tank-svg { width: 100%; max-width: 360px; height: auto; margin: 0 auto 24px; display: block; overflow: visible; }
.mfc-calc .mfc-tank-stand { fill: var(--mfc-tank-stand, #4A4A4A); }
.mfc-calc .mfc-tank-empty { fill: var(--mfc-tank-empty, #141414); }
.mfc-calc .mfc-tank-lines line { stroke: rgba(255,255,255,0.18); stroke-width: 1.5; }
.mfc-calc .mfc-tank-shell { fill: none; stroke: var(--mfc-tank-outline, #fff); stroke-width: 5; }
.mfc-calc .mfc-tank-band { stroke: var(--mfc-tank-outline, #fff); stroke-opacity: 0.35; stroke-width: 3; }
.mfc-calc .mfc-tank-cap { fill: var(--mfc-tank-outline, #fff); }

.mfc-calc .mfc-placeholder { font-size: 1rem; opacity: 0.75; max-width: 30ch; margin: 0 auto; }
.mfc-calc .mfc-result-label {
	font-family: var(--mfc-heading-font, "Oswald", sans-serif); font-weight: 300; text-transform: uppercase;
	letter-spacing: 0.2em; font-size: 1.05rem; opacity: 0.85; margin: 0;
}
.mfc-calc .mfc-result-size {
	font-family: var(--mfc-heading-font, "Oswald", sans-serif); font-weight: 700; text-transform: uppercase;
	font-size: clamp(3.2rem, 9vw, 4.6rem); line-height: 1; margin: 6px 0 4px; color: var(--mfc-panel-text, #fff);
}
.mfc-calc .mfc-result-unit {
	font-family: var(--mfc-heading-font, "Oswald", sans-serif); font-style: italic; font-weight: 700; text-transform: uppercase;
	color: var(--mfc-primary, #EB4229); font-size: 1.4rem; margin: 0 0 14px;
}
.mfc-calc .mfc-result-detail { font-size: 1rem; opacity: 0.85; max-width: 36ch; margin: 0 auto; }
.mfc-calc .mfc-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 24px; }
.mfc-calc .mfc-locked-btn {
	display: inline-block; font-family: var(--mfc-body-font, "DM Sans", Arial, sans-serif); font-weight: 700; font-size: 1.05rem;
	color: #fff; background: var(--mfc-primary, #EB4229); border: 0; border-radius: var(--mfc-button-radius, 8px);
	padding: 13px 26px; cursor: pointer;
}
.mfc-calc .mfc-locked-btn:hover { background: var(--mfc-primary-dark, #C7331D); }
.mfc-calc [data-mfc="output"] { animation: mfc-reveal 500ms ease both; }
@keyframes mfc-reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .mfc-calc [data-mfc="output"] { animation: none; } }
.mfc-calc .mfc-link-btn { background: none; border: 0; font: inherit; color: inherit; opacity: 0.8; text-decoration: underline; cursor: pointer; padding: 4px; }
.mfc-calc .mfc-link-btn:hover { opacity: 1; background: none; }

/* Liquid fill */
.mfc-calc .mfc-tank-level { transition: transform 1400ms cubic-bezier(.3,.7,.2,1); }
.mfc-calc .mfc-wave path { fill: var(--mfc-primary, #EB4229); }
.mfc-calc .mfc-wave-back path { opacity: 0.45; }
.mfc-calc .mfc-wave-back { transform: translateX(-45px); }
.mfc-calc .mfc-tank-shine { fill: #fff; opacity: 0.08; }
.mfc-calc .mfc-bubbles circle { fill: #fff; opacity: 0; }
.mfc-calc .has-liquid .mfc-wave-front { animation: mfc-wave 2.6s linear infinite; }
.mfc-calc .has-liquid .mfc-wave-back { animation: mfc-wave-back 3.8s linear infinite; }
.mfc-calc .has-liquid.is-filled .mfc-bubbles circle { animation: mfc-bubble 3.2s ease-in infinite; }
.mfc-calc .has-liquid.is-filled .mfc-bubbles circle:nth-child(2) { animation-delay: 0.8s; animation-duration: 2.7s; }
.mfc-calc .has-liquid.is-filled .mfc-bubbles circle:nth-child(3) { animation-delay: 1.6s; animation-duration: 3.6s; }
.mfc-calc .has-liquid.is-filled .mfc-bubbles circle:nth-child(4) { animation-delay: 0.4s; animation-duration: 3s; }
.mfc-calc .has-liquid.is-filled .mfc-bubbles circle:nth-child(5) { animation-delay: 2.2s; animation-duration: 2.9s; }
@keyframes mfc-wave { from { transform: translateX(0); } to { transform: translateX(-90px); } }
@keyframes mfc-wave-back { from { transform: translateX(-90px); } to { transform: translateX(0); } }
@keyframes mfc-bubble {
	0% { transform: translateY(0); opacity: 0; }
	15% { opacity: 0.45; }
	80% { opacity: 0.3; }
	100% { transform: translateY(-58px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.mfc-calc .mfc-tank-level { transition: none; }
	.mfc-calc .has-liquid .mfc-wave-front, .mfc-calc .has-liquid .mfc-wave-back, .mfc-calc .has-liquid.is-filled .mfc-bubbles circle { animation: none; }
}

/* Blurred size until the email is submitted */
.mfc-calc .mfc-result-size { transition: filter 700ms ease, opacity 700ms ease; }
.mfc-calc .mfc-result-size.is-blurred { filter: blur(14px); opacity: 0.9; user-select: none; pointer-events: none; }
.mfc-calc .mfc-result-detail { margin-bottom: 0; }
.mfc-calc .mfc-locked-btn { margin-top: 22px; }

/* ---------- Pop-up mode ---------- */
.mfc-dialog { border: 0; padding: 0; background: transparent; width: min(1180px, 96vw); max-width: none; max-height: 92vh; overflow: visible; }
.mfc-dialog::backdrop { background: rgba(0, 0, 0, 0.75); }
.mfc-dialog .mfc-calc { max-height: 92vh; overflow-y: auto; }
.mfc-dialog .mfc-close {
	position: absolute; top: -14px; right: -6px; z-index: 2; width: 42px; height: 42px; border-radius: 50%;
	border: 0; background: var(--mfc-primary, #EB4229); color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer;
}
