/* wealth-tax — the page layout and components. Tokens only (tokens.css); no colour literal (TS17).
   The layout follows the bdo.hu calculator (owner 2026-11-16, TB15): a bdo.hu site frame (TB16), a white page, a light-grey hero
   with a large light title, white boxed sections with red headings, grey-filled underlined fields,
   white "+ … hozzáadása" buttons, the total on a charcoal card, a charcoal footer; square corners. */

*, *::before, *::after { box-sizing: border-box; }

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background: var(--primary-bg);
    color: var(--text-color);
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: var(--lh-base);
}

a { color: var(--link-color); }
a:hover { color: var(--link-color-hover); }

/* The bdo.hu site frame (TB16): a white utility bar with the red contact block, the masthead with
   the logo, the red country label and the section menu; a <details> menu on a phone (no JavaScript). */
.wt-skip { position: absolute; left: -999px; top: 0; z-index: 20; padding: var(--space-2) var(--space-4); background: var(--bg-inverse); color: var(--text-inverse); }
.wt-skip:focus { left: var(--space-2); }

.wt-header {
    background: var(--primary-bg);
    color: var(--text-color);
}
.wt-header a { color: var(--text-color); text-decoration: none; }
.wt-header a:hover { color: var(--accent-color); }

.wt-utility {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-5);
    min-height: var(--utility-h);
    padding-left: var(--space-5);
    border-bottom: 1px solid var(--border-color);
    font-size: var(--fs-sm);
}
.wt-utility-links { display: flex; gap: var(--space-5); }
.wt-langs { display: inline-flex; gap: var(--space-2); text-transform: uppercase; }
.wt-lang-current { font-weight: var(--fw-bold); }
.wt-header a.wt-contact {
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    padding: 0 var(--space-5);
    background: var(--accent-color);
    color: var(--text-inverse);
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
}
.wt-header a.wt-contact:hover { background: var(--bg-inverse); color: var(--text-inverse); }

.wt-masthead {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-color);
}
.wt-logo { display: block; height: 38px; width: auto; }
.wt-header a.wt-country { color: var(--accent-color); font-size: var(--fs-sm); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: 0.04em; }
.wt-menu { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-5); margin-left: auto; font-size: var(--fs-sm); font-weight: var(--fw-bold); }
.wt-menu a { padding: var(--space-2) 0; border-bottom: 3px solid transparent; }
.wt-header .wt-menu a:hover { color: var(--text-color); border-bottom-color: var(--accent-color); }
.wt-menu a.has-chevron::after { content: ""; display: inline-block; width: 0.4em; height: 0.4em; margin: 0 0 0.2em 0.5em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.wt-search {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    align-self: stretch;
    margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-5)) calc(-1 * var(--space-4)) 0;
    padding: 0 var(--space-5);
    min-width: 12rem;
    background: var(--bg-canvas);
}
.wt-search input { width: 100%; border: 0; background: transparent; font: inherit; font-size: var(--fs-sm); color: var(--text-color); }
.wt-search input:focus { outline: 2px solid var(--accent-color); outline-offset: 2px; }
.wt-lang-sep { color: var(--text-muted); }
.wt-phone-menu { display: none; margin-left: auto; }
.wt-phone-menu summary { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; font-weight: var(--fw-bold); list-style: none; }
.wt-phone-menu summary::-webkit-details-marker { display: none; }
.wt-phone-menu summary .ph { font-size: var(--fs-xl); }
.wt-phone-menu nav {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 15;
    display: flex;
    flex-direction: column;
    padding: var(--space-2) var(--space-5) var(--space-4);
    background: var(--primary-bg);
    border-bottom: 1px solid var(--border-color);
}
.wt-phone-menu nav a { padding: var(--space-3) 0; border-bottom: 1px solid var(--border-color); font-weight: var(--fw-bold); }

.wt-main {
    flex: 1 0 auto;
    width: 100%;
    max-width: var(--frame-w);
    margin: 0 auto;
    padding: var(--space-6) var(--space-4) var(--space-8);
}

