/* 401K Retirement Calculator Styles - Calculator Archive Exact Clone */

:root {
  --k-navy: #1b365d;
  --k-blue-header: #2f5c94;
  --k-blue-subhdr: #3b73af;
  --k-blue-subhdr-dark: #224b7a;
  --k-blue-link: #0844a4;
  --k-blue-link-hover: #002277;
  --k-green-btn: #449d44;
  --k-green-btn-hover: #398439;
  --k-gray-btn: #94a3b8;
  --k-gray-btn-hover: #64748b;
  --k-border: #cbd5e1;
  --k-border-dark: #7f9db9;
  --k-bg-light: #f8fafc;
  --k-bg-alt: #f1f5f9;
  --k-bg-card: #fbfbfc;
  --k-text: #333333;
  --k-text-dark: #0f172a;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--k-text);
  background-color: #ffffff;
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

.k-page-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 10px 14px 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
}

/* Breadcrumbs Row */
.k-breadcrumbs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.k-breadcrumbs {
  font-size: 13px;
  color: var(--k-blue-link);
}
.k-breadcrumbs a {
  color: var(--k-blue-link);
  text-decoration: none;
}
.k-breadcrumbs a:hover {
  text-decoration: underline;
}
.k-breadcrumbs span {
  color: #777777;
  margin: 0 4px;
}
.k-breadcrumbs .crumb-current {
  color: #333333;
}

