/*
 * EmbedCalc design system. Shared by the public site and the console.
 *
 * The look comes from the trade itself: a yellow tape measure and the
 * itemised quote slip a tradesperson hands over. Pine ink on paper, one
 * yellow, ruled lines. The ruler strip (.ruler) and the quote slip (.slip)
 * are the two signature pieces; everything else stays quiet.
 */

/* Figtree, one variable file per script range so English pages fetch only the first. */
@font-face { font-family: "Figtree"; src: url(/assets/fonts/figtree-latin.woff2) format("woff2"); font-weight: 400 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Figtree"; src: url(/assets/fonts/figtree-latin-ext.woff2) format("woff2"); font-weight: 400 900; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
	--ink: #0f2a26;
	--ink-2: #24443e;
	--muted: #52655f;
	--paper: #fbfcfa;
	--ledger: #e6efea;
	--rule: #c9d8d0;
	--tape: #ffc53d;
	--tape-deep: #e2a400;
	--white: #fff;
	--bad: #a8281c;
	--good: #1c6b4a;

	--display: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
	--body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

	--r-s: 6px;
	--r-m: 10px;
	--r-l: 18px;
	--wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.6 var(--body); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 5.6vw, 4.5rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.02; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.75rem); }
h3 { font-size: 1.3rem; letter-spacing: -0.01em; line-height: 1.2; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--white); padding: 8px 14px; border-radius: var(--r-s); z-index: 100; }
.skip:focus { left: 8px; }

.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }
.narrow { width: min(100% - 40px, 760px); margin-inline: auto; }
.lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.5; color: var(--ink-2); max-width: 36em; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.num { font-variant-numeric: tabular-nums; }

/* ---- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 1rem/1 var(--body); padding: 15px 22px; border-radius: var(--r-m); border: 1.5px solid transparent; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn-primary { background: var(--tape); color: var(--ink); border-color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.btn-primary:hover { background: #ffd062; }
.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn-ink { background: var(--ink); color: var(--white); }
.btn-ink:hover { background: var(--ink-2); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-danger { background: transparent; color: var(--bad); border-color: currentColor; }
.btn-sm { padding: 10px 14px; font-size: 0.93rem; border-radius: var(--r-s); }
.btn-primary.btn-sm { box-shadow: 0 2px 0 var(--ink); }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---- top navigation */
.nav { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); }
.nav-in { display: flex; align-items: center; gap: 28px; min-height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 800 1.25rem/1 var(--display); letter-spacing: -0.03em; text-decoration: none; color: var(--ink); }
.brand .mark { flex: none; }
.brand-light { font-weight: 500; opacity: 0.75; }
@media (max-width: 420px) { .brand-light { display: none; } }
.nav-links { display: flex; align-items: center; gap: 26px; flex: 1; font-size: 0.97rem; font-weight: 500; }
.nav-links > a:not(.btn), .nav-drop > button { color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; padding: 6px 0; cursor: pointer; }
.nav-links > a:not(.btn):hover, .nav-drop > button:hover { text-decoration: underline; }
.nav-gap { flex: 1; }
.nav-drop { position: relative; }
.nav-drop > button::after { content: ""; display: inline-block; width: 6px; height: 6px; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(45deg) translateY(-3px); margin-left: 8px; }
.nav-menu { display: none; position: absolute; top: calc(100% + 10px); left: -16px; min-width: 250px; background: var(--white); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 8px; box-shadow: 0 14px 40px rgba(15, 42, 38, 0.14); }
.nav-drop.open .nav-menu { display: grid; }
.nav-menu a { padding: 9px 12px; border-radius: var(--r-s); text-decoration: none; }
.nav-menu a:hover { background: var(--ledger); }
.nav-toggle { display: none; margin-left: auto; font: 600 0.95rem var(--body); background: none; border: 1.5px solid var(--rule); border-radius: var(--r-s); padding: 8px 12px; color: var(--ink); }
@media (max-width: 860px) {
	.nav-toggle { display: block; }
	.nav-links { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--rule); flex-direction: column; align-items: stretch; gap: 4px; padding: 14px 20px 22px; }
	.nav-links.open { display: flex; }
	.nav-links > a:not(.btn), .nav-drop > button { padding: 10px 0; text-align: left; }
	.nav-menu { position: static; box-shadow: none; border: 0; padding: 0 0 0 14px; background: none; }
	.nav-gap { display: none; }
}