/* Two columns as on bdo.hu: the form or the breakdown, and a side card. */
.wt-cols { display: grid; grid-template-columns: minmax(0, 1fr) var(--aside-w); gap: var(--space-6); align-items: start; }
.wt-col > .wt-section:first-child, .wt-col > .wt-errors:first-child { margin-top: 0; }
.wt-aside { position: sticky; top: var(--space-4); }
.wt-aside-card { padding: var(--space-5); background: var(--bg-canvas); }
.wt-aside-card h2 { margin: 0 0 var(--space-3); color: var(--accent-color); font-size: var(--fs-sm); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: 0.06em; }
.wt-aside-card ol { margin: 0 0 var(--space-4); padding-left: var(--space-5); }
.wt-aside-card li { margin-bottom: var(--space-2); }
.wt-cta {
    display: inline-block;
    padding: var(--space-3) var(--space-5);
    background: var(--accent-color);
    color: var(--text-inverse);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    text-decoration: none;
}
.wt-cta:hover { background: var(--bg-inverse); color: var(--text-inverse); }
.wt-aside .wt-headline { margin-bottom: 0; }
.wt-aside > .wt-hint { margin-top: var(--space-3); font-size: var(--fs-xs); }

/* The live total card (L4): charcoal, with the red rule on top as on bdo.hu. */
.wt-live-card { background: var(--bg-inverse); color: var(--text-inverse); border-top: 4px solid var(--accent-color); }
.wt-live-card > div { padding: var(--space-4) var(--space-5); }
.wt-live-card > div + div { border-top: 1px solid var(--text-muted); }
.wt-live-card h2 { margin: 0 0 var(--space-2); font-size: var(--fs-sm); font-weight: var(--fw-bold); }
.wt-live-card p { margin: 0 0 var(--space-3); font-size: var(--fs-sm); }
.wt-live-card .wt-live-label { color: var(--accent-on-inverse); font-size: var(--fs-xs); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: 0.08em; }
.wt-live-card .wt-live-net { font-size: var(--fs-3xl); font-weight: var(--fw-semibold); line-height: var(--lh-tight); margin-bottom: var(--space-2); }
.wt-live-sub, .wt-live-hint { opacity: 0.85; }
.wt-bar { position: relative; height: 6px; margin: var(--space-4) 0 var(--space-1); background: var(--text-muted); }
.wt-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent-color); }
.wt-bar-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text-inverse); }
.wt-bar-scale { display: flex; justify-content: space-between; gap: var(--space-2); font-size: var(--fs-xs); opacity: 0.8; }
.wt-live-rows { margin: var(--space-4) 0 0; font-size: var(--fs-sm); }
.wt-live-rows > div { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-1) 0; }
.wt-live-rows dd { margin: 0; font-variant-numeric: tabular-nums; }
.wt-report {
    padding: var(--space-3) var(--space-4);
    border: 0;
    background: var(--accent-color);
    color: var(--text-inverse);
    font: inherit;
    font-weight: var(--fw-bold);
    cursor: pointer;
}
.wt-report:hover { background: var(--primary-bg); color: var(--text-color); }
.wt-cta.is-outline { background: transparent; border: 2px solid var(--text-inverse); }
.wt-cta.is-outline:hover { background: var(--text-inverse); color: var(--bg-inverse); }

/* The bdo.hu hero (L3): a grey band, a white panel with the red corner mark, the large light title,
   the lead with its link and the white "Hogyan működik?" box with red numbers. */
