/* elev8 savings calculator. Everything is scoped to .e8c so theme (Impreza) styles don't leak in or out. */

.e8c {
	--e8c-black: #000000;
	--e8c-cream: #F4F3EF;
	--e8c-paper: #FFFFFF;
	--e8c-yellow: #F6BB11;
	--e8c-yellow-hover: #E4AA04;
	--e8c-yellow-wash: #FDF3D3;
	--e8c-navy: #35415B;
	--e8c-slate: #727F9F;
	--e8c-line: #DEDCD3;
	--e8c-line-paper: #ECEAE4;
	--e8c-field: #FFFFFF;
	--e8c-red: #B93A26;
	--e8c-sticky-top: 110px;

	font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 15px;
	line-height: 1.55;
	color: var(--e8c-black);
	background: var(--e8c-cream);
	-webkit-font-smoothing: antialiased;
	font-feature-settings: "cv11", "ss01";
}

/* ---------- reset against theme styles ---------- */
.e8c *, .e8c *::before, .e8c *::after { box-sizing: border-box; }
.e8c h1, .e8c h2, .e8c h3, .e8c p, .e8c ul, .e8c ol, .e8c li, .e8c form,
.e8c table, .e8c tbody, .e8c tr, .e8c td, .e8c fieldset, .e8c legend, .e8c label {
	margin: 0; padding: 0; border: 0; background: none;
	font: inherit; color: inherit; letter-spacing: inherit; text-transform: none;
}
.e8c ul, .e8c ol { list-style: none; }
.e8c button {
	margin: 0; padding: 0; border: 0; background: none; border-radius: 0;
	font: inherit; color: inherit; line-height: 1.2; letter-spacing: 0; text-transform: none;
	min-height: 0; height: auto; box-shadow: none; cursor: pointer;
	-webkit-appearance: none; appearance: none;
}
.e8c input:not([type=checkbox]):not([type=radio]), .e8c select {
	margin: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
	font: inherit; color: inherit; line-height: 1.3; letter-spacing: 0;
	height: auto; min-height: 0; width: 100%; padding: 0;
	-webkit-appearance: none; appearance: none;
}
.e8c input[type=number]::-webkit-inner-spin-button,
.e8c input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.e8c input[type=number] { -moz-appearance: textfield; }
.e8c a { color: inherit; }
.e8c :focus-visible { outline: 2px solid var(--e8c-navy); outline-offset: 2px; }
.e8c [hidden] { display: none !important; }
.e8c .e8c-num { font-variant-numeric: tabular-nums; }

/* ---------- frame ---------- */
.e8c .e8c-wrap { max-width: 1200px; margin: 0 auto; padding-inline: 24px; }

/* ---------- hero ---------- */
.e8c .e8c-hero { padding-block: 56px 48px; display: grid; gap: 20px; max-width: 820px; }
.e8c .e8c-title {
	font-size: clamp(40px, 6.4vw, 72px); line-height: 1; font-weight: 700;
	letter-spacing: -0.045em; text-wrap: balance;
}
.e8c .e8c-title span { display: block; color: var(--e8c-yellow); }
.e8c .e8c-lede { font-size: 19px; line-height: 1.5; color: var(--e8c-navy); max-width: 46ch; }

/* ---------- calculator grid ---------- */
.e8c .e8c-calc {
	display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 56px;
	align-items: start; padding-bottom: 72px;
}

