/* ═══════════════════════════════════════════
   RATE CALCULATOR (/free-tools/electrician-hourly-rate-calculator/) — mobile-first lead form.
   Builds on base.css: navy + safety yellow on paper.
═══════════════════════════════════════════ */
:root {
  --good: #23864a;
  --bad: #d23f31;
  --seg-1: #d23f31;
  --seg-2: #e2604f;
  --seg-3: #ec8270;
  --seg-4: #f3a392;
  --seg-5: #f7c3b6;
}

/* The calculator fills the first screen. The content below it is for search and scrollers. */
.rt-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

[hidden] {
  display: none !important;
}

/* ── TOP: back, logo, progress, pinned rate ── */
.rt-top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 2px solid var(--navy);
  padding: 10px 16px 12px;
  padding-top: max(10px, env(safe-area-inset-top));
}

.rt-row {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
}

.rt-back {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--navy);
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 6px;
  cursor: pointer;
}

.rt-back svg {
  width: 18px;
  height: 18px;
  transform: scaleX(-1);
}

.rt-back.is-hidden {
  visibility: hidden;
}

.rt-logo img {
  height: 22px;
  width: auto;
}

.rt-progress {
  max-width: 520px;
  height: 12px;
  margin: 10px auto 0;
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 99px;
  overflow: hidden;
}

.rt-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--yellow);
  transition: width .4s ease;
}

/* their rate, pinned under the header from the transition screen on */
.rt-pin {
  align-self: center;
  margin-top: 18px;
  padding: 8px 16px 6px;
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: var(--yellow);
  background: var(--navy);
  border-radius: 8px;
  box-shadow: 3px 3px 0 var(--yellow-dark);
}

.pop {
  animation: pop .45s cubic-bezier(.3, 1.6, .5, 1) both;
}

.rt-pin.pop {
  animation-delay: 1.9s;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(.4);
  }
}

/* ── SCREEN ── */
.rt-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 28px 16px 24px;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  animation: screen-in .35s ease both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.q {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 800;
  font-size: clamp(2.1rem, 9vw, 2.9rem);
  line-height: .95;
  text-transform: uppercase;
}