.wt-hero { margin-bottom: var(--space-6); }
.wt-hero-panel { position: relative; display: flex; gap: var(--space-5); padding: var(--space-6) var(--space-6) var(--space-6) 0; background: var(--bg-canvas); }
.wt-hero-mark {
    flex: 0 0 auto;
    width: 9rem;
    height: 6.5rem;
    padding: var(--space-3) 0 0 var(--space-4);
    background: var(--accent-color);
    clip-path: polygon(0 0, 100% 0, 0 100%);
    margin-top: calc(-1 * var(--space-6));
}
.wt-hero-mark img { width: 3.2rem; height: auto; filter: brightness(0) invert(1); }
.wt-hero-body { flex: 1 1 auto; min-width: 0; }
.wt-hero h1 { font-size: var(--fs-3xl); font-weight: var(--fw-light); line-height: var(--lh-tight); margin: 0 0 var(--space-3); }
.wt-hero-lead { font-size: var(--fs-sm); margin: 0 0 var(--space-4); }
.wt-hero-lead a { font-weight: var(--fw-semibold); text-decoration: none; }
.wt-hero-box { padding: var(--space-4) var(--space-5); background: var(--surface-card); }
.wt-hero-box h2 { margin: 0 0 var(--space-2); color: var(--accent-color); font-size: var(--fs-xs); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: 0.06em; }
.wt-steps { counter-reset: wt-step; list-style: none; margin: 0 0 var(--space-3); padding: 0; font-size: var(--fs-sm); }
.wt-steps li { counter-increment: wt-step; position: relative; padding-left: var(--space-5); margin-bottom: var(--space-2); }
.wt-steps li::before { content: counter(wt-step); position: absolute; left: 0; color: var(--accent-color); font-weight: var(--fw-bold); }
.wt-legal { margin: 0; color: var(--hint-color); font-size: var(--fs-xs); }

.wt-section {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
}
.wt-section > h2 { font-size: var(--fs-xl); font-weight: var(--fw-regular); color: var(--accent-color); margin: 0 0 var(--space-2); }
.wt-section > .wt-hint, .wt-hint { color: var(--hint-color); font-size: var(--fs-hint); margin: 0 0 var(--space-3); }

.wt-grid { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-end; }

.wt-field { display: flex; flex-direction: column; flex: 1 1 10rem; min-width: 8rem; max-width: 22rem; }
.wt-field > span { font-size: var(--fs-sm); color: var(--text-color); margin-bottom: var(--space-1); }
.wt-field input, .wt-field select {
    font: inherit;
    padding: var(--space-2) 0.625rem;
    color: var(--text-color);
    background: var(--input-bg);
    border: 0;
    border-bottom: 1px solid var(--border-color-strong);
    border-radius: var(--radius-sm);
}
.wt-field input:focus, .wt-field select:focus { outline: 2px solid var(--color-focus); outline-offset: 1px; }
.wt-field [aria-invalid="true"] { border-bottom: 2px solid var(--danger-color); }
.wt-check input { accent-color: var(--accent-color); }
.wt-check { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); flex: 0 1 auto; }

.wt-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    align-items: flex-end;
    padding: var(--space-3);
    margin-bottom: 0.625rem;
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}
.wt-row .wt-actions { margin-left: auto; }

.wt-list-foot { display: flex; justify-content: flex-start; padding-top: var(--space-1); }
.wt-add {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    padding: var(--space-1) 0.5625rem;
    color: var(--text-color);
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.wt-add:hover { border-color: var(--accent-color); color: var(--accent-color); }
.wt-add:focus-visible, .wt-primary:focus-visible, .wt-icon:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

.wt-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: var(--fs-lg);
    color: var(--text-muted);
    background: transparent;
    border: 0;
    cursor: pointer;
}
.wt-icon:hover { color: var(--accent-color); }

.wt-submit-bar { display: flex; justify-content: flex-end; margin-top: var(--space-4); }
.wt-primary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font: inherit;
    font-weight: var(--fw-semibold);
    padding: var(--space-3) var(--space-5);
    color: var(--text-inverse);
    background: var(--accent-color);
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.wt-primary:hover { background: var(--accent-hover); }

.wt-errors {
    border-left: 3px solid var(--danger-color);
    background: var(--surface-card);
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
}
.wt-errors h2 { font-size: var(--fs-md); margin: 0 0 var(--space-2); }
.wt-errors ul { margin: 0; padding-left: var(--space-5); }