/* ---- sections */
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section-tint { background: var(--ledger); }
.section-ink { background: var(--ink); color: var(--white); }
.section-ink .lede, .section-ink .muted { color: #c2d3cc; }
.section-head { display: grid; gap: 16px; margin-bottom: clamp(28px, 4vw, 48px); max-width: 46em; }
.grid-2 { display: grid; gap: clamp(24px, 4vw, 56px); grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.grid-3 { display: grid; gap: clamp(20px, 3vw, 36px); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 20px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .grid-4 { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 14px; align-content: start; }
.stack-l { display: grid; gap: 28px; align-content: start; }

/* A point made with a ruled top edge, not a card. */
.point { display: grid; gap: 10px; align-content: start; padding-top: 18px; border-top: 2px solid var(--ink); }
.section-ink .point { border-color: var(--tape); }
.point p { color: var(--muted); }
.section-ink .point p { color: #c2d3cc; }

.card { background: var(--white); border: 1px solid var(--rule); border-radius: var(--r-l); padding: clamp(20px, 3vw, 32px); }
a.card { display: grid; gap: 10px; text-decoration: none; transition: border-color 0.12s; }
a.card:hover { border-color: var(--ink); }
.tag { display: inline-block; font-size: 0.82rem; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--ledger); color: var(--ink-2); }
.tag-soon { background: transparent; border: 1px dashed var(--rule); color: var(--muted); }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checks li { padding-left: 28px; position: relative; }
.checks li::before { content: ""; position: absolute; left: 2px; top: 0.42em; width: 13px; height: 7px; border-left: 2.5px solid var(--good); border-bottom: 2.5px solid var(--good); transform: rotate(-45deg); }

/* ---- signature: the tape-measure strip */
.ruler { height: 34px; background-color: var(--tape); border-block: 1.5px solid var(--ink);
	background-image:
		repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 100px),
		repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 50px),
		repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 10px);
	background-size: 100% 100%, 100% 55%, 100% 28%;
	background-repeat: no-repeat; background-position: left top; }

/* ---- signature: the quote slip */
.slip { background: var(--white); border: 1px solid var(--rule); border-radius: 4px; padding: 26px 24px 22px; position: relative; box-shadow: 0 1px 0 var(--rule), 0 18px 40px -18px rgba(15, 42, 38, 0.28); font-variant-numeric: tabular-nums; }
.slip::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 8px; background: radial-gradient(circle at 6px -1px, var(--paper) 4.5px, transparent 5px) repeat-x; background-size: 12px 8px; }
.slip-head { display: flex; justify-content: space-between; gap: 16px; font-size: 0.85rem; color: var(--muted); padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.slip-head b { font: 700 1.05rem var(--display); color: var(--ink); }
.slip-lines { list-style: none; margin: 0; padding: 0; }
.slip-lines li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px dashed var(--rule); font-size: 0.97rem; }
.slip-lines li span:last-child { font-weight: 600; white-space: nowrap; }
.slip-total { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-top: 14px; font-weight: 600; }
.slip-total strong { font: 800 1.9rem/1 var(--display); letter-spacing: -0.03em; background: linear-gradient(transparent 62%, var(--tape) 62%); padding: 0 4px; }

/* ---- live demo frame around an embedded calculator */
.demo { background: var(--white); border: 1.5px solid var(--ink); border-radius: var(--r-l); padding: 10px; box-shadow: 8px 8px 0 var(--ledger); }
.section-tint .demo { box-shadow: 8px 8px 0 var(--rule); }
.demo-bar { display: flex; align-items: center; gap: 10px; padding: 6px 10px 12px; font-size: 0.85rem; color: var(--muted); }
.demo-bar::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #2fa36b; box-shadow: 0 0 0 3px #d5efe2; }
.demo-calc { min-height: 280px; }

/* ---- FAQ */
.faq { border-top: 2px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; padding: 20px 44px 20px 0; position: relative; font: 700 1.15rem/1.3 var(--display); letter-spacing: -0.01em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 14px; font: 400 1.7rem/1 var(--body); }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 44px 22px 0; color: var(--ink-2); max-width: 44em; }

