/* SideMoney free tools. Uses theme tokens when available, with fallbacks. */
.sma-tool, .sma-quiz, .sma-nl {
	--t-navy: var(--wp--preset--color--navy, #102B3B);
	--t-lime: var(--wp--preset--color--lime, #C1F16B);
	--t-lime-soft: var(--wp--preset--color--lime-soft, #EEF8DA);
	--t-ivory: var(--wp--preset--color--ivory, #F5F5EE);
	--t-muted: var(--wp--preset--color--muted, #60717A);
	--t-border: var(--wp--preset--color--border, #DEE5E7);
	--t-head: var(--wp--preset--font-family--heading, system-ui, sans-serif);
	margin-block: 2rem;
}

/* ---------- Calculators ---------- */
.sma-tool { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 760px) { .sma-tool { grid-template-columns: 1fr; } }
.sma-tool fieldset { border: 1px solid var(--t-border); border-radius: 20px; padding: 1.5rem; margin: 0; background: #fff; }
.sma-tool legend { font-family: var(--t-head); font-weight: 800; color: var(--t-navy); padding: 0 0.4rem; font-size: 1.1rem; }
.sma-tool__grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); margin-top: 1rem; }
.sma-tool__field { display: flex; flex-direction: column; gap: 0.3rem; }
.sma-tool__field label { font-weight: 600; font-size: 0.9375rem; color: var(--t-navy); }
.sma-tool__field--currency { max-width: 200px; }
.sma-tool__input { position: relative; }
.sma-tool__input input, .sma-tool select { width: 100%; }
.sma-tool__input input[aria-invalid="true"] { border-color: #B2413D; box-shadow: 0 0 0 2px #F6D9D7; }
.sma-tool__unit { position: absolute; right: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--t-muted); pointer-events: none; }
.sma-tool__hint { font-size: 0.8125rem; color: var(--t-muted); }
.sma-tool__result { background: var(--t-navy); color: #E7EEF0; border-radius: 20px; padding: 1.5rem; position: sticky; top: 100px; }
@media (max-width: 760px) { .sma-tool__result { position: static; } }
.sma-tool__privacy { grid-column: 1 / -1; font-size: 0.8125rem; color: var(--t-muted); margin: 0; }
.sma-out { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid rgba(255,255,255,.12); font-size: 0.9375rem; }
.sma-out strong { color: #fff; font-family: var(--t-head); white-space: nowrap; }
.sma-out--main { flex-direction: column; gap: 0.2rem; border-bottom: 0; padding-top: 0; }
.sma-out--main span { color: var(--t-lime); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; font-weight: 700; }
.sma-out--main strong { font-size: clamp(2rem, 5vw, 2.75rem); line-height: 1.1; letter-spacing: -0.02em; }
.sma-verdict { margin: 1rem 0 0; padding: 0.7rem 0.9rem; border-radius: 10px; font-size: 0.875rem; background: rgba(255,255,255,.08); }
.sma-verdict--good { border-left: 4px solid var(--t-lime); }
.sma-verdict--warn { border-left: 4px solid #F2C14E; }
.sma-verdict--bad { border-left: 4px solid #F08A84; }
.sma-verdict--info { border-left: 4px solid #8FB3C4; }
.sma-compare { width: 100%; margin-top: 1rem; border-collapse: collapse; font-size: 0.875rem; }
.sma-compare caption { text-align: left; color: var(--t-lime); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; padding-bottom: 0.4rem; }
.sma-compare th, .sma-compare td { padding: 0.45rem 0.4rem; border-bottom: 1px solid rgba(255,255,255,.12); text-align: left; color: #E7EEF0; background: transparent; }
.sma-compare th { color: #A9BAC2; font-weight: 600; }
.sma-compare tr.is-current td { color: #fff; font-weight: 700; }

/* ---------- Quiz ---------- */
.sma-quiz { border-radius: 24px; background: var(--t-ivory); border: 1px solid var(--t-border); padding: clamp(1.25rem, 4vw, 2.5rem); }
.sma-quiz__eyebrow { margin: 0; font-family: var(--t-head); font-weight: 700; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--t-muted); }
.sma-quiz__title { margin: 0.25rem 0 0.4rem; font-family: var(--t-head); font-weight: 800; font-size: clamp(1.6rem, 3.5vw, 2.2rem); line-height: 1.15; color: var(--t-navy); letter-spacing: -0.02em; }
.sma-quiz__sub { margin: 0 0 1.5rem; color: var(--t-muted); }
.sma-quiz__q { border: 0; padding: 0; margin: 0 0 1.5rem; }
.sma-quiz__q legend { font-weight: 700; color: var(--t-navy); margin-bottom: 0.6rem; padding: 0; }
.sma-quiz__num { display: inline-block; background: var(--t-lime); color: var(--t-navy); border-radius: 6px; padding: 0.05rem 0.4rem; font-size: 0.75rem; font-family: var(--t-head); font-weight: 800; margin-right: 0.35rem; vertical-align: 0.1em; }
.sma-quiz__opts { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sma-quiz__opt { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0.55rem 1rem; border: 1px solid #C9D3D6; border-radius: 999px; background: #fff; cursor: pointer; font-size: 0.9375rem; transition: border-color .15s, background-color .15s; }
.sma-quiz__opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sma-quiz__opt:hover { border-color: var(--t-navy); }
.sma-quiz__opt:has(input:checked) { background: var(--t-navy); border-color: var(--t-navy); color: #fff; }
.sma-quiz__opt:has(input:focus-visible) { outline: 3px solid var(--t-navy); outline-offset: 2px; }
.sma-quiz__q.is-missing legend { color: #B2413D; }
.sma-quiz__error { color: #B2413D; font-weight: 600; min-height: 1.2em; }
.sma-quiz__result { background: #fff; border-radius: 18px; padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--t-border); }
.sma-quiz__result:focus { outline: none; }
.sma-quiz__result h3 { margin: 0.25rem 0 0.75rem; font-size: clamp(1.5rem, 3vw, 2rem); }
.sma-quiz__label { margin: 1.5rem 0 0.4rem; font-family: var(--t-head); font-weight: 800; color: var(--t-navy); }
.sma-quiz__notes { margin-top: 1.25rem; padding: 0.9rem 1.1rem; background: var(--t-ivory); border-left: 4px solid var(--t-lime); border-radius: 8px; font-size: 0.9375rem; }
.sma-quiz__notes p { margin: 0.25rem 0; }
.sma-quiz__links a { font-weight: 600; color: var(--t-navy); }
.sma-quiz__small { font-size: 0.8125rem; color: var(--t-muted); margin-top: 1.5rem; }
.sma-quiz__again { background: none; border: 0; padding: 0; color: var(--t-navy); font-weight: 700; text-decoration: underline; cursor: pointer; min-height: 44px; }
.sma-quiz__nl { margin-top: 1.25rem; }

/* ---------- Newsletter ---------- */
.sma-nl { background: var(--t-navy); color: #D5E0E4; border-radius: 20px; padding: clamp(1.25rem, 3vw, 2rem); }
.sma-nl__title { margin: 0; font-family: var(--t-head); font-weight: 800; font-size: 1.4rem; color: #fff; }
.sma-nl__text { margin: 0.4rem 0 1rem; }
.sma-nl__row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sma-nl__row input { flex: 1 1 220px; }
.sma-nl__consent { display: flex; gap: 0.5rem; align-items: flex-start; margin-top: 0.75rem; font-size: 0.875rem; }
.sma-nl__consent input { margin-top: 0.25rem; width: 18px; height: 18px; }
.sma-nl__consent a { color: #fff; }
.sma-nl__msg { margin: 0.5rem 0 0; min-height: 1.2em; color: var(--t-lime); font-size: 0.875rem; }
.sma-nl__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