.wt-notice {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    border-left: 3px solid var(--warning-color);
    padding: var(--space-2) var(--space-3);
    margin: var(--space-4) 0;
}

.wt-message { text-align: center; padding: var(--space-6) var(--space-4); }
.wt-message .ph { font-size: var(--fs-2xl); color: var(--success-color); }
.wt-message.is-failed .ph { color: var(--warning-color); }

/* Result */
.wt-headline {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-5);
    margin-bottom: var(--space-4);
    background: var(--bg-inverse);
    color: var(--text-inverse);
    border-radius: var(--radius-md);
}
.wt-headline > span:first-child {
    color: var(--accent-on-inverse);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.wt-headline .wt-net { font-size: var(--fs-3xl); font-weight: var(--fw-semibold); color: var(--text-inverse); }

.wt-table-wrap { overflow-x: auto; max-width: 100%; } /* a wide table scrolls in its own box on a phone */
.wt-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.wt-table th, .wt-table td { padding: var(--space-2); border-bottom: 1px solid var(--border-color); text-align: left; }
.wt-table th { color: var(--text-muted); font-weight: var(--fw-semibold); }
.wt-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wt-table thead th.num { white-space: normal; } /* amounts stay on one line; a long header wraps instead of scrolling the table */
.wt-table tbody th { color: var(--text-color); font-weight: var(--fw-regular); }
.wt-table tr.is-total td, .wt-table tr.is-total th { font-weight: var(--fw-bold); border-top: 2px solid var(--border-color-strong); }
.wt-table tr.is-excluded td { color: var(--text-muted); }

.wt-footer {
    color: var(--text-inverse);
    background: var(--bg-inverse);
}
.wt-footer a { color: var(--text-inverse); text-decoration: none; }
.wt-footer a:hover { text-decoration: underline; }
.wt-footer-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-6);
    max-width: var(--frame-w);
    margin: 0 auto;
    padding: var(--space-8) var(--space-4) var(--space-6);
}
.wt-footer-links { display: grid; grid-template-columns: repeat(2, max-content); gap: var(--space-3) var(--space-8); align-content: start; }
.wt-footer-side p { margin: 0 0 var(--space-4); font-size: var(--fs-sm); }
.wt-footer-title { margin: 0 0 var(--space-4); font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.wt-footer a.wt-subscribe {
    display: inline-block;
    margin-bottom: var(--space-4);
    padding: var(--space-3) var(--space-6);
    border: 2px solid var(--text-inverse);
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
}
.wt-footer a.wt-subscribe:hover { background: var(--text-inverse); color: var(--bg-inverse); text-decoration: none; }
.wt-footer a.wt-subscribe.is-filled { background: var(--accent-color); border-color: var(--accent-color); }
.wt-footer a.wt-subscribe.is-filled:hover { background: var(--text-inverse); border-color: var(--text-inverse); color: var(--bg-inverse); }
.wt-social { display: flex; gap: var(--space-2); margin-bottom: var(--space-4); }
.wt-social a { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-right: var(--space-1); border-radius: 50%; background: var(--text-muted); font-size: var(--fs-lg); }
.wt-footer .wt-social a:hover { background: var(--accent-color); text-decoration: none; }
.wt-footer .wt-copyright { font-size: var(--fs-xs); margin: 0; }
.wt-footer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: center;
    justify-content: center;
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--text-muted);
    font-size: var(--fs-xs);
}
.wt-credit { display: inline-flex; align-items: center; gap: var(--space-1); }
.wt-credit-mark {
    display: inline-block;
    width: 14px;
    height: 14px;
    background: currentColor;
    -webkit-mask: url("/static/img/whitebell-strokes.svg") center / contain no-repeat;
    mask: url("/static/img/whitebell-strokes.svg") center / contain no-repeat;
}
.wt-env { padding: 0 var(--space-2); border: 1px solid var(--warning-color); border-radius: var(--radius-sm); }