/* steps: open layout, separated by rules, no cards */
.e8c .e8c-step { padding-block: 32px; border-top: 1px solid var(--e8c-line); }
.e8c .e8c-step:first-child { border-top: 2px solid var(--e8c-black); }
.e8c .e8c-step-body { display: grid; gap: 18px; min-width: 0; }
.e8c .e8c-h2 { font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.e8c .e8c-sub { color: var(--e8c-navy); font-size: 15px; margin-top: 4px; max-width: 62ch; }

/* step 1 as a sentence */
.e8c .e8c-sentence { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.6; font-weight: 500; letter-spacing: -0.02em; }
.e8c .e8c-sentence .e8c-inline {
	display: inline-flex; align-items: center; vertical-align: baseline;
	border-bottom: 2px solid var(--e8c-black); margin-inline: 4px; padding-inline: 2px;
}
.e8c .e8c-sentence .e8c-inline:focus-within { border-bottom-color: var(--e8c-yellow); background: var(--e8c-yellow-wash); }
.e8c .e8c-sentence input:not([type=checkbox]) {
	width: 3.2ch; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; outline: none;
}
.e8c .e8c-hint { font-size: 13px; color: var(--e8c-slate); }

/* step 2: tools */
.e8c .e8c-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--e8c-navy); }
.e8c .e8c-link { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; font-size: 14px; color: var(--e8c-black); }
.e8c .e8c-cats { display: grid; }
.e8c .e8c-cat { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 10px 20px; padding-block: 16px; border-top: 1px solid var(--e8c-line); }
.e8c .e8c-cat:first-child { border-top: 0; padding-top: 0; }
.e8c .e8c-cat-name { font-size: 14px; font-weight: 600; padding-top: 7px; }
.e8c .e8c-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.e8c .e8c-chip {
	padding: 7px 13px; border-radius: 8px; border: 1px solid var(--e8c-line); background: var(--e8c-paper);
	font-size: 14px; font-weight: 500; line-height: 1.3; transition: border-color .15s, background-color .15s;
}
.e8c .e8c-chip:hover { border-color: var(--e8c-black); }
.e8c .e8c-chip[aria-pressed="true"] { background: var(--e8c-black); border-color: var(--e8c-black); color: var(--e8c-paper); }
.e8c .e8c-chip-other { border-style: dashed; color: var(--e8c-navy); }
.e8c .e8c-chip-other[aria-pressed="true"] { border-style: solid; }
.e8c .e8c-pick { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 13px; color: var(--e8c-navy); }
.e8c .e8c-box { display: inline-flex; align-items: center; background: var(--e8c-field); border: 1px solid var(--e8c-line); border-radius: 8px; transition: border-color .15s; }
.e8c .e8c-box:focus-within { border-color: var(--e8c-black); }
.e8c .e8c-box .e8c-affix { color: var(--e8c-slate); padding-left: 10px; }
.e8c .e8c-box .e8c-affix-r { color: var(--e8c-slate); padding-right: 10px; }
.e8c .e8c-box input:not([type=checkbox]), .e8c .e8c-box select { padding: 7px 10px; font-size: 15px; font-weight: 500; outline: none; font-variant-numeric: tabular-nums; }
.e8c .e8c-pick .e8c-box { width: 104px; }
.e8c .e8c-pick .e8c-box-name { width: 190px; }
.e8c .e8c-pick .e8c-box-sel { width: auto; }
.e8c .e8c-pick .e8c-box-sel select { padding-right: 26px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2335415B' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center; }

/* step 3: plan */
.e8c .e8c-controls { display: flex; flex-wrap: wrap; gap: 10px 12px; }
.e8c .e8c-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--e8c-paper); border: 1px solid var(--e8c-line); }
.e8c .e8c-seg button { padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--e8c-navy); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.e8c .e8c-seg button[aria-pressed="true"] { background: var(--e8c-black); color: var(--e8c-paper); }
.e8c .e8c-free { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 4px; background: var(--e8c-yellow); color: var(--e8c-black); }
.e8c .e8c-tiers { display: grid; border: 1px solid var(--e8c-line); border-radius: 12px; overflow: hidden; background: var(--e8c-paper); }
.e8c .e8c-tiers-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.e8c .e8c-tiers-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.e8c .e8c-tier { padding: 16px; display: grid; gap: 2px; font-size: 13px; color: var(--e8c-slate); border-left: 1px solid var(--e8c-line-paper); position: relative; }
.e8c .e8c-tier:first-child { border-left: 0; }
.e8c .e8c-tier b { color: var(--e8c-black); font-size: 15px; font-weight: 600; }
.e8c .e8c-tier .e8c-tier-p { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; color: var(--e8c-black); margin-top: 8px; font-variant-numeric: tabular-nums; }
.e8c .e8c-tier.is-on { background: var(--e8c-yellow-wash); }
.e8c .e8c-tier.is-on::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--e8c-yellow); }
.e8c .e8c-tier .e8c-you { font-size: 12px; font-weight: 700; color: var(--e8c-black); }
.e8c .e8c-rec { font-size: 14px; color: var(--e8c-navy); }
.e8c .e8c-rec strong { color: var(--e8c-black); font-weight: 600; }
.e8c .e8c-rec .e8c-link { margin-left: 6px; }

/* step 4: direct bookings */
.e8c .e8c-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.e8c .e8c-field { display: grid; gap: 6px; align-content: start; }
.e8c .e8c-field > label { font-size: 13px; font-weight: 600; }
.e8c .e8c-field .e8c-box { display: flex; width: 100%; }
.e8c .e8c-field .e8c-box input:not([type=checkbox]), .e8c .e8c-field .e8c-box select { padding: 11px 12px; font-size: 16px; }
.e8c .e8c-formula { font-size: 14px; color: var(--e8c-navy); }
.e8c .e8c-formula strong { color: var(--e8c-black); font-weight: 600; }

