/* WageFlip. Mobile-first, no external fonts, no frameworks. */

:root {
  --cobalt: #1f4fd8;
  --cobalt-dark: #1a3fae;
  --navy: #0b1f3a;
  --turquoise: #14c8c0;
  --turquoise-soft: #dff8f6;
  --coral: #ff6b5b;
  --yellow: #ffc93c;
  --yellow-soft: #fff4d1;
  --green: #1f9d6b;
  --green-soft: #def6ea;
  --bg: #f6fbfd;
  --card: #ffffff;
  --text: #0b1f3a;
  --muted: #52657d;
  --line: #d6e3ee;
  --error: #c4291c;
  --radius: 20px;
  --shadow: 0 8px 28px rgba(31, 79, 216, 0.08);
  --font: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(900px 380px at 100% -80px, var(--turquoise-soft), transparent 70%),
    radial-gradient(700px 320px at -10% 0, #e7eeff, transparent 70%),
    var(--bg);
  min-height: 100vh;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.75rem, 5vw, 2.6rem); letter-spacing: -0.02em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
a { color: var(--cobalt); }
a:hover { color: var(--cobalt-dark); }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(100% - 2rem, 1180px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }

.skip { position: absolute; left: 1rem; top: -4rem; background: var(--navy); color: #fff; padding: .6rem 1rem; border-radius: 10px; z-index: 10; }
.skip:focus { top: 1rem; }

/* ---------- header ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: relative; }
.site-header::before { content: ""; display: block; height: 5px; background: linear-gradient(90deg, var(--cobalt), var(--turquoise) 40%, var(--green) 65%, var(--yellow) 85%, var(--coral)); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .7rem 0; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--navy); font-weight: 800; flex: 1 1 auto; }
.brand-mark { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 12px; background: var(--cobalt); color: #fff; font-size: 1.4rem; box-shadow: 4px -4px 0 var(--yellow); }
.brand-name { font-size: 1.05rem; line-height: 1.15; }
.lang { display: inline-flex; align-items: center; gap: .15rem; background: var(--turquoise-soft); border-radius: 999px; padding: .15rem; font-weight: 800; font-size: .95rem; order: 2; }
.lang a, .lang-current { padding: .4rem .8rem; border-radius: 999px; text-decoration: none; min-width: 2.75rem; text-align: center; }
.lang a { color: var(--navy); }
.lang a:hover { background: #fff; }
.lang-current { background: var(--cobalt); color: #fff; }
.lang-sep { color: var(--muted); font-weight: 400; margin: 0 -.1rem; }
.main-nav { order: 3; flex: 1 0 100%; display: flex; flex-wrap: wrap; gap: .3rem; }
.main-nav a { white-space: nowrap; text-decoration: none; color: var(--navy); font-weight: 700; padding: .45rem .9rem; border-radius: 999px; border: 2px solid transparent; }
.main-nav a:hover { background: var(--turquoise-soft); }
.main-nav a[aria-current="page"] { background: var(--navy); color: #fff; }

/* ---------- layout: calculator, ad column, content ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; padding: 1.5rem 0 3rem; }
.layout > .intro { order: 1; }
.layout > .calc-area { order: 2; }
.layout > .ad-column { order: 3; }   /* mobile: ads sit BELOW the calculator */
.layout > .content { order: 4; }
.lead { font-size: 1.15rem; color: var(--muted); margin: 0; max-width: 46rem; }

@media (min-width: 1024px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    grid-template-areas: "intro ads" "calc ads" "content ads";
    grid-template-rows: auto auto 1fr;
    column-gap: 2rem;
    padding-top: 2rem;
  }
  .layout > .intro { grid-area: intro; }
  .layout > .calc-area { grid-area: calc; }
  .layout > .content { grid-area: content; }
  .layout > .ad-column { grid-area: ads; position: sticky; top: 1rem; align-self: start; }
}

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.content { display: grid; gap: 1.25rem; align-content: start; }
.prose h2 { margin-top: 1.4em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.1em; color: var(--cobalt-dark); }
.prose p, .prose li { max-width: 46rem; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: .35rem; }

/* ---------- calculator ---------- */
.calc-grid { display: grid; gap: 1.25rem; }
@media (min-width: 720px) { .calc-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; } }
.field { display: grid; gap: .35rem; margin-bottom: .9rem; }
.field label, legend { font-weight: 800; font-size: .98rem; }
.field-pair { display: grid; gap: .25rem; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .9rem; }
fieldset { border: 2px dashed var(--line); border-radius: 16px; padding: .9rem 1rem .3rem; margin: .4rem 0 1rem; }
legend { padding: 0 .4rem; color: var(--cobalt-dark); }
.help { margin: 0 0 .8rem; color: var(--muted); font-size: .92rem; }