@media (max-width: 64rem) {
    .wt-menu, .wt-search { display: none; }
    .wt-phone-menu { display: block; }
    .wt-masthead { position: relative; }
    .wt-cols { grid-template-columns: minmax(0, 1fr); }
    .wt-aside { position: static; }
}
@media (max-width: 40rem) {
    .wt-field { max-width: none; }
    .wt-utility-links { display: none; }
    .wt-utility { padding-left: var(--space-3); gap: var(--space-3); }
    .wt-masthead { padding: var(--space-3); gap: var(--space-3); }
    .wt-footer-inner { grid-template-columns: minmax(0, 1fr); }
    .wt-hero-panel { flex-direction: column; gap: 0; padding: 0 var(--space-4) var(--space-5); }
    .wt-hero-mark { margin: 0 0 var(--space-3) calc(-1 * var(--space-4)); width: 6rem; height: 4.5rem; }
}

/* A field's own error, tied to it by aria-describedby. */
.wt-field-err { color: var(--accent-text); font-size: var(--fs-xs); }

/* Legal references (increment-legal-refs J1–J5): the (i) marker beside a heading or a tax line, its
   tooltip (the floor's tooltip.js; .fui-tip lives in foundation-ui shell.css, which this layout does
   not load, so the rule is restated here from this app's own tokens), and the sources line. */
.wt-ref {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: var(--space-1);
    color: var(--hint-color);
    font-size: var(--fs-base);
    font-weight: var(--fw-regular);
    cursor: help;
}
.wt-ref:hover { color: var(--link-color); }
.wt-ref:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.wt-ref.is-differs { color: var(--warning-color); }
/* Not by colour alone (WCAG 1.4.1): a flagged marker also carries a dot beside the (i). */
.wt-ref.is-differs::after {
    content: "";
    align-self: flex-start;
    width: 0.35em;
    height: 0.35em;
    margin-left: 1px;
    border-radius: 50%;
    background: currentColor;
}

.fui-tip {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    width: max-content;
    max-width: 38ch;
    padding: var(--space-2) var(--space-3);
    font: var(--fw-regular) var(--fs-xs) / var(--lh-base) var(--font-sans);
    background: var(--surface-card);
    color: var(--fg);
    border: 1px solid var(--border-color-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.fui-tip[hidden] { display: none; }

.wt-sources { font-size: var(--fs-xs); color: var(--text-muted); margin: var(--space-4) 0 0; }
.wt-sources a { color: var(--link-color); }

/* The report dialog (increment-report-dialog RD-U2): a server-rendered overlay in the slot under
   the red button; closed by its button or Escape through htmx. */
.wt-modal {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    background: color-mix(in srgb, var(--bg-inverse) 55%, transparent);
}
.wt-modal-box {
    position: relative;
    width: min(32rem, 100%);
    padding: var(--space-6) var(--space-5) var(--space-5);
    background: var(--surface-card);
    color: var(--text-color);
    box-shadow: var(--shadow-sm);
}
.wt-modal-box h2 { margin: 0 0 var(--space-3); color: var(--accent-color); font-size: var(--fs-lg); }
.wt-modal-box p { margin: 0 0 var(--space-4); }
.wt-modal-box .wt-field { display: flex; flex-direction: column; margin-bottom: var(--space-3); }
.wt-modal-box .wt-report { width: 100%; margin-top: var(--space-4); }
.wt-modal-close {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    padding: var(--space-2);
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: var(--fs-lg);
    cursor: pointer;
}
.wt-modal-close:hover { color: var(--text-color); }
.wt-modal-close:focus-visible, .wt-modal-box input:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.wt-report-msg { margin: var(--space-3) 0 0; font-size: var(--fs-sm); }
.wt-report-msg .ph { color: var(--success-color); }
.wt-report-msg.is-failed .ph { color: var(--danger-color); }