/* ---------- the bill (the one loud element) ---------- */
.e8c .e8c-bill-wrap {
	position: sticky; top: var(--e8c-sticky-top);
	/* 1px muted outline that follows the zigzag edge (a CSS border would be cut off by the mask) */
	filter: drop-shadow(1px 0 0 var(--e8c-line)) drop-shadow(-1px 0 0 var(--e8c-line)) drop-shadow(0 1px 0 var(--e8c-line)) drop-shadow(0 -1px 0 var(--e8c-line));
}
.e8c .e8c-bill {
	background: var(--e8c-paper); padding: 28px 28px 40px;
	-webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 18px 100%;
	mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 18px 100%;
	display: grid; gap: 20px;
}
.e8c .e8c-bill-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 14px; border-bottom: 2px solid var(--e8c-black); }
.e8c .e8c-bill-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.e8c .e8c-bill-head span { font-size: 13px; color: var(--e8c-slate); text-align: right; }
.e8c .e8c-lines { display: grid; gap: 10px; }
.e8c .e8c-line { display: grid; grid-template-columns: minmax(0, auto) 1fr auto; align-items: baseline; gap: 8px; font-size: 14px; }
.e8c .e8c-line-name { min-width: 0; }
.e8c .e8c-line-name small { display: block; font-size: 12px; color: var(--e8c-slate); }
.e8c .e8c-dots { border-bottom: 1px dotted #BFC5D3; transform: translateY(-4px); min-width: 12px; }
.e8c .e8c-line-v { font-variant-numeric: tabular-nums; font-weight: 500; }
.e8c .e8c-line.is-new { animation: e8c-in .35s ease-out; }
@keyframes e8c-in { from { opacity: 0; transform: translateY(-4px); background: var(--e8c-yellow-wash); } to { opacity: 1; transform: none; } }
.e8c .e8c-empty { font-size: 14px; color: var(--e8c-slate); padding-block: 6px; }
.e8c .e8c-sum { display: grid; gap: 8px; padding-top: 14px; border-top: 1px solid var(--e8c-line-paper); }
.e8c .e8c-sum-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 15px; }
.e8c .e8c-sum-row b { font-weight: 700; font-variant-numeric: tabular-nums; }
.e8c .e8c-sum-row.is-old b { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--e8c-red); color: var(--e8c-slate); }
.e8c .e8c-sum-row small { display: block; font-size: 12px; color: var(--e8c-slate); font-weight: 400; }

