/* ============================================================
   W-4 (2026) – High-Fidelity IRS PDF Match
   Branding: Fredoka headers · #01887c accent
   Visual: Minimal borders, thin lines, government form style
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&display=swap');

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ---------- Body ---------- */
body {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  line-height: 1.4;
  color: #000;
  background: #e8e8e8;
  padding: 0;
  margin: 0;
}

/* ---------- Webpage Header ---------- */
.page-header {
  background: #fff;
  border-bottom: 3px solid #01887c;
  padding: 0;
  margin: 0;
}

.page-header-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 15px 18px;
}

.nav-back {
  display: inline-block;
  color: #01887c;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s;
}

.nav-back:hover {
  color: #016961;
  text-decoration: underline;
}

/* ---------- Page wrapper ---------- */
.page-wrapper {
  max-width: 820px;
  margin: 20px auto;
  background: #fff;
  border: 1px solid #000;
  padding: 14px 18px;
}

/* ============================================================
   HEADER – 3-column layout matching PDF
   ============================================================ */
.form-header {
  display: flex;
  align-items: flex-start;
  border-bottom: 2px solid #000;
  padding-bottom: 10px;
  margin-bottom: 10px;
  gap: 20px;
}

.fh-left {
  flex: 0 0 auto;
  min-width: 160px;
}

.form-id {
  margin-bottom: 6px;
}

.form-word {
  font-size: 11px;
  font-weight: normal;
  color: #000;
}

.form-num {
  font-family: 'Fredoka', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #000;
  letter-spacing: 0.5px;
}

.dept-name {
  font-size: 9px;
  font-weight: bold;
  line-height: 1.4;
  color: #000;
}

.fh-center {
  flex: 1;
  text-align: center;
  padding: 0 16px;
  border-left: 1px solid #000;
  border-right: 1px solid #000;
}

.form-title-center {
  font-family: 'Fredoka', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #000;
  margin: 0 0 8px 0;
  line-height: 1.2;
}

.center-inst {
  font-size: 9px;
  line-height: 1.4;
  margin: 3px 0;
  text-align: center;
  white-space: nowrap;
}

.fh-right {
  flex: 0 0 auto;
  min-width: 120px;
  text-align: right;
}

.omb {
  font-size: 9.5px;
  font-weight: bold;
  white-space: nowrap;
  margin-bottom: 2px;
}

.omb-line {
  height: 1px;
  background: #000;
  margin: 3px 0 8px 0;
}

.year-display {
  font-family: 'Fredoka', sans-serif;
  font-size: 40px;
  line-height: 1;
  letter-spacing: 1px;
}

.year-light {
  font-weight: 400;
  color: transparent;
  -webkit-text-stroke: 1.5px #000;
  text-stroke: 1.5px #000;
}

.year-bold {
  font-weight: 700;
  color: #000;
}

/* ============================================================
   SECTION LAYOUT – Step column + body (NO HEAVY BORDERS)
   ============================================================ */
.form-section {
  display: flex;
  align-items: stretch;
  border-top: 1px solid #000;
}

.form-section:first-of-type {
  border-top: none;
}

