/* Early Exit Calculator (UK) - Enhanced Wide-Width Layout */

.rc-eec {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: #083141;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto 3rem !important;
  padding: 0 !important;
  display: block !important;
}

.rc-eec * { box-sizing: border-box; }

.rc-eec__wrap {
  max-width: 1200px !important;
  width: 100% !important;
  margin: 0 auto;
  padding: 24px;
  background: #ffffff;
  border: 2px solid #083141;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

@media (max-width: 1024px) {
  .rc-eec__wrap {
    max-width: calc(100% - 2rem) !important;
    padding: 20px;
  }
}

.rc-eec__header {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding: 20px;
  background: #ffffff;
  border: 2px solid #083141;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

@media (max-width: 980px) {
  .rc-eec__header {
    flex-direction: column;
  }
}

.rc-eec__title {
  margin: 0 0 0.5rem 0;
  font-size: 1.8rem;
  line-height: 1.2;
  font-weight: 700;
  color: #083141;
}

.rc-eec__subtitle {
  margin: 0;
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 72ch;
}

.rc-eec__headerActions { display: flex; gap: 8px; flex-wrap: wrap; }

.rc-eec__btn {
  appearance: none;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #083141;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
  line-height: 1;
}

.rc-eec__btn:hover:not(:disabled) {
  background: #f3f4f6;
  border-color: #2563eb;
}

.rc-eec__btn:active:not(:disabled) {
  transform: translateY(1px);
}

.rc-eec__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.rc-eec__btn--primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.rc-eec__btn--primary:hover:not(:disabled) {
  background: #1e4fd6;
  border-color: #1e4fd6;
}

.rc-eec__btn--small { padding: 8px 10px; font-size: 13px; border-radius: 9px; }

.rc-eec__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

@media (max-width: 1024px) {
  .rc-eec__wrap {
    max-width: calc(100% - 2rem) !important;
    padding: 20px;
  }
}

@media (max-width: 980px) {
  .rc-eec__header { flex-direction: column; }
  .rc-eec__headerActions {
    width: 100%;
    justify-content: flex-start;
  }
}

.rc-eec__card {
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.rc-eec__cardTitle {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 700;
  color: #083141;
}

.rc-eec__stepDesc {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #1e293b;
  font-weight: 500;
}

.rc-eec__stepDesc--1,
.rc-eec__stepDesc--2,
.rc-eec__stepDesc--3,
.rc-eec__stepDesc--4,
.rc-eec__stepDesc--5 {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
}

.rc-eec__returnBtn {
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #083141;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s;
  min-width: 45px;
}

.rc-eec__returnBtn:hover {
  background: #f3f4f6;
  border-color: #2563eb;
}

.rc-eec__returnBtn--active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.rc-eec__returnBtn--active:hover {
  background: #1e4fd6;
  border-color: #1e4fd6;
}

.rc-eec__formGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rc-eec__formGrid--single {
  grid-template-columns: 1fr !important;
}

@media (max-width: 540px) {
  .rc-eec__formGrid { grid-template-columns: 1fr; }
}

.rc-eec__field { display: grid; gap: 6px; }
.rc-eec__field > span { font-size: 13px; color: #374151; font-weight: 600; }

.rc-eec__field input[type="number"],
.rc-eec__field input[type="text"],
.rc-eec__field select {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 9px 10px;
  background: #ffffff;
  color: #111827;
}

.rc-eec__field--check {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 8px;
}
.rc-eec__field--check > span {
  margin-right: 0;
  flex: 0 1 auto;
}
.rc-eec__field--check input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: #2563eb;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

.rc-eec__hint { margin: 10px 0 0; font-size: 12.5px; color: #6b7280; }

.rc-eec__subCard {
  margin-top: 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
}

.rc-eec__subCardHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.rc-eec__subCardHead strong {
  font-size: 14px;
  font-weight: 700;
  color: #083141;
}

.rc-eec__table { display: grid; gap: 10px; }

.rc-eec__row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
}

.rc-eec__row[data-type="income"] {
  grid-template-columns: 1.2fr 1fr 1fr 1fr 1fr auto;
}

@media (max-width: 980px) {
  .rc-eec__row { grid-template-columns: 1fr 1fr; }
  .rc-eec__row .rc-eec__rowRemove { justify-self: start; }
}

.rc-eec__row label {
  display: grid;
  gap: 6px;
}

.rc-eec__row label span {
  font-size: 13px;
  color: #374151;
  font-weight: 600;
}

.rc-eec__row label input[type="text"],
.rc-eec__row label input[type="number"],
.rc-eec__row label input[type="checkbox"] {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 9px 10px;
  background: #ffffff;
  color: #111827;
  font-size: 14px;
}

.rc-eec__row label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
}

.rc-eec__rowRemove {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #083141;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s;
  align-self: end;
}

.rc-eec__rowRemove:hover {
  background: #fef2f2;
  border-color: #ef4444;
  color: #dc2626;
}

.rc-eec__results { margin-top: 14px; }

.rc-eec__kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

@media (max-width: 980px) { .rc-eec__kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .rc-eec__kpis { grid-template-columns: 1fr; } }

.rc-eec__kpi {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  transition: transform 0.2s, box-shadow 0.2s;
}

.rc-eec__kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}

.rc-eec__kpi--success {
  border-color: #10b981;
  background: #f0fdf4;
}

.rc-eec__kpi--failure {
  border-color: #ef4444;
  background: #fef2f2;
}

.rc-eec__kpi--highlight {
  border-color: #2563eb;
  background: #eff6ff;
}

.rc-eec__kpiLabel {
  font-size: 12px;
  color: #6b7280;
  margin: 0 0 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.rc-eec__kpiValue {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
  color: #083141;
}

.rc-eec__kpiSub {
  font-size: 12.5px;
  color: #64748b;
  margin: 8px 0 0;
  line-height: 1.4;
}

.rc-eec__chartCard {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  margin-bottom: 16px;
}

.rc-eec__chartCard canvas {
  max-height: 450px;
  min-height: 350px;
  height: 400px !important;
}

@media (max-width: 768px) {
  .rc-eec__chartCard canvas {
    max-height: 300px;
    min-height: 250px;
    height: 280px !important;
  }
}

.rc-eec__chartCard canvas {
  max-height: 400px;
  min-height: 300px;
}

.rc-eec__chartHead {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}

.rc-eec__chipRow { display: flex; gap: 6px; flex-wrap: wrap; }
.rc-eec__chip {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #083141;
}

.rc-eec__chip--ok {
  background: #f0fdf4;
  border-color: #10b981;
  color: #059669;
}

.rc-eec__chip--bad {
  background: #fef2f2;
  border-color: #ef4444;
  color: #dc2626;
}

.rc-eec__chip--info {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #2563eb;
}

.rc-eec__tables { display: grid; gap: 12px; }

.rc-eec__tableCard {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.rc-eec__tableScroll {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.rc-eec__dataTable {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
  table-layout: auto;
}

@media (max-width: 1024px) {
  .rc-eec__tableCard {
    padding: 14px;
  }
  
  .rc-eec__tableScroll {
    margin: 0 -14px;
    padding: 0 14px;
  }
}

.rc-eec__dataTable th, .rc-eec__dataTable td {
  border-bottom: 1px solid #eef2f7;
  padding: 10px 8px;
  text-align: right;
  font-size: 13px;
  white-space: nowrap;
}

.rc-eec__dataTable th {
  text-align: right;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6b7280;
  background: #fafafa;
}

.rc-eec__dataTable th:first-child,
.rc-eec__dataTable td:first-child { text-align: left; }

.rc-eec__alternatives {
  margin-top: 20px;
  display: grid;
  gap: 16px;
}

.rc-eec__alternativesCard {
  background: #ffffff;
  border: 2px solid #083141;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.rc-eec__alternativesTitle {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
  color: #083141;
}

.rc-eec__scenario {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.rc-eec__scenarioTitle {
  font-size: 15px;
  font-weight: 700;
  color: #083141;
  margin: 0 0 8px;
}

.rc-eec__scenarioDesc {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 12px;
  line-height: 1.5;
}

.rc-eec__scenarioResult {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.rc-eec__scenarioMetric {
  background: #ffffff;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.rc-eec__scenarioMetricLabel {
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 4px;
}

.rc-eec__scenarioMetricValue {
  font-size: 16px;
  font-weight: 700;
  color: #083141;
  margin: 0;
}

.rc-eec__downloadSection {
  margin-top: 32px;
  padding: 24px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px solid #0ea5e9;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.1);
}

.rc-eec__btn--download {
  background: #0ea5e9 !important;
  border-color: #0ea5e9 !important;
  color: #ffffff !important;
  padding: 14px 28px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  transition: all 0.3s ease !important;
  text-transform: none !important;
}

.rc-eec__btn--download:hover:not(:disabled) {
  background: #0284c7 !important;
  border-color: #0284c7 !important;
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4) !important;
  transform: translateY(-2px) !important;
}

.rc-eec__btn--download:active:not(:disabled) {
  transform: translateY(0) !important;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3) !important;
}

.rc-eec__downloadIcon {
  font-size: 20px;
  line-height: 1;
}

.rc-eec__downloadHint {
  margin: 12px 0 0;
  color: #0369a1;
  font-size: 13px;
  font-weight: 500;
}

.rc-eec__footer { margin-top: 20px; }
.rc-eec__disclaimer { margin: 0; color: #64748b; font-size: 12.5px; line-height: 1.6; }

/* Export section: dashed box (MailerLite CSV grip) */
.rc-eec__downloadSection {
  border: 2px dashed #0ea5e9;
}

/* Modal: MailerLite – critical styles injected by JS (rc-eec-modal-*). Export section only below. */