.e8c .e8c-keep { background: var(--e8c-black); color: var(--e8c-paper); padding: 22px 22px 20px; margin-inline: -8px; display: grid; gap: 4px; }
.e8c .e8c-keep-l { font-size: 15px; font-weight: 500; color: #C9CDD8; }
.e8c .e8c-keep-v { font-size: clamp(48px, 5.4vw, 64px); font-weight: 700; letter-spacing: -0.05em; line-height: 1.05; color: var(--e8c-yellow); font-variant-numeric: tabular-nums; }
.e8c .e8c-keep-v small { font-size: 17px; letter-spacing: 0; font-weight: 500; color: #C9CDD8; margin-left: 6px; }
.e8c .e8c-keep-pct { font-size: 14px; color: #C9CDD8; }
.e8c .e8c-keep.is-neg { background: var(--e8c-cream); color: var(--e8c-black); }
.e8c .e8c-keep.is-neg .e8c-keep-v { color: var(--e8c-black); }
.e8c .e8c-keep.is-neg .e8c-keep-l, .e8c .e8c-keep.is-neg .e8c-keep-pct, .e8c .e8c-keep.is-neg .e8c-keep-v small { color: var(--e8c-navy); }

.e8c .e8c-more { font-size: 14px; color: var(--e8c-navy); display: grid; gap: 10px; }
.e8c .e8c-more strong { color: var(--e8c-black); font-weight: 600; }
.e8c .e8c-year { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 14px; border-top: 2px solid var(--e8c-black); }
.e8c .e8c-year span { font-size: 15px; font-weight: 600; }
.e8c .e8c-year b { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.e8c .e8c-year-split { font-size: 12px; color: var(--e8c-slate); margin-top: -12px; }

.e8c .e8c-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 15px 22px; border-radius: 8px; font-size: 15px; font-weight: 600; line-height: 1.2;
	background: var(--e8c-yellow); color: var(--e8c-black); text-decoration: none; transition: background-color .15s;
}
.e8c .e8c-btn:hover { background: var(--e8c-yellow-hover); color: var(--e8c-black); }
.e8c .e8c-btn[disabled] { opacity: .6; cursor: progress; }
.e8c .e8c-bill .e8c-btn { width: 100%; }

/* ---------- stats ---------- */
.e8c .e8c-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding-block: 36px; border-top: 2px solid var(--e8c-black); }
.e8c .e8c-disc { padding-bottom: 72px; }
.e8c .e8c-stat { display: grid; gap: 4px; }
.e8c .e8c-stat b { font-size: 44px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.e8c .e8c-stat span { font-size: 14px; color: var(--e8c-navy); }

/* ---------- report dialog ---------- */
html.e8c-lock { overflow: hidden; }
.e8c .e8c-modal {
	width: min(580px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); overflow: auto;
	margin: auto; padding: 32px; border: 1px solid var(--e8c-line); border-radius: 12px;
	background: var(--e8c-paper); color: var(--e8c-black);
}
.e8c .e8c-modal::backdrop { background: rgba(0, 0, 0, .5); }
.e8c .e8c-modal[open] { animation: e8c-pop .2s ease-out; }
@keyframes e8c-pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.e8c .e8c-close {
	position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 8px;
	display: grid; place-items: center; color: var(--e8c-navy);
}
.e8c .e8c-close:hover { background: var(--e8c-cream); color: var(--e8c-black); }
.e8c .e8c-modal-head { display: grid; gap: 6px; margin-bottom: 22px; padding-right: 36px; }
.e8c .e8c-modal-head p, .e8c .e8c-ok p { color: var(--e8c-navy); font-size: 15px; }
.e8c .e8c-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.e8c .e8c-form .e8c-full { grid-column: 1 / -1; }
.e8c .e8c-req { color: var(--e8c-red); }
.e8c .e8c-opt { font-weight: 400; color: var(--e8c-slate); }
.e8c .e8c-err { font-size: 13px; color: var(--e8c-red); }
.e8c .e8c-field.is-invalid .e8c-box { border-color: var(--e8c-red); }
.e8c .e8c-form .e8c-btn { width: 100%; }
.e8c .e8c-form-err { font-size: 14px; color: var(--e8c-red); }
.e8c .e8c-small { font-size: 12px; color: var(--e8c-slate); }
.e8c .e8c-ok { display: grid; gap: 12px; justify-items: start; padding-right: 36px; }

/* ---------- mobile bar ---------- */
.e8c .e8c-mbar { display: none; }

@media (max-width: 1080px) {
	.e8c .e8c-calc { grid-template-columns: minmax(0, 1fr) 360px; gap: 36px; }
	.e8c .e8c-cat { grid-template-columns: 1fr; gap: 8px; }
	.e8c .e8c-pick { grid-column: 1; }
	.e8c .e8c-cat-name { padding-top: 0; }
	.e8c .e8c-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 880px) {
	.e8c .e8c-calc { grid-template-columns: minmax(0, 1fr); gap: 8px; }
	.e8c .e8c-bill-wrap { position: static; }
	.e8c .e8c-mbar {
		display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
		background: var(--e8c-black); color: var(--e8c-paper);
		padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
		align-items: center; justify-content: space-between; gap: 12px; transition: transform .25s;
	}
	.e8c .e8c-mbar.is-away { transform: translateY(110%); }
	.e8c .e8c-mbar span { display: block; font-size: 12px; color: #C9CDD8; }
	.e8c .e8c-mbar b { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; color: var(--e8c-yellow); font-variant-numeric: tabular-nums; }
	.e8c .e8c-mbar .e8c-btn { padding: 10px 16px; font-size: 14px; }
	.e8c { padding-bottom: 72px; }
}
@media (max-width: 600px) {
	.e8c .e8c-wrap { padding-inline: 16px; }
	.e8c .e8c-hero { padding-block: 32px 28px; }
	.e8c .e8c-lede { font-size: 17px; }
	.e8c .e8c-step { padding-block: 26px; }
	.e8c .e8c-tiers-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.e8c .e8c-tiers-4 .e8c-tier:nth-child(3) { border-left: 0; }
	.e8c .e8c-tiers-4 .e8c-tier:nth-child(n+3) { border-top: 1px solid var(--e8c-line-paper); }
	.e8c .e8c-tiers-3 { grid-template-columns: 1fr; }
	.e8c .e8c-tiers-3 .e8c-tier { border-left: 0; border-top: 1px solid var(--e8c-line-paper); }
	.e8c .e8c-tiers-3 .e8c-tier:first-child { border-top: 0; }
	.e8c .e8c-bill { padding: 22px 20px 36px; }
	.e8c .e8c-stats { grid-template-columns: 1fr; gap: 20px; }
	.e8c .e8c-form { grid-template-columns: 1fr; }
	.e8c .e8c-modal { padding: 24px 20px; }
	.e8c .e8c-seg button { padding: 8px 11px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
	.e8c *, .e8c *::before, .e8c *::after { animation: none !important; transition: none !important; }
}
