/* CheckPeek website. Colors are the app's "Navy & Sun" (light) and "Night Navy" (dark) themes, with the same
   names and values as TakeHomePay/Resources/Themes/LightTheme.xaml and DarkTheme.xaml. A test
   (WebThemeTests) checks they stay identical; change a color in the XAML file and here together. */

:root {
    --PageBackground: #FFFFFF;
    --TextPrimary: #13263A;
    --TextHeading: #0D2B45;
    --TextMuted: #4F5F71;
    --NavBarBackground: #0D2B45;
    --NavBarText: #FFFFFF;
    --ButtonBackground: #0D2B45;
    --ButtonText: #FFFFFF;
    --ButtonDisabledBackground: #9AA8B6;
    --OutlineColor: #0D2B45;
    --OutlineBackground: #FFFFFF;
    --StepColor: #0D2B45;
    --TrackColor: #FFF1C7;
    --CardBackground: #FFFFFF;
    --CardBorderBrush: #C9D2DC;
    --SelectedBackground: #FFF6DB;
    --SelectedBorderBrush: #0D2B45;
    --SelectedMark: #0D2B45;
    --SelectedMarkText: #FFC93C;
    --MarkIdleBrush: #C9D2DC;
    --MarkSelectedBrush: #0D2B45;
    --InputBackground: #F2F5F9;
    --InputText: #13263A;
    --PlaceholderText: #6B7B8C;
    --HeroBackground: #0D2B45;
    --HeroBorderBrush: #0D2B45;
    --HeroText: #FFC93C;
    --HeroLabel: #DCE6F0;
    --PanelBackground: #FFFFFF;
    --PanelBorderBrush: #D5DDE6;
    --PanelHighlightBackground: #FFF6DB;
    --PanelHighlightBorderBrush: #FFC93C;
    --BannerBackground: #FFF8E1;
    --BannerBorderBrush: #F9A825;
    --BannerText: #5D4037;
    --InfoButtonText: #0D2B45;
    --SliderActive: #0D2B45;
    --SliderTrack: #CFD8E3;
    --ChartTakeHome: #2A78D6;
    --ChartFederal: #EB6834;
    --ChartState: #1BAF7A;
    --ChartFica: #EDA100;
    --ChartDeductions: #E87BA4;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --PageBackground: #0F1E2E;
    --TextPrimary: #E6EDF5;
    --TextHeading: #FFFFFF;
    --TextMuted: #A9B8C8;
    --NavBarBackground: #0A1622;
    --NavBarText: #FFFFFF;
    --ButtonBackground: #FFC93C;
    --ButtonText: #0D2B45;
    --ButtonDisabledBackground: #5F6B4A;
    --OutlineColor: #FFC93C;
    --OutlineBackground: #0F1E2E;
    --StepColor: #FFC93C;
    --TrackColor: #1E3247;
    --CardBackground: #162A3E;
    --CardBorderBrush: #2C4560;
    --SelectedBackground: #22384F;
    --SelectedBorderBrush: #FFC93C;
    --SelectedMark: #FFC93C;
    --SelectedMarkText: #0D2B45;
    --MarkIdleBrush: #3A5573;
    --MarkSelectedBrush: #FFC93C;
    --InputBackground: #162A3E;
    --InputText: #E6EDF5;
    --PlaceholderText: #8A9BAE;
    --HeroBackground: #162A3E;
    --HeroBorderBrush: #FFC93C;
    --HeroText: #FFC93C;
    --HeroLabel: #A9B8C8;
    --PanelBackground: #162A3E;
    --PanelBorderBrush: #2C4560;
    --PanelHighlightBackground: #22384F;
    --PanelHighlightBorderBrush: #FFC93C;
    --BannerBackground: #3A3220;
    --BannerBorderBrush: #C9A227;
    --BannerText: #FFE08A;
    --InfoButtonText: #FFC93C;
    --SliderActive: #FFC93C;
    --SliderTrack: #2C4560;
    --ChartTakeHome: #3987E5;
    --ChartFederal: #D95926;
    --ChartState: #199E70;
    --ChartFica: #C98500;
    --ChartDeductions: #D55181;
    color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--PageBackground);
    color: var(--TextPrimary);
    font-family: "Open Sans", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    font-size: 17px;
    line-height: 1.4;
    -webkit-text-size-adjust: 100%;
}

h1:focus { outline: none; }

/* Test banner on top, then a phone-sized column (centered on big screens) that fills the rest of the screen. */
#app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.page {
    flex: 1;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 20px 24px;
    display: flex;
    flex-direction: column;
}

.test-banner {
    background: var(--NavBarBackground);
    color: var(--NavBarText);
    font-size: 14px;
    text-align: center;
    padding: 8px 16px;
}
.test-banner a { color: var(--NavBarText); font-weight: 700; }

.loading { text-align: center; padding-top: 30vh; color: var(--TextHeading); font-weight: 700; font-size: 22px; }

