/*
  Pay Myself — Contractor Salary Estimator
  Stream Brand High-Level Design: Rugged Tech + Contractor-Professional
*/

:root {
  /* Brand Palette */
  --cta: #26A5DC;
  --cta-hover: #1E92C2;
  --cta-press: #157CA6;
  --navy: #152331;
  --muted: #64748B;
  --bg: #F2F2F2;
  --card: #FFFFFF;
  --border: #E5E7EB;
  --error: #E11D48;
  --success: #16A34A;
  --shadow: 0 10px 26px rgba(21, 35, 49, 0.10);
  --focus: 0 0 0 3px rgba(38, 165, 220, 0.25);

  /* Component Radii */
  --r-card: 6px;
  --r-input: 4px;
  --r-btn: 5px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--navy);
  background: var(--bg);
  line-height: 1.5;
}

/* Container */
.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

/* Header */
.app-header {
  text-align: center;
  padding: 36px 16px 18px;
}

.app-header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: 0.2px;
}

.tagline {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

/* Screens */
.screen {
  display: none;
}

.screen.active {
  display: block;
}

.results-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 96px;
  display: grid;
  gap: 32px;
}

.gauge-card {
  background: #071734;
  color: #f8fafc;
  border-radius: 24px;
  padding: 42px 32px 36px;
  text-align: center;
  box-shadow: 0 26px 60px -34px rgba(15, 23, 42, 0.6);
  position: relative;
  overflow: hidden;
}

.gauge-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% -40%, rgba(255, 255, 255, 0.22), transparent 60%);
  opacity: 0.85;
  pointer-events: none;
}

.gauge-card > * {
  position: relative;
  z-index: 1;
}

.gauge-header {
  margin-bottom: 28px;
}

.gauge-heading {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(248, 250, 252, 0.68);
}

.gauge-range {
  margin: 10px 0 0;
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  font-weight: 700;
  color: #4ade80;
}

.gauge-image {
  position: relative;
  width: min(320px, 80vw);
  margin: 0 auto;
}

.gauge-img {
  width: 100%;
  height: auto;
  display: none;
}

.gauge-img--desktop {
  display: block;
}

.gauge-legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  list-style: none;
  padding: 12px 0 0;
  margin: 0;
  color: rgba(248, 250, 252, 0.76);
  font-size: 0.95rem;
}

.gauge-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gauge-back-btn {
  margin-top: 28px;
  padding: 11px 28px;
  border: 1.5px solid rgba(248, 250, 252, 0.28);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.07);
  color: rgba(248, 250, 252, 0.82);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.gauge-back-btn:hover {
  border-color: rgba(248, 250, 252, 0.5);
  background: rgba(248, 250, 252, 0.13);
  color: #f8fafc;
}

.gauge-back-btn:active {
  background: rgba(248, 250, 252, 0.18);
}

.gauge-back-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(38, 165, 220, 0.4);
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 6px 14px -6px rgba(15, 23, 42, 0.6);
}

.dot--risk { background: #f87171; }
.dot--efficient { background: #22c55e; }
.dot--conservative { background: #94a3b8; }

.gauge-meta {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 20px 0 0;
  flex-wrap: wrap;
}

.meta-item {
  flex: 1 1 140px;
  min-width: 140px;
  background: rgba(15, 23, 42, 0.45);
  border-radius: 14px;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid rgba(248, 250, 252, 0.08);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.2);
}

.meta-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(248, 250, 252, 0.62);
  margin-bottom: 4px;
}

.meta-value {
  display: block;
  font-weight: 700;
  font-size: 1.05rem;
  color: #f8fafc;
}


.comp-breakdown {
  background: var(--card);
  border-radius: var(--r-card);
  padding: 24px 28px;
  box-shadow: 0 18px 42px -28px rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.comp-breakdown h4 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy);
}

#comp-breakdown-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

#comp-breakdown-summary span {
  display: block;
  margin-bottom: 6px;
  color: var(--navy);
}

#comp-breakdown-summary span:last-child {
  margin-bottom: 0;
}

/* Card */
.card {
  background: var(--card);
  border: 1px solid #e9eef3;
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 24px 24px 20px;
  margin: 20px auto;
}

/* Step Header + Progress Bar */
.progress-wrap {
  margin-bottom: 10px;
}

.progress-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.step-name {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: #1B2A3A;
  border-radius: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cta), var(--cta-hover));
  width: 0;
  transition: width 260ms cubic-bezier(.22, .61, .36, 1);
}

/* Form Fields */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
  color: #324350;
}

.help {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 6px;
}