/* Top Actions */
.k-top-links {
  display: flex;
  align-items: center;
  gap: 14px;
}
.k-top-link-btn {
  background: none;
  border: none;
  color: var(--k-blue-link);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.k-top-link-btn:hover {
  color: var(--k-blue-link-hover);
}

/* Page Title & Intro */
.k-main-title {
  font-size: 24px;
  font-weight: bold;
  color: #0844a4;
  margin: 0 0 6px 0;
  line-height: 1.25;
}

.k-main-desc {
  font-size: 13px;
  line-height: 1.5;
  color: #222222;
  margin: 0 0 14px 0;
}

/* Layout Split: Content (left) vs Sidebar (right) */
.k-layout-grid {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.k-content-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.k-sidebar-col {
  width: 270px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (max-width: 860px) {
  .k-layout-grid {
    flex-direction: column;
  }
  .k-sidebar-col {
    width: 100%;
  }
}

/* Calculator Section Containers */
.k-calc-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.k-section-title {
  font-size: 17px;
  font-weight: bold;
  color: #0844a4;
  margin: 0 0 4px 0;
}

.k-section-desc {
  font-size: 13px;
  color: #333333;
  margin: 0 0 8px 0;
  line-height: 1.45;
}

/* Calculator 1: Side-by-side Dual Column Form Container */
.k-dual-box-container {
  display: flex;
  border: 1px solid #7f9db9;
  background: #fbfbfc;
  box-sizing: border-box;
}

.k-dual-subbox {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.k-dual-subbox:first-child {
  border-right: 1px solid #c0c6cc;
}

@media (max-width: 620px) {
  .k-dual-box-container {
    flex-direction: column;
  }
  .k-dual-subbox:first-child {
    border-right: none;
    border-bottom: 1px solid #c0c6cc;
  }
}

.k-subbox-header {
  background-color: var(--k-blue-header);
  color: #ffffff;
  font-weight: bold;
  font-size: 13.5px;
  padding: 6px 12px;
  border-bottom: 1px solid #1e4b7a;
}

/* Table Style for Form Inputs */
.k-form-table {
  width: 100%;
  border-collapse: collapse;
}

.k-form-table td {
  padding: 6px 10px;
  font-size: 13px;
  vertical-align: middle;
}

.k-form-table td.k-label-td {
  color: #000000;
  width: 58%;
}

.k-form-table td.k-input-td {
  color: #222222;
  width: 42%;
  white-space: nowrap;
}

/* Single Box Form Container (for Calculator 2 & 3) */
.k-single-box {
  border: 1px solid #7f9db9;
  background: #fbfbfc;
  box-sizing: border-box;
  max-width: 540px;
}

.k-single-box .k-form-table td.k-label-td {
  width: 54%;
}
.k-single-box .k-form-table td.k-input-td {
  width: 46%;
}

/* Input Fields */
.k-input {
  border: 1px solid var(--k-border-dark);
  background: #ffffff;
  border-radius: 2px;
  height: 24px;
  padding: 2px 6px;
  font-size: 13px;
  font-family: inherit;
  color: #000000;
  outline: none;
  box-sizing: border-box;
  vertical-align: middle;
}

.k-input:focus {
  border-color: #003366;
}

.k-input-sm {
  width: 55px;
  text-align: right;
}

.k-input-md {
  width: 85px;
  text-align: right;
}

.k-input-lg {
  width: 100px;
  text-align: right;
}

.k-unit-label {
  font-size: 12px;
  color: #333333;
  margin-left: 4px;
}

/* Radio Group */
.k-radio-group {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}

.k-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

/* Button Bar */
.k-btn-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 6px 0;
}

.k-calc-btn {
  background: #449d44;
  border: 1px solid #398439;
  color: #ffffff;
  font-weight: bold;
  font-size: 13px;
  padding: 5px 14px 6px;
  cursor: pointer;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.k-calc-btn:hover {
  background: #398439;
}

.k-clear-btn {
  background: #94a3b8;
  border: 1px solid #64748b;
  color: #ffffff;
  font-size: 13px;
  padding: 5px 12px 6px;
  cursor: pointer;
  border-radius: 3px;
  font-family: inherit;
}

.k-clear-btn:hover {
  background: #64748b;
}

.k-save-link-btn {
  background: none;
  border: none;
  color: var(--k-blue-link);
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  margin-left: 8px;
  font-family: inherit;
}

.k-save-link-btn:hover {
  color: var(--k-blue-link-hover);
}

/* Results Display Box */
.k-result-container {
  background: #f4f8fb;
  border: 1px solid #b8d0e8;
  border-radius: 3px;
  padding: 14px 16px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.k-result-title {
  font-size: 16px;
  font-weight: bold;
  color: #003366;
  margin: 0;
}

.k-big-stat-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: stretch;
}

.k-stat-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 10px 14px;
  flex: 1;
  min-width: 170px;
}

.k-stat-card.highlight {
  border-color: #2b6cb0;
  background: #f0f7ff;
}

.k-stat-label {
  font-size: 11.5px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.k-stat-value {
  font-size: 22px;
  font-weight: bold;
  color: #0844a4;
  line-height: 1.2;
}

.k-stat-sub {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
}

/* Visuals: SVG Chart & Donut */
.k-visuals-grid {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.k-chart-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 12px;
  flex: 2;
  min-width: 280px;
}

.k-donut-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 12px;
  flex: 1;
  min-width: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.k-chart-title {
  font-size: 13px;
  font-weight: bold;
  color: #1e293b;
  margin: 0 0 8px 0;
  text-align: center;
}

.k-legend-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 11.5px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.k-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.k-legend-color {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* Schedule Table */
.k-schedule-wrap {
  margin-top: 10px;
}

.k-schedule-toggle-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #1e4b7a;
  font-size: 12px;
  font-weight: bold;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.k-schedule-toggle-btn:hover {
  background: #e2e8f0;
}

.k-schedule-table-box {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid #cbd5e1;
  margin-top: 8px;
  background: #ffffff;
}

.k-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: right;
}

.k-data-table th {
  background: #2b6cb0;
  color: #ffffff;
  padding: 6px 8px;
  font-weight: bold;
  position: sticky;
  top: 0;
  z-index: 2;
}

.k-data-table th:first-child,
.k-data-table td:first-child {
  text-align: center;
}

.k-data-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #e2e8f0;
}

.k-data-table tr:nth-child(even) {
  background: #f8fafc;
}

.k-data-table tr.highlight-retire {
  background: #fef3c7;
  font-weight: bold;
}

/* Early Withdrawal & Maximize Match Breakdown Tables */
.k-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.k-breakdown-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #e2e8f0;
}

.k-breakdown-table tr:last-child td {
  border-bottom: none;
}

.k-breakdown-table td.val-col {
  text-align: right;
  font-weight: bold;
}

.k-penalty-bar-box {
  width: 100%;
  height: 20px;
  background: #e2e8f0;
  border-radius: 3px;
  display: flex;
  overflow: hidden;
  margin-top: 6px;
}

.k-bar-net {
  background: #449d44;
  height: 100%;
}

.k-bar-tax {
  background: #2b6cb0;
  height: 100%;
}

.k-bar-penalty {
  background: #dc2626;
  height: 100%;
}

/* ================= FRACTION ARITHMETIC SECTION ================= */
.k-fraction-section {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.k-fraction-title {
  font-size: 16.5px;
  font-weight: bold;
  color: #0844a4;
  margin: 0 0 6px 0;
}

.k-fraction-desc {
  font-size: 13px;
  color: #334155;
  margin: 0 0 14px 0;
  line-height: 1.5;
}

.k-fraction-card {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 14px;
  border-radius: 4px;
}

.k-fraction-form {
  flex: 1;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.k-fraction-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.k-frac-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.k-frac-input {
  width: 48px;
  height: 24px;
  text-align: center;
  font-size: 13px;
  border: 1px solid #7f9db9;
  border-radius: 2px;
}

.k-frac-bar {
  width: 46px;
  height: 2px;
  background: #334155;
  margin: 1px 0;
}

.k-frac-op-select {
  height: 28px;
  font-size: 15px;
  font-weight: bold;
  padding: 0 4px;
  border: 1px solid #7f9db9;
  border-radius: 2px;
  background: #ffffff;
}

.k-fraction-results {
  flex: 1;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 12px;
}

.k-frac-output-display {
  display: flex;
  justify-content: space-around;
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  padding: 10px;
  border-radius: 3px;
  text-align: center;
}

.k-frac-big-res {
  font-size: 20px;
  font-weight: bold;
  color: #1b365d;
}

.k-frac-dec-tag {
  background: #1b365d;
  color: #ffffff;
  font-weight: bold;
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 2px;
  display: inline-block;
  margin-top: 2px;
}

.k-frac-steps-box {
  font-size: 12px;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 8px 10px;
  border-radius: 2px;
  line-height: 1.45;
}

/* ================= SIDEBAR STYLING ================= */
.k-sidebar-search-box {
  background: #fbfbfc;
  border: 1px solid #7f9db9;
  padding: 10px;
  box-sizing: border-box;
}

.k-sidebar-search-input-wrap {
  display: flex;
  gap: 4px;
  position: relative;
}

.k-sidebar-search-input {
  flex: 1;
  height: 25px;
  border: 1px solid #7f9db9;
  padding: 2px 6px;
  font-size: 12px;
  outline: none;
  font-family: inherit;
  border-radius: 2px;
}

.k-sidebar-search-btn {
  background: #224b7a;
  color: #ffffff;
  border: 1px solid #1e3f66;
  font-size: 12px;
  font-weight: bold;
  padding: 2px 10px;
  cursor: pointer;
  border-radius: 2px;
  font-family: inherit;
}

.k-sidebar-search-btn:hover {
  background: #1b365d;
}

.k-search-dropdown {
  position: absolute;
  top: 30px;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #7f9db9;
  border-radius: 2px;
  max-height: 260px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  display: none;
}

.k-search-dropdown.open {
  display: block;
}

.k-search-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  font-size: 12px;
  color: #0844a4;
  text-decoration: none;
  border-bottom: 1px solid #f1f5f9;
}

.k-search-item:hover,
.k-search-item.selected {
  background: #e0edff;
}

.k-search-item-cat {
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
}

/* Sidebar Financial Calculators List Card */
.k-sidebar-card {
  border: 1px solid #7f9db9;
  background: #fbfbfc;
  box-sizing: border-box;
}

.k-sidebar-card-header {
  background-color: #2f5c94;
  color: #ffffff;
  font-weight: bold;
  font-size: 13.5px;
  padding: 6px 10px;
}

.k-sidebar-card-body {
  padding: 8px 10px;
  display: flex;
  gap: 12px;
}

.k-sidebar-links-col {
  flex: 1;
  margin: 0;
  padding: 0;
  list-style: none;
}

.k-sidebar-links-col li {
  margin-bottom: 4px;
}

.k-sidebar-links-col a {
  font-size: 12px;
  color: #0844a4;
  text-decoration: none;
  line-height: 1.35;
  display: block;
}

.k-sidebar-links-col a:hover {
  text-decoration: underline;
}

.k-sidebar-links-col a.active {
  font-weight: bold;
  color: #000000;
  text-decoration: none;
}

.k-sidebar-tabs {
  background: #f1f5f9;
  border-top: 1px solid #cbd5e1;
  padding: 6px 10px;
  font-size: 11px;
  color: #0844a4;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.k-sidebar-tabs a {
  color: #0844a4;
  text-decoration: none;
}

.k-sidebar-tabs a:hover {
  text-decoration: underline;
}

.k-sidebar-tabs span {
  color: #94a3b8;
}

/* ================= 500+ WORDS SEO ARTICLE ================= */
.k-seo-section {
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  padding-top: 20px;
  font-size: 13.5px;
  line-height: 1.65;
  color: #2b384d;
}

.k-seo-title {
  font-size: 19px;
  font-weight: bold;
  color: #003366;
  margin: 0 0 12px 0;
}

.k-seo-subtitle {
  font-size: 15px;
  font-weight: bold;
  color: #0844a4;
  margin: 18px 0 6px 0;
}

.k-seo-section p {
  margin: 0 0 12px 0;
}

.k-seo-section ul, .k-seo-section ol {
  margin: 0 0 14px 20px;
  padding: 0;
}

.k-seo-section li {
  margin-bottom: 5px;
}

/* FAQ Accordion */
.k-faq-accordion {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.k-faq-item {
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  overflow: hidden;
  background: #ffffff;
}

.k-faq-question {
  background: #f8fafc;
  padding: 10px 14px;
  font-weight: bold;
  font-size: 13.5px;
  color: #1b365d;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.k-faq-question:hover {
  background: #f1f5f9;
}

.k-faq-arrow {
  transition: transform 0.2s ease;
  font-size: 11px;
}

.k-faq-item.open .k-faq-arrow {
  transform: rotate(180deg);
}

.k-faq-answer {
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
  color: #334155;
  border-top: 1px solid #e2e8f0;
  display: none;
  background: #ffffff;
}

.k-faq-item.open .k-faq-answer {
  display: block;
}

/* ================= MODALS & OVERLAYS ================= */
.k-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  box-sizing: border-box;
}

.k-modal-overlay.open {
  display: flex;
}

.k-modal-box {
  background: #ffffff;
  border-radius: 4px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
}

.k-modal-header {
  background: #1b365d;
  color: #ffffff;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  font-size: 15px;
}

.k-modal-close-icon {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.k-modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13px;
}

.k-modal-footer {
  padding: 10px 16px;
  background: #f8fafc;
  border-top: 1px solid #cbd5e1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Toast */
.k-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1b365d;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 3px;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  display: none;
  z-index: 2000;
}

.k-toast.show {
  display: block;
}

/* Print Underwriting Clean Layout */
@media print {
  body * {
    visibility: hidden;
  }
  #print-area-wrapper, #print-area-wrapper * {
    visibility: visible;
  }
  #print-area-wrapper {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
}

/* RTL Support for Arabic */
html[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

html[dir="rtl"] .k-label-td {
  text-align: right;
}

html[dir="rtl"] .k-breakdown-table td.val-col {
  text-align: left;
}

html[dir="rtl"] .k-data-table {
  text-align: left;
}

html[dir="rtl"] .k-data-table th:first-child,
html[dir="rtl"] .k-data-table td:first-child {
  text-align: center;
}

html[dir="rtl"] .k-unit-label {
  margin-left: 0;
  margin-right: 4px;
}

html[dir="rtl"] .k-sidebar-search-box {
  flex-direction: row;
}

html[dir="rtl"] .k-modal-footer {
  justify-content: flex-start;
}

html[dir="rtl"] .k-sidebar-cat-title {
  text-align: right;
}

html[dir="rtl"] .k-sidebar-calc-list {
  padding-right: 18px;
  padding-left: 0;
}