/* ---- closing call to action */
.cta { background: var(--ink); color: var(--white); border-radius: var(--r-l); padding: clamp(32px, 6vw, 72px); display: grid; gap: 22px; justify-items: start; }
.cta p { color: #c2d3cc; max-width: 34em; }

/* ---- footer */
.foot { border-top: 1px solid var(--rule); padding: 56px 0 28px; font-size: 0.95rem; margin-top: clamp(40px, 6vw, 80px); }
.foot-in { display: grid; grid-template-columns: 1.5fr repeat(5, 1fr); gap: 32px; }
@media (max-width: 1100px) { .foot-in { grid-template-columns: repeat(3, 1fr); } .foot-brand { grid-column: 1 / -1; } }
.nav-menu-all { font-weight: 600; border-top: 1px solid var(--ledger); margin-top: 4px; }
.foot nav { display: grid; gap: 9px; align-content: start; }
.foot h2 { font: 600 0.95rem var(--body); letter-spacing: 0; color: var(--muted); margin-bottom: 4px; }
.foot nav a { text-decoration: none; }
.foot nav a:hover { text-decoration: underline; }
.foot-brand { display: grid; gap: 14px; align-content: start; color: var(--muted); max-width: 22em; }
.foot-base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.88rem; }
@media (max-width: 800px) { .foot-in { grid-template-columns: 1fr 1fr; } }

/* ---- forms (sign-in pages and the console) */
.field { display: grid; gap: 6px; }
.field > label, .label { font-weight: 600; font-size: 0.93rem; }
.field .hint { font-size: 0.85rem; color: var(--muted); }
.input, .field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field input[type=url], .field select, .field textarea {
	width: 100%; font: inherit; color: var(--ink); background: var(--white); border: 1.5px solid var(--rule); border-radius: var(--r-m); padding: 12px 14px; min-height: 48px; }
.field textarea { min-height: 96px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--ledger); }
.error { color: var(--bad); font-size: 0.93rem; font-weight: 500; }
.notice { background: var(--ledger); border-left: 4px solid var(--good); padding: 12px 16px; border-radius: var(--r-s); margin-bottom: 20px; }
.notice-warn { border-left-color: var(--tape-deep); background: #fff6dc; }

/* ---- sign-in, sign-up */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-form { padding: clamp(28px, 6vw, 72px); display: grid; align-content: center; justify-items: center; }
.auth-form > div { width: min(100%, 400px); display: grid; gap: 22px; }
.auth-form h1 { font-size: clamp(2rem, 3.4vw, 2.6rem); }
.auth-form form { display: grid; gap: 16px; }
.auth-aside { background: var(--ink); color: var(--white); padding: clamp(28px, 6vw, 72px); display: grid; align-content: center; gap: 28px; }
.auth-aside .slip { color: var(--ink); max-width: 420px; }
.auth-aside p { color: #c2d3cc; max-width: 30em; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-aside { display: none; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Sign-in pages fill the window exactly: spacing tightens on shorter screens so nothing scrolls. */
.auth { min-height: 100vh; min-height: 100dvh; }
.auth-form, .auth-aside { padding-block: clamp(16px, 5vh, 72px); }
.auth-terms { margin: 0; }
.auth-single { grid-template-columns: 1fr; }
@media (min-width: 861px) and (max-height: 900px) {
	.auth-form > div { gap: 16px; }
	.auth-form form { gap: 11px; }
	.auth-form h1 { font-size: 2rem; }
	.auth-form .field { gap: 4px; }
	.auth-form .field input { padding-block: 9px; }
	.auth-form .btn { padding-block: 12px; }
}
@media (min-width: 861px) and (max-height: 740px) {
	.auth-form > div { gap: 10px; }
	.auth-form form { gap: 8px; }
	.auth-form h1 { font-size: 1.7rem; }
	.auth-form .field input { padding-block: 6px; }
	.auth-form .field .hint { display: none; }
	.auth-aside { gap: 16px; }
}

/* Terms and privacy: one readable column. */
.legal { padding-block: clamp(36px, 6vw, 72px); }
.legal h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 6px; }
.legal h2 { font-size: 1.3rem; letter-spacing: -0.01em; margin: 2.2em 0 0.5em; }
.legal p, .legal ul { margin: 0 0 1em; max-width: 68ch; }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: 0.45em; }
.legal code { font-size: 0.92em; background: var(--ledger); padding: 1px 6px; border-radius: 4px; }
.foot-legal { display: flex; gap: 18px; flex-wrap: wrap; }
@media (min-width: 861px) and (max-height: 660px) {
	.auth-form, .auth-aside { padding-block: 10px; }
	.auth-form > div { gap: 6px; }
	.auth-form form { gap: 6px; }
	.auth-form h1 { font-size: 1.45rem; }
	.auth-form .field > label { font-size: 0.85rem; }
	.auth-form .field input { padding-block: 4px; }
	.auth-form .btn { padding-block: 9px; }
}

/* Shown above the home page to someone who clicked the badge under a customer's calculator. */
.badge-strip { margin: 0; background: var(--tape); color: var(--ink); font-weight: 600; text-align: center; padding: 10px 16px; }
.badge-strip a { color: inherit; text-decoration: underline; }