/* ---------- Text ---------- */
.step-label { font-size: 14px; font-weight: 700; color: var(--StepColor); margin: 16px 0 8px; }
.question { font-size: 24px; font-weight: 700; color: var(--TextHeading); margin: 0; line-height: 1.25; }
.help { font-size: 17px; line-height: 1.3; color: var(--TextMuted); margin: 0; }
.field-label { font-size: 17px; font-weight: 700; color: var(--TextHeading); margin: 0; display: block; }
.muted { color: var(--TextMuted); }
.small { font-size: 12px; line-height: 1.4; }

.progress { height: 6px; border-radius: 3px; background: var(--TrackColor); overflow: hidden; }
.progress > div { height: 100%; background: var(--StepColor); }

.stack { display: flex; flex-direction: column; gap: 20px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.content { flex: 1; padding-top: 16px; }

/* ---------- Buttons ---------- */
.btn {
    display: block;
    width: 100%;
    min-height: 56px;
    padding: 16px 20px;
    border-radius: 12px;
    border: 1.5px solid var(--ButtonBackground);
    background: var(--ButtonBackground);
    color: var(--ButtonText);
    font: inherit;
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}
.btn.secondary { background: var(--OutlineBackground); color: var(--OutlineColor); border-color: var(--OutlineColor); }
.btn:focus-visible, .card-head:focus-visible, .pill:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--PanelHighlightBorderBrush);
    outline-offset: 2px;
}

.nav-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.toggle-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.toggle-row .btn { min-height: 48px; padding: 4px; font-size: 15px; }