.sub {
  margin-top: 10px;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

.big {
  display: block;
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 800;
  font-size: clamp(4.5rem, 24vw, 7.5rem);
  line-height: .9;
  text-align: center;
  white-space: nowrap;
}

.big small {
  margin-left: .08em;
  font-size: .32em;
  color: var(--ink-soft);
}

.big.bad {
  color: var(--bad);
}

.lead-in,
.caption {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1;
  text-align: center;
}

.lead-in {
  font-size: 1.6rem;
}

/* small label above a question */
.eyebrow {
  margin-bottom: 8px;
  font-family: 'Permanent Marker', 'Comic Sans MS', cursive;
  font-size: 1.2rem;
  color: var(--blue);
}

.caption {
  font-size: 2rem;
}

.caption + .sub,
.sub.center {
  text-align: center;
}

/* ── SLIDER ── */
.dial {
  display: grid;
  gap: 18px;
}

.dial-num {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.nudge {
  flex: none;
  width: 44px;
  height: 44px;
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1;
  color: var(--navy);
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 50%;
  cursor: pointer;
}

.range {
  --p: 50%;
  width: 100%;
  height: 44px;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.range::-webkit-slider-runnable-track {
  box-sizing: content-box;
  height: 10px;
  background: linear-gradient(to right, var(--yellow) var(--p), var(--white) var(--p));
  border: 2px solid var(--navy);
  border-radius: 99px;
}

.range::-webkit-slider-thumb {
  width: 36px;
  height: 36px;
  margin-top: -13px;
  background: var(--yellow);
  border: 3px solid var(--navy);
  border-radius: 50%;
  box-shadow: 3px 3px 0 var(--navy);
  -webkit-appearance: none;
}

.range::-moz-range-track {
  height: 10px;
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 99px;
}

.range::-moz-range-progress {
  height: 10px;
  background: var(--yellow);
  border: 2px solid var(--navy);
  border-radius: 99px;
}

.range::-moz-range-thumb {
  width: 30px;
  height: 30px;
  background: var(--yellow);
  border: 3px solid var(--navy);
  border-radius: 50%;
  box-shadow: 3px 3px 0 var(--navy);
}

.range:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
  border-radius: 8px;
}

/* ── TAP TILES ── */
fieldset {
  border: 0;
  min-width: 0;
}

fieldset .q {
  margin-bottom: 14px;
  font-size: clamp(1.8rem, 8vw, 2.4rem);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.options {
  display: grid;
  gap: 10px;
}

.tile {
  min-height: 62px;
  padding: 8px 4px;
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 800;
  font-size: 1.7rem;
  line-height: 1;
  color: var(--navy);
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 8px;
  box-shadow: 3px 3px 0 var(--navy);
  cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease, background .1s ease;
}

.tile small {
  display: block;
  margin-top: 3px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
}

.options .tile {
  padding: 16px 18px;
  font-size: 1.5rem;
  text-align: left;
  text-transform: uppercase;
}

/* jobs-a-day graphic: van, then a house per job */
.route {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding-top: 14px;
}

.route-van {
  flex: none;
  width: 58px;
}

.route-van .van {
  position: static;
  width: 100%;
  animation: none;
}

.stop {
  flex: none;
  width: 38px;
  opacity: .3;
  transition: opacity .2s, transform .2s;
}

.stop.is-lit {
  opacity: 1;
  animation: pop .35s cubic-bezier(.3, 1.6, .5, 1);
}

.house {
  display: block;
  width: 100%;
  fill: none;
  stroke: var(--navy);
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.stop.is-lit .house path:first-child {
  fill: var(--yellow);
}

.leg {
  flex: 1;
  min-width: 6px;
  margin-bottom: 8px;
  border-top: 3px dashed var(--line);
}

.leg.is-lit {
  border-top-color: var(--navy);
}

.route-more {
  flex: none;
  margin: 0 0 4px 2px;
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1;
  opacity: .3;
}

.route-more.is-lit {
  opacity: 1;
}

.tile:active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--navy);
}

.tile[aria-pressed='true'] {
  background: var(--yellow);
}

/* ── TOOLTIP (labour burden) ── */
.tip {
  align-self: center;
  max-width: 320px;
  text-align: center;
}

.tip summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-weight: 600;
  list-style: none;
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: 99px;
  cursor: pointer;
}

.tip summary::-webkit-details-marker {
  display: none;
}

.tip summary i {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-size: .8rem;
  font-style: normal;
  font-weight: 700;
  color: var(--white);
  background: var(--navy);
  border-radius: 50%;
}

.tip p {
  margin-top: 10px;
  padding: 12px 14px;
  font-size: .95rem;
  color: var(--white);
  background: var(--navy);
  border-radius: 8px;
}

/* ── TRANSITION: their rate flies up to the pin ── */
.transition {
  display: grid;
  gap: 24px;
  text-align: center;
}

.fly {
  animation: fly 2.4s ease-in-out forwards;
}

@keyframes fly {
  0%,
  55% {
    opacity: 1;
    transform: none;
  }

  100% {
    opacity: 0;
    transform: translateY(-30vh) scale(.25);
  }
}

/* ── DRIVE PAYOFF: van and two stats ── */
.road {
  position: relative;
  height: 76px;
  border-bottom: 14px solid var(--navy);
  overflow: hidden;
}

.road::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 3px;
  background: repeating-linear-gradient(to right, var(--yellow) 0 18px, transparent 18px 34px);
}

.van {
  position: absolute;
  bottom: 0;
  left: calc(100% - 96px);
  width: 96px;
  animation: drive 2s cubic-bezier(.3, .1, .3, 1) both;
}

@keyframes drive {
  from {
    left: -100px;
  }
}