input[type="text"], select {
  width: 100%; font: inherit; font-size: 1.15rem; font-weight: 700; color: var(--navy);
  background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: .7rem .85rem; min-height: 3.1rem;
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--cobalt) 50%), linear-gradient(135deg, var(--cobalt) 50%, transparent 50%); background-position: calc(100% - 1.25rem) 55%, calc(100% - .9rem) 55%; background-size: .4rem .4rem; background-repeat: no-repeat; padding-right: 2.4rem; }
input:hover, select:hover { border-color: #9db7ff; }
input:focus-visible, select:focus-visible { outline: 3px solid var(--coral); outline-offset: 1px; border-color: var(--cobalt); }
input[aria-invalid="true"] { border-color: var(--error); background: #fff5f4; }
.money-input { position: relative; }
.money-input span { position: absolute; left: .95rem; top: 50%; transform: translateY(-50%); font-weight: 800; color: var(--cobalt); pointer-events: none; }
.money-input input { padding-left: 2rem; font-size: 1.4rem; }
.error { margin: 0; color: var(--error); font-size: .9rem; font-weight: 700; }
.error[hidden] { display: none; }

.btn, .btn-ghost { font: inherit; font-weight: 800; border-radius: 999px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn { background: var(--cobalt); color: #fff; padding: .8rem 1.6rem; border: 0; }
.btn:hover { background: var(--cobalt-dark); color: #fff; }
.btn-alt { background: var(--turquoise); color: var(--navy); }
.btn-alt:hover { background: #0fb0a9; color: var(--navy); }
.btn-ghost { background: #fff; color: var(--cobalt-dark); border: 2px solid var(--cobalt); padding: .55rem 1.2rem; }
.btn-ghost:hover { background: #eef2ff; }

.results { border-top: 6px solid var(--turquoise); }
.badge { display: inline-block; margin: 0 0 .6rem; background: var(--yellow); color: var(--navy); font-weight: 800; font-size: .85rem; padding: .25rem .75rem; border-radius: 999px; }
.hero-label { margin: 0; font-weight: 800; color: var(--muted); }
.hero-value { margin: 0; font-size: clamp(2.4rem, 9vw, 3.6rem); font-weight: 900; letter-spacing: -0.03em; line-height: 1.1; color: var(--cobalt); overflow-wrap: anywhere; }
.hero-summary { margin: .2rem 0 1rem; color: var(--muted); font-size: .92rem; min-height: 1.4em; }
.results h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 .4rem; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.row { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .6rem .85rem; border-radius: 14px; background: #f3f8fb; border: 2px solid transparent; }
.row-label { font-weight: 700; display: grid; line-height: 1.25; }
.row-label small { color: var(--muted); font-weight: 500; font-size: .8rem; }
.row-value { font-weight: 900; font-size: 1.15rem; font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.row.is-input { background: var(--green-soft); border-color: var(--green); }
.row.is-input::after { content: attr(data-tag); order: 3; font-size: .68rem; font-weight: 800; color: #0d5c3f; text-transform: uppercase; letter-spacing: .05em; }
.gross-note { margin: 1rem 0 0; padding: .7rem .9rem; background: var(--yellow-soft); border-left: 5px solid var(--yellow); border-radius: 8px; font-size: .92rem; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: .55rem .8rem; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
thead th { background: var(--turquoise-soft); color: var(--navy); font-size: .9rem; }
tbody th { text-align: left; font-weight: 800; color: var(--cobalt-dark); }
th:first-child { text-align: left; }
tbody tr:nth-child(even) { background: #f8fbfd; }

/* ---------- ad and affiliate placements ---------- */
/* Space is reserved even when empty, so ads loading later never shift the page.
   Heights follow standard ad sizes for each screen class:
     phone   (<720px)   banner 320x100, rectangle 300x250
     tablet  (720-1023) leaderboard 728x90, rectangle 300x250
     desktop (1024+)    leaderboard/billboard 90-250px tall, skyscraper 300x600 */
.ad-slot { display: grid; place-items: center; text-align: center; border-radius: 16px; margin: 0 auto 1rem; width: 100%; max-width: 336px; overflow: hidden; }
.ad-slot.is-visible { background: repeating-linear-gradient(45deg, #f1f6fb, #f1f6fb 10px, #e9f0f7 10px, #e9f0f7 20px); border: 2px dashed #b9c9da; color: var(--muted); }
.ad-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; }
.ad-hint { font-size: .85rem; }
.ad-column { display: block; }

/* Phone defaults */
.ad-rail { min-height: 250px; }
.ad-partner { min-height: 100px; }
.ad-inline { min-height: 250px; }
.ad-band .ad-slot { max-width: none; margin-bottom: 0; min-height: 100px; }
.ad-band-top { padding-top: .75rem; }
.ad-band-bottom { padding: 0 0 1.5rem; }

@media (min-width: 720px) {
  .ad-inline { min-height: 90px; max-width: 728px; }
  .ad-band .ad-slot { min-height: 90px; }
  .ad-band-top { padding-top: 1rem; }
  .ad-band-bottom { padding-bottom: 2rem; }
}
@media (min-width: 1024px) {
  .ad-rail { min-height: 600px; }      /* 300x600 skyscraper */
  .ad-partner { min-height: 250px; }
  .ad-band .ad-slot { min-height: 100px; }
}
@media (min-width: 1280px) {
  .ad-band .ad-slot { min-height: 120px; }
}

/* ---------- legal pages ---------- */
.legal { padding: 2rem 0 3rem; max-width: 820px; }
.draft-banner { background: var(--yellow-soft); border: 2px solid var(--yellow); border-radius: 12px; padding: .7rem 1rem; font-weight: 700; }
mark.owner-review { background: var(--yellow); color: var(--navy); padding: .05rem .35rem; border-radius: 6px; font-weight: 700; }

/* ---------- root chooser / 404 ---------- */
.chooser-box { text-align: center; padding: 18vh 0 4rem; }
.chooser-links { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }
.chooser-box .lead { margin-inline: auto; }

/* ---------- footer ---------- */
.site-footer { background: var(--navy); color: #d9e6f5; padding: 2rem 0; }
.site-footer a { color: #fff; }
.site-footer h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; color: var(--turquoise); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }
.footer-note { font-size: .9rem; margin: 1.5rem 0 .3rem; max-width: 46rem; }
.footer-copy { font-size: .85rem; margin: 0; color: #9fb4cc; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
@media print { .ad-band, .ad-column, .ad-slot, .site-header nav, .btn-ghost { display: none !important; } body { background: #fff; } }

/* ---------- WageFlip logo ---------- */
.brand img { display: block; height: 40px; width: auto; }
.footer-brand { margin: 0 0 .25rem; }
.footer-brand img { display: block; height: 35px; width: auto; }
.footer-tagline { margin: 0 0 1.25rem; opacity: .85; }
.chooser-box img { max-width: 100%; height: auto; }

/* ---------- layout without a right rail ---------- */
@media (min-width: 1024px) {
  .layout.no-rail { grid-template-columns: minmax(0, 1fr); grid-template-areas: "intro" "calc" "content"; }
}

/* ---------- Google ad units ---------- */
.ad-slot.is-live { background: transparent; border: 0; min-height: 0; overflow: hidden; }
.ad-slot.is-live .ad-label { display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .25rem; }
.ad-slot.is-live ins[data-ad-status="unfilled"] { display: none !important; }
.ad-slot.is-live:has(ins[data-ad-status="unfilled"]) { display: none; }

/* ---------- affiliate offers: clearly different from ads ---------- */
.offer { background: #fffaf0; border: 2px solid var(--yellow); border-radius: var(--radius); padding: 1rem 1.15rem; margin: 1.25rem 0; }
.offer-tag { margin: 0 0 .5rem; font-size: .8rem; color: var(--muted); display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.offer-badge { background: var(--yellow); color: var(--navy); font-weight: 800; border-radius: 999px; padding: .1rem .6rem; text-transform: uppercase; letter-spacing: .05em; font-size: .72rem; }
.offer-row { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.offer-body { flex: 1 1 14rem; }
.offer-body h3 { margin: 0 0 .25rem; font-size: 1.05rem; }
.offer-body p { margin: 0; }
.offer-cta { white-space: nowrap; }
.offer-placeholder { border-style: dashed; background: #fffdf6; text-align: center; }
.offer-placeholder .offer-tag { justify-content: center; }
.offer-hint { margin: 0; color: var(--muted); font-size: .9rem; }
.ad-column .offer { margin: 1.25rem 0 0; }
.ad-column .offer-row { display: block; }
.ad-column .offer-cta { margin-top: .75rem; }

/* ---------- info pages ---------- */
.contact-email { font-weight: 800; font-size: 1.15rem; }