/* ---------- Choice cards ---------- */
.card {
    border: 1px solid var(--CardBorderBrush);
    background: var(--CardBackground);
    border-radius: 12px;
}
.card.selected { border: 2px solid var(--SelectedBorderBrush); background: var(--SelectedBackground); }
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 60px;
    padding: 16px 18px;
    background: none;
    border: 0;
    color: var(--TextPrimary);
    font: inherit;
    font-size: 17px;
    text-align: left;
    cursor: pointer;
}
.mark {
    flex: none;
    width: 26px;
    height: 26px;
    border: 2px solid var(--MarkIdleBrush);
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: transparent;
}
.mark.square { border-radius: 6px; }
.card.selected .mark { background: var(--SelectedMark); border-color: var(--MarkSelectedBrush); color: var(--SelectedMarkText); }
.card-detail { padding: 0 18px 16px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- Inputs ---------- */
input[type="text"], select {
    width: 100%;
    min-height: 52px;
    padding: 10px 14px;
    border: 1px solid var(--CardBorderBrush);
    border-radius: 10px;
    background: var(--InputBackground);
    color: var(--InputText);
    font: inherit;
    font-size: 18px;
}
input[type="email"], textarea {
    width: 100%;
    min-height: 52px;
    padding: 10px 14px;
    border: 1px solid var(--CardBorderBrush);
    border-radius: 10px;
    background: var(--InputBackground);
    color: var(--InputText);
    font: inherit;
    font-size: 18px;
}
textarea { resize: vertical; line-height: 1.4; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.btn:disabled { background: var(--ButtonDisabledBackground); border-color: var(--ButtonDisabledBackground); cursor: default; }
.card-detail input[type="text"] { background: var(--PageBackground); font-size: 20px; }
input::placeholder { color: var(--PlaceholderText); }
select:disabled { opacity: 0.55; }

/* ---------- Notices ---------- */
.banner {
    border: 1px solid var(--BannerBorderBrush);
    background: var(--BannerBackground);
    color: var(--BannerText);
    border-radius: 8px;
    padding: 12px;
    font-size: 15px;
}
.banner strong { display: block; margin-bottom: 2px; }

/* ---------- Home ---------- */
.home-top { display: flex; justify-content: flex-end; gap: 14px; padding: 8px 0; position: relative; }
.pill {
    height: 44px;
    min-width: 44px;
    padding: 0 14px;
    border-radius: 22px;
    border: 1px solid var(--CardBorderBrush);
    background: var(--CardBackground);
    color: var(--TextHeading);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pill.round { padding: 0; width: 44px; justify-content: center; font-size: 20px; }
.lang-menu {
    position: absolute;
    top: 58px;
    right: 0;
    width: 200px;
    border: 1px solid var(--CardBorderBrush);
    background: var(--CardBackground);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    z-index: 10;
}
.lang-menu button {
    display: flex;
    justify-content: space-between;
    width: 100%;
    height: 52px;
    padding: 0 18px;
    background: none;
    border: 0;
    color: var(--TextPrimary);
    font: inherit;
    font-size: 17px;
    cursor: pointer;
    align-items: center;
}
.lang-menu button.current { font-weight: 700; color: var(--TextHeading); }

.home-main { display: flex; flex-direction: column; gap: 22px; padding: 4px 4px 22px; text-align: center; }
.home-main img { width: 100px; height: 100px; margin: 0 auto; display: block; }
.app-title { font-size: 34px; font-weight: 700; color: var(--TextHeading); margin: 8px 0 0; }
.app-subtitle { font-size: 16px; color: var(--TextMuted); margin: 0; }
.home-lead { font-size: 20px; font-weight: 700; color: var(--TextHeading); margin: 0; }
.home-intro { font-size: 16px; line-height: 1.3; color: var(--TextMuted); margin: 0; }
.trust { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.trust li {
    border: 1px solid var(--PanelHighlightBorderBrush);
    background: var(--PanelHighlightBackground);
    color: var(--TextPrimary);
    border-radius: 16px;
    padding: 5px 12px;
    font-size: 14px;
}
.trust li span { color: var(--TextHeading); font-weight: 700; }

.how { margin-top: 28px; text-align: left; border: 1px solid var(--PanelBorderBrush); background: var(--PanelBackground); border-radius: 12px; padding: 16px; }
.how h2 { font-size: 17px; color: var(--TextHeading); margin: 0 0 12px; }
.how ol { list-style: none; counter-reset: step; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.how li { counter-increment: step; display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.35; color: var(--TextPrimary); }
.how li::before {
    content: counter(step);
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 13px;
    background: var(--SelectedMark);
    color: var(--SelectedMarkText);
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-buttons { display: flex; flex-direction: column; gap: 10px; }
.home-buttons .small { text-align: center; margin: 0 0 4px; }

/* ---------- Results ---------- */
.results { display: flex; flex-direction: column; gap: 24px; padding-top: 20px; }
.hero {
    border: 1px solid var(--HeroBorderBrush);
    background: var(--HeroBackground);
    border-radius: 8px;
    padding: 24px 16px;
    text-align: center;
    color: var(--HeroLabel);
    font-size: 14px;
}
.hero .amount { font-size: 44px; font-weight: 700; color: var(--HeroText); line-height: 1.2; margin: 8px 0; }
.hero .brand { font-size: 11px; opacity: 0.8; margin-top: 14px; }
.periods { margin-top: -12px; }
.panel { border: 1px solid var(--PanelBorderBrush); background: var(--PanelBackground); border-radius: 8px; padding: 16px; }
.panel.highlight { border-color: var(--PanelHighlightBorderBrush); background: var(--PanelHighlightBackground); border-radius: 10px; padding: 14px; font-size: 15px; }
.summary-title { font-size: 14px; font-weight: 700; color: var(--TextHeading); margin: 0 0 8px; }
.summary { font-size: 14px; line-height: 1.6; color: var(--TextMuted); margin: 0; }

.bar { display: flex; gap: 2px; height: 20px; margin: 4px 0; }
.bar > div:first-child { border-radius: 4px 0 0 4px; }
.bar > div:last-child { border-radius: 0 4px 4px 0; }

.lines { width: 100%; border-collapse: collapse; font-size: 14px; }
.lines td { padding: 3px 4px; vertical-align: middle; }
.lines td.amount { text-align: right; white-space: nowrap; }
.lines tr.bold td { font-weight: 700; color: var(--TextHeading); }
.lines .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.lines .info {
    width: 40px;
    height: 40px;
    background: none;
    border: 0;
    color: var(--InfoButtonText);
    font-size: 16px;
    cursor: pointer;
}
.lines td.explain { color: var(--TextMuted); font-size: 13px; line-height: 1.4; padding: 0 4px 10px 24px; }

/* ---------- Footer and privacy page ---------- */
.footer { margin-top: auto; padding-top: 32px; text-align: center; font-size: 14px; color: var(--TextMuted); }
.footer nav { display: flex; justify-content: center; align-items: center; gap: 10px; }
.footer a { color: var(--TextHeading); font-weight: 700; display: inline-block; padding: 8px 4px; }
.footer p { margin: 4px 0 0; font-size: 13px; }

.legal { padding-top: 20px; line-height: 1.5; }
.legal h1 { margin-bottom: 6px; }
.legal .small { margin-bottom: 16px; }
.legal h2 { font-size: 18px; color: var(--TextHeading); margin: 24px 0 6px; }
.legal p { margin: 0 0 8px; }
.legal .btn { margin-top: 24px; }

.share-note { text-align: center; font-size: 14px; margin: -12px 0 0; }

/* ---------- What if ---------- */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compare .panel { border-radius: 12px; padding: 14px; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.compare .panel.highlight { border-width: 1.5px; }
.compare-label { font-size: 14px; font-weight: 700; color: var(--TextMuted); }
.compare-amount { font-size: 26px; font-weight: 700; }
.heading { color: var(--TextHeading); }
input[type="range"] { width: 100%; height: 44px; accent-color: var(--SliderActive); }

/* ---------- Errors from Blazor ---------- */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 20px;
    background: var(--BannerBackground);
    color: var(--BannerText);
    border-top: 1px solid var(--BannerBorderBrush);
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 16px; top: 10px; }