.van-body {
  fill: var(--yellow);
  stroke: var(--navy);
  stroke-width: 3;
  stroke-linejoin: round;
}

.van-glass {
  fill: #cfe0f5;
  stroke: var(--navy);
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.van-stripe {
  stroke: var(--navy);
  stroke-width: 3;
  stroke-linecap: round;
}

.van-wheel {
  fill: var(--navy);
  stroke: var(--paper);
  stroke-width: 3;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat {
  padding: 16px 14px;
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 10px;
  box-shadow: 4px 4px 0 var(--navy);
}

.stat b {
  display: block;
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 800;
  font-size: clamp(2.6rem, 13vw, 3.6rem);
  line-height: 1;
}

.stat.bad b {
  color: var(--bad);
}

.stat span {
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink-soft);
}

/* ── UNBILLED VS BILLED HOURS ── */
.bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  height: 200px;
  padding: 0 24px;
  border-bottom: 3px solid var(--navy);
}

.bar {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  min-height: 0;
}

.bar b {
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1;
}

.bar span {
  width: 100%;
  height: 0;
  min-height: 2px;
  border: 2px solid var(--navy);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  transition: height 1.1s cubic-bezier(.2, .8, .2, 1);
}

.bar em {
  order: 3;
  margin-bottom: -30px;
  font-style: normal;
  font-weight: 600;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.bar.bad b {
  color: var(--bad);
}

.bar.bad span {
  background: var(--bad);
}

.bar.good span {
  background: var(--good);
}

.screen-dollars_payoff .bars {
  margin-bottom: 20px;
}

/* ── WORKDAY BAR ── */
.workday {
  display: flex;
  height: 56px;
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 8px;
  box-shadow: 4px 4px 0 var(--navy);
  overflow: hidden;
}

.workday span {
  width: 0;
  transition: width 1.1s cubic-bezier(.2, .8, .2, 1);
}

.workday span + span {
  box-shadow: inset 2px 0 0 var(--white);
}

.seg-good {
  background: var(--good);
}

.seg-1 {
  background: var(--seg-1);
}

.seg-2 {
  background: var(--seg-2);
}

.seg-3 {
  background: var(--seg-3);
}

.seg-4 {
  background: var(--seg-4);
}

.seg-5 {
  background: var(--seg-5);
}

.legend {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  list-style: none;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.legend i {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.legend b {
  margin-left: auto;
}

/* ── PROFIT: a $1,000 bar split into pay & bills vs profit ── */
.split {
  --keep: 15%;
  display: grid;
  gap: 10px;
  text-align: center;
}

.split .big {
  color: var(--good);
}

/* bar plus the "healthy shops" bracket over the 10–20% end */
.split-track {
  position: relative;
  margin-top: 54px;
}

.split-healthy {
  position: absolute;
  right: 10%;
  bottom: calc(100% + 6px);
  width: 10%;
  height: 12px;
  border: 3px solid var(--navy);
  border-bottom: 0;
}

.split-healthy span {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
}

.split-of {
  margin-top: -6px;
  font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.split-of b {
  color: var(--ink);
}

.split-bar {
  display: flex;
  height: 56px;
  border: 2px solid var(--navy);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 4px 4px 0 var(--navy);
}

.split-costs {
  flex: 1;
  background: var(--navy) repeating-linear-gradient(to right, transparent 0 9px, rgba(255, 255, 255, .1) 9px 11px);
}

.split-keep {
  flex: none;
  width: var(--keep);
  background: var(--good) repeating-linear-gradient(to right, transparent 0 9px, rgba(255, 255, 255, .22) 9px 11px);
  border-left: 3px solid var(--yellow);
}

.split-legend {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.split-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.split-legend b {
  color: var(--ink);
}

.split-legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.split-legend .costs {
  background: var(--navy);
}

.split-legend .keep {
  background: var(--good);
}

/* ── CALCULATING ── */
.calc {
  display: grid;
  justify-items: center;
  gap: 24px;
  text-align: center;
}

.calc-ring {
  width: 80px;
  height: 80px;
  border: 8px solid var(--white);
  border-top-color: var(--yellow);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--navy), inset 0 0 0 2px var(--navy);
  animation: spin .9s linear infinite;
}

/* "Done!": the tick takes the spinner's place */
.calc .done-mark {
  display: none;
  margin-bottom: 0;
}

.calc.is-done .calc-ring {
  display: none;
}

.calc.is-done .done-mark {
  display: block;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

.calc-bar {
  width: 100%;
  height: 16px;
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 99px;
  overflow: hidden;
}

.calc-bar span {
  display: block;
  height: 100%;
  background: var(--yellow) repeating-linear-gradient(-45deg, transparent 0 8px, rgba(15, 27, 51, .12) 8px 16px);
  animation: fill 4.8s linear both;
}

/* stalls and spurts so it feels like real work; keyed to the --d delays on the checks */
@keyframes fill {
  0% { width: 0; }
  8% { width: 9%; }
  25% { width: 14%; }
  31% { width: 32%; }
  42% { width: 51%; }
  60% { width: 58%; }
  75% { width: 77%; }
  88% { width: 96%; }
  100% { width: 100%; }
}

.checks {
  display: grid;
  gap: 10px;
  list-style: none;
  text-align: left;
}

.checks li {
  position: relative;
  padding-left: 34px;
  font-weight: 600;
  animation: checked .3s var(--d) both;
}

.checks li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  background: var(--yellow);
  border: 2px solid var(--navy);
  border-radius: 5px;
}

.checks li::after {
  content: '';
  position: absolute;
  left: 8px;
  top: 3px;
  width: 6px;
  height: 12px;
  border: solid var(--navy);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

@keyframes checked {
  from {
    opacity: .3;
  }
}

/* ── EMAIL ── */
.email-form {
  display: grid;
  gap: 14px;
}

.email-form input {
  width: 100%;
  padding: 18px 16px;
  font: 500 1.2rem 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 8px;
}

.email-form input:focus {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

.email-form .btn,
.rt-foot .btn {
  justify-content: center;
  width: 100%;
  cursor: pointer;
}

.btn:disabled {
  opacity: .6;
  cursor: wait;
}

.err {
  font-weight: 600;
  color: var(--bad);
}

.fine {
  font-size: .85rem;
  text-align: center;
  color: var(--ink-soft);
}

.done {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.done-mark {
  position: relative;
  width: 84px;
  height: 84px;
  margin-bottom: 12px;
  background: var(--yellow);
  border: 3px solid var(--navy);
  border-radius: 50%;
  box-shadow: 4px 4px 0 var(--navy);
  animation: pop .5s cubic-bezier(.3, 1.6, .5, 1) both;
}

.done-mark::after {
  content: '';
  position: absolute;
  left: 29px;
  top: 14px;
  width: 18px;
  height: 36px;
  border: solid var(--navy);
  border-width: 0 6px 6px 0;
  transform: rotate(45deg);
}

/* ── FOOTER BUTTON ── */
.rt-foot {
  position: sticky;
  bottom: 0;
  padding: 12px 16px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--paper) 75%, rgba(244, 241, 234, 0));
}

.rt-foot .btn {
  display: flex;
  max-width: 520px;
  margin: 0 auto;
}

/* ── CONTENT BELOW THE TOOL ── */
.rt-info {
  padding-block: clamp(48px, 8vw, 88px);
  border-top: 2px solid var(--navy);
}

.rt-info .prose,
.rt-faq {
  max-width: 760px;
  margin: 0 auto;
}

.rt-faq {
  margin-top: clamp(48px, 7vw, 72px);
}

.rt-faq h2 {
  margin-bottom: 24px;
  font-size: clamp(2rem, 5vw, 2.8rem);
}

.rt-faq .faq {
  max-width: none;
}

.rt-cta {
  margin-top: 40px;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
  }

  .fly {
    animation: none;
  }
}