.bdr-top  { border-top: 1px solid #000; }
.bdr-left { border-left: 1px solid #000; }

.step-col {
  flex: 0 0 82px;
  border-right: 1px solid #000;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.step-tag {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 11px;
  color: #000;
  white-space: nowrap;
}

.step-desc {
  font-family: 'Fredoka', sans-serif;
  font-size: 9.5px;
  font-weight: 600;
  color: #01887c;
  margin-top: 3px;
  line-height: 1.3;
}

.step-body {
  flex: 1;
  padding: 8px 12px;
  min-width: 0;
}

/* ============================================================
   STEP 1 — Personal info (NO OUTER BORDER)
   ============================================================ */
.personal-grid {
  display: flex;
  align-items: stretch;
  border: 1px solid #666;
  margin-bottom: 6px;
}

.personal-left {
  flex: 1 1 auto;
}

.personal-right {
  flex: 0 0 220px;
  padding: 5px 8px;
  border-left: 1px solid #666;
}

.name-row {
  display: flex;
}

.field-cell {
  padding: 4px 6px;
  min-width: 0;
  flex: 1;
  border-top: 1px solid #666;
}

.name-row .field-cell {
  border-top: none;
}

.name-row .field-cell.bdr-left {
  border-left: 1px solid #666;
}

.flabel {
  display: block;
  font-size: 8px;
  color: #000;
  margin-bottom: 2px;
  line-height: 1.2;
}

.finput {
  display: block;
  font-size: 10px;
  border: none;
  border-bottom: 1px solid #666;
  background: transparent;
  padding: 2px 3px;
  outline: none;
  width: 100%;
}

.finput.w100 { width: 100%; }

.finput.ro {
  background: #f7f7f7;
  cursor: default;
  color: #333;
}

.ssn-field { margin-bottom: 6px; }

.ssn-note {
  font-size: 7.5px;
  line-height: 1.35;
  color: #333;
  background: #f9f9f9;
  border: 1px solid #ccc;
  padding: 5px 6px;
  margin-top: 4px;
}

/* Filing status */
.filing-section {
  display: flex;
  padding: 6px 0;
  gap: 8px;
  border-top: 1px solid #666;
}

.filing-c-label {
  font-size: 9.5px;
  font-weight: bold;
  margin-top: 2px;
  flex-shrink: 0;
}

.filing-radios {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.rrow {
  display: flex;
  align-items: flex-start;
  font-size: 10px;
  cursor: pointer;
  gap: 6px;
}

.rrow input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
}

/* Caution bar */
.caution-bar {
  padding: 7px 0;
  font-size: 9.5px;
  line-height: 1.4;
  border-top: 1px solid #666;
}

/* TIP SECTION — Outside Step 1, simple text paragraphs */
.tip-section {
  padding: 8px 12px;
  font-size: 9px;
  line-height: 1.4;
}

.tip-para {
  margin-bottom: 6px;
  font-size: 9px;
  line-height: 1.4;
}

.tip-para:last-child {
  margin-bottom: 0;
}

.brand-accent { color: #01887c; }

/* ============================================================
   STEP 2 (NO OUTER BORDER)
   ============================================================ */
.bp {
  font-size: 10px;
  line-height: 1.45;
  margin-bottom: 6px;
}

.note-italic {
  font-size: 9px;
  line-height: 1.4;
  padding: 6px 0 2px;
  color: #333;
}

/* Inline dots and checkbox for option (c) */
.dots-inline {
  letter-spacing: 2px;
  margin: 0 4px;
  color: #555;
}

.inline-chk {
  accent-color: #01887c;
  width: 13px;
  height: 13px;
  margin-left: 4px;
  vertical-align: middle;
}

/* ============================================================
   STEPS 3 & 4 — Input rows (NO HEAVY BORDERS)
   ============================================================ */
.irow {
  display: flex;
  align-items: center;
  padding: 6px 0;
  gap: 10px;
  min-height: 32px;
  border-top: 1px solid #666;
}

.irow:first-child {
  border-top: none;
}

.irow-label {
  flex: 1;
  font-size: 10px;
  line-height: 1.4;
  padding-right: 8px;
}

/* Sub-lines (3a, 3b) indented */
.sub-line .irow-label {
  padding-left: 16px;
}

.irow-entry {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.lineref {
  font-size: 9.5px;
  color: #555;
  min-width: 28px;
  text-align: right;
}

.dlr {
  font-size: 11px;
  font-weight: bold;
}

.mfield {
  width: 100px;
  border: none;
  border-bottom: 1px solid #666;
  padding: 3px 5px;
  font-size: 11px;
  text-align: right;
  font-family: 'Courier New', monospace;
  background: #fafafa;
  outline: none;
}

.mfield:focus {
  border-bottom-color: #01887c;
  background: #f0faf9;
}

.mfield.invalid { 
  border-bottom-color: #c62828;
  background: #fff8f8;
}

/* Total line */
.total-line .irow-label { 
  font-weight: normal;
  padding-left: 0;
}

.total-field {
  border-bottom: 2px solid #000;
  font-weight: bold;
}

/* ============================================================
   EXEMPT FROM WITHHOLDING — standalone (NO HEAVY BORDER)
   ============================================================ */
.exempt-section .step-col { 
  background: #f8f8f8;
}

.exempt-tag {
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.3;
  color: #000;
  font-family: 'Fredoka', sans-serif;
}

.exempt-body { 
  padding: 8px 12px;
}

.exempt-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.exempt-text {
  flex: 1;
  font-size: 10px;
  line-height: 1.45;
}

.exempt-chk-col {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.exempt-chk-col input[type="checkbox"] {
  accent-color: #01887c;
  width: 13px;
  height: 13px;
}

.exempt-chk-txt {
  font-size: 10px;
  font-weight: bold;
  color: #01887c;
}

/* ============================================================
   STEP 5 — Sign Here (MINIMAL BORDER)
   ============================================================ */
.sign-stmt {
  margin-bottom: 8px;
  font-size: 10px;
}

.sign-row {
  display: flex;
  gap: 0;
  border: 1px solid #666;
}

.sign-cell {
  flex: 1;
  padding: 5px 8px;
  min-height: 40px;
}

.sign-cell.bdr-left {
  border-left: 1px solid #666;
}

.sig-line {
  margin-top: 4px;
  border-bottom: 1px solid #000;
  min-height: 20px;
}

/* ============================================================
   EMPLOYERS ONLY (MINIMAL BORDER)
   ============================================================ */
.employer-row .step-col { 
  background: #f8f8f8;
}

.employer-grid {
  display: flex;
  flex: 1;
  border: 1px solid #666;
  margin: 8px 0;
}

.emp-cell {
  padding: 5px 8px;
  min-height: 44px;
}

.emp-name { flex: 2; }
.emp-date { flex: 1; }
.emp-ein  { flex: 1; }

.emp-cell.bdr-left {
  border-left: 1px solid #666;
}

.emp-blank {
  margin-top: 4px;
  border-bottom: 1px solid #666;
  min-height: 20px;
}

/* ============================================================
   VALIDATION ERROR
   ============================================================ */
.err-msg {
  display: none;
  color: #c62828;
  font-size: 9.5px;
  padding: 4px 8px;
  background: #fff3f3;
  border-left: 3px solid #c62828;
  margin: 4px 0;
}

.err-msg.show { 
  display: block;
}

/* ============================================================
   RESET BUTTON
   ============================================================ */
.btn-wrap {
  text-align: center;
  padding: 20px 0 12px;
  border-top: 1px solid #ccc;
  margin-top: 10px;
}

.btn-reset {
  font-family: 'Fredoka', sans-serif;
  font-size: 14px;
  font-weight: 600;
  background-color: #01887c;
  color: #fff;
  border: none;
  padding: 10px 32px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
  letter-spacing: 0.4px;
}

.btn-reset:hover  { background-color: #016b61; }
.btn-reset:active { background-color: #015549; }

/* ============================================================
   FOOTER
   ============================================================ */
.form-foot {
  border-top: 1px solid #000;
  padding: 6px 0 2px;
  font-size: 8.5px;
  color: #444;
  text-align: center;
  margin-top: 10px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 680px) {
  .page-header-inner {
    padding: 12px 15px;
  }

  .page-wrapper {
    margin: 15px 10px;
  }

  .form-header { flex-direction: column; gap: 10px; }
  .fh-center { text-align: left; padding: 8px 0; }
  .fh-right { text-align: left; }

  .personal-grid { flex-direction: column; }
  .personal-right { border-left: none; border-top: 1px solid #666; }

  .name-row { flex-direction: column; }
  .field-cell.bdr-left { border-left: none; border-top: 1px solid #666; }

  .sign-row  { flex-direction: column; }
  .sign-cell.bdr-left { border-left: none; border-top: 1px solid #666; }
  
  .employer-grid { flex-direction: column; }
  .emp-cell.bdr-left { border-left: none; border-top: 1px solid #666; }

  .irow { flex-wrap: wrap; }
  .irow-entry { margin-left: auto; }

  .exempt-row { flex-direction: column; align-items: flex-start; }
  .option-c-block { flex-direction: column; }
}

@media print {
  .page-header { display: none; }
  body { background: #fff; padding: 0; }
  .page-wrapper { border: none; margin: 0; }
  .btn-wrap { display: none; }
}

/* Remove right border from step columns */
.no-right-border {
  border-right: none !important;
}

/* Outside note styling */
.outside-note {
  padding: 8px 12px;
}

.note-plain {
  font-size: 9px;
  line-height: 1.4;
  margin: 0;
}

/* Step 3 input alignment to match Step 4 */
.step3-input {
  margin-right: 0;
}

/* Make Step 3 irow-entry match Step 4 width for alignment */
.sub-line .irow-entry,
.total-line .irow-entry {
  min-width: 140px;
}

.sub-line .irow-label {
  padding-left: 10px;
}

.total-line .irow-label {
  padding-left: 0;
}

/* Step 5 clean signature (no borders) */
.sign-row-clean {
  display: flex;
  gap: 20px;
  margin-top: 10px;
}

.sign-cell-clean {
  flex: 1;
}

.sig-line-clean {
  border-bottom: 1px solid #000;
  min-height: 24px;
  margin-bottom: 4px;
}

.date-line-clean {
  max-width: 150px;
}

.flabel-below {
  display: block;
  font-size: 8px;
  color: #000;
  line-height: 1.2;
}

/* Employers section clean (no visible borders) */
.employer-grid-clean {
  display: flex;
  gap: 20px;
  margin: 10px 0;
}

.emp-cell-clean {
  flex: 1;
}

.emp-name {
  flex: 2;
}

.emp-line-clean {
  border-bottom: 1px solid #000;
  min-height: 24px;
  margin-bottom: 4px;
}

.short-emp-line {
  max-width: 200px;
}

/* Footer 3-column layout */
.form-foot-3col {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #000;
  padding: 6px 0 2px;
  font-size: 8.5px;
  color: #444;
  margin-top: 10px;
}

.foot-left {
  text-align: left;
  flex: 1;
}

.foot-center {
  text-align: center;
  flex: 0 0 auto;
  padding: 0 20px;
}

.foot-right {
  text-align: right;
  flex: 1;
}

/* Responsive footer */
@media (max-width: 680px) {
  .form-foot-3col {
    flex-direction: column;
    text-align: center;
    gap: 4px;
  }
  
  .foot-left,
  .foot-center,
  .foot-right {
    text-align: center;
    padding: 0;
  }
}

/* ============================================================
   TOOLTIPS
   ============================================================ */
.tooltip-icon {
  background: none;
  border: none;
  color: #01887c;
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 1;
  transition: color 0.2s;
}

.tooltip-icon:hover {
  color: #016961;
}

.tooltip-icon:focus {
  outline: 2px solid #01887c;
  outline-offset: 2px;
}

.tooltip-content {
  background: #f0faf9;
  border: 2px solid #01887c;
  border-radius: 4px;
  padding: 10px 12px;
  margin: 8px 0;
  display: none;
}

.tooltip-content[hidden] {
  display: none;
}

.tooltip-content:not([hidden]) {
  display: block;
}

.tooltip-text {
  font-size: 10px;
  line-height: 1.5;
  color: #000;
}