/* Inputs & Selects */
input[type="text"],
input[type="email"],
input[type="number"],
select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-input);
  outline: none;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

::placeholder {
  color: #9AA3AD;
}

input:focus,
select:focus {
  border-color: var(--cta);
  box-shadow: var(--focus);
}

/* Range Input */
.range-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--cta);
}

input[type="range"]::-webkit-slider-runnable-track,
input[type="range"]::-moz-range-track {
  height: 6px;
  background: #203040;
  border-radius: 6px;
}

input[type="range"]::-webkit-slider-thumb,
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cta);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  margin-top: -6px;
}

/* Grids */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 600px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* Fieldsets & Radio Groups */
.fieldset {
  border: 1px solid var(--border);
  border-radius: var(--r-input);
  padding: 12px;
  margin-bottom: 16px;
}

.fieldset legend {
  font-weight: 700;
  padding: 0 4px;
}

.radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}

.radio-group label {
  border: 1px solid var(--border);
  border-radius: var(--r-input);
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.radio-group input[type="radio"] {
  accent-color: var(--cta);
}

.radio-group label:has(input:checked) {
  border-color: var(--cta);
  box-shadow: var(--focus);
  background: #F8FDFF;
}

/* Navigation */
.total-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #EEF1F4;
}

.nav-row.end {
  justify-content: flex-end;
}

/* Buttons */
.btn,
.btn-primary {
  appearance: none;
  border: none;
  border-radius: var(--r-btn);
  padding: 12px 16px;
  font-weight: 800;
  background: var(--cta);
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 10px rgba(38, 165, 220, 0.22);
}

.btn-primary:hover {
  background: var(--cta-hover);
  transform: translateY(-1px);
}

.btn-primary:active {
  background: var(--cta-press);
  transform: translateY(0);
}

.btn:focus-visible,
.btn-primary:focus-visible {
  box-shadow: var(--focus);
  outline: none;
}

.btn-secondary {
  background: #EEF2F6;
  color: var(--navy);
  box-shadow: none;
  font-weight: 700;
  border-radius: var(--r-btn);
}

.btn-secondary[disabled] {
  background: #F3F5F8;
  color: #9AA3AD;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Results Page */
.range-row-lg {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0.5rem 0 0.25rem;
}

.range-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: 0.2px;
}

.dash {
  color: var(--muted);
}

.status-row {
  margin: 0.5rem 0 1rem;
}

.badge {
  background: #DCFCE7;
  color: #166534;
  padding: 0.35rem 0.6rem;
  border: 1px solid #BBF7D0;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
}

/* Tables / Model Cards */
.table-like {
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  overflow: hidden;
}

.table-like .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.table-like .row:last-child {
  border-bottom: none;
}

.model-card {
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 14px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.model-card h4 {
  margin: 0 0 8px;
}

.model-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.model-list li {
  padding: 4px 0;
}

/* Footer */
.app-footer {
  margin: 32px 0 16px;
  color: var(--muted);
  text-align: center;
}
/* Percent unit inside inputs */
.input-wrap{ position: relative; }
.input-wrap.pct input{ padding-right: 2.25rem; }
.input-wrap .unit{ position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; pointer-events: none; }
.input-wrap.pct input:focus + .unit{ color: #324350; }
@supports (-webkit-appearance: none) or (-webkit-appearance: textfield) {
  .input-wrap.pct input{ padding-right: 2.75rem; }
  .input-wrap .unit{ right: 34px; }
}
/* Percent unit inside number inputs (role fields) */
.input-wrap{position:relative}
.input-wrap.pct input{padding-right:3rem}
.input-wrap .unit{
  position:absolute; right:34px; top:50%; transform:translateY(-50%);
  color:var(--muted); font-weight:700; pointer-events:none; line-height:1
}
/* Keep WebKit steppers visible and avoid overlap */
input[type=number]::-webkit-inner-spin-button{margin-right:1.25rem}
.input-wrap.pct input:focus + .unit{color:#324350}

@media (max-width: 640px) {
  .results-container {
    max-width: none;
    padding: 0;
  }

  .gauge-card {
    border-radius: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 72px 24px;
  }

  .gauge-img--desktop {
    display: none;
  }

  .gauge-img--mobile {
    display: block;
  }

  .gauge-heading {
    font-size: 0.92rem;
  }

  .gauge-range {
    font-size: clamp(1.6rem, 6vw, 2.1rem);
  }

  .gauge-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .meta-item {
    min-width: 100%;
  }
}

/* ── Data notice footer ────────────────────────────────── */
.app-footer {
  text-align: center;
  padding: 0.75rem 1rem 1.25rem;
}

.data-notice {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}
