/* ==========================================================================
   Ramsey Retirement Calculator Widget Styles
   Pixel-matched to official design reference
   ========================================================================== */

.calc-card {
  background-color: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(16, 27, 53, 0.06), 0 1px 3px rgba(16, 27, 53, 0.04);
  padding: 1.75rem 2rem;
  max-width: 100%;
  margin: 0;
}

@media (max-width: 768px) {
  .calc-card {
    padding: 1.25rem;
  }
}

/* --------------------------------------------------------------------------
   Calculator Header
   -------------------------------------------------------------------------- */
.calc-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid #F1F5F9;
}

.calc-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background-color: #F0FDF4;
  border: 1.5px solid #BBF7D0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #078A2E;
  flex-shrink: 0;
}

.calc-header-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #101B35;
  margin: 0 0 0.2rem 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.calc-header-sub {
  font-size: 0.875rem;
  color: #64748B;
  margin: 0;
  line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Calculator 2-Column Layout
   -------------------------------------------------------------------------- */
.calc-card-body {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .calc-card-body {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* --------------------------------------------------------------------------
   Left Column: Form Rows
   -------------------------------------------------------------------------- */
.calc-form-column {
  display: flex;
  flex-direction: column;
}

.calc-error-summary {
  background-color: #FEF2F2;
  border: 1px solid #FCA5A5;
  color: #B91C1C;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.calc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #F8FAFC;
}

.calc-row:last-of-type {
  border-bottom: none;
}

.calc-row-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #101B35;
  white-space: nowrap;
  flex: 1;
}

.calc-row-label label {
  cursor: pointer;
  margin: 0;
  white-space: nowrap;
}

/* Info Icon & Tooltip */
.calc-info-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
  cursor: help;
  outline: none;
  flex-shrink: 0;
}

.calc-info-icon:hover,
.calc-info-icon:focus {
  color: #078A2E;
}

.calc-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background-color: #101B35;
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  width: 220px;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.15s ease-in-out;
  box-shadow: 0 4px 12px rgba(16, 27, 53, 0.2);
  z-index: 100;
  white-space: normal;
}

.calc-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: #101B35 transparent transparent transparent;
}

.calc-info-icon:hover .calc-tooltip,
.calc-info-icon:focus .calc-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Form Fields */
.calc-row-field {
  position: relative;
  width: 120px;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .calc-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
  .calc-row-label {
    white-space: normal;
  }
  .calc-row-label label {
    white-space: normal;
  }
  .calc-row-field {
    width: 100%;
  }
}

.calc-input {
  width: 100%;
  height: 38px;
  padding: 0 0.65rem;
  background-color: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #101B35;
  text-align: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.calc-input:focus {
  outline: none;
  border-color: #078A2E;
  box-shadow: 0 0 0 3px rgba(7, 138, 46, 0.15);
}

.calc-input.has-error {
  border-color: #EF4444;
  background-color: #FEF2F2;
}

.calc-field-error {
  display: block;
  font-size: 0.75rem;
  color: #DC2626;
  margin-top: 0.2rem;
  text-align: right;
}

/* Custom Dropdown Select */
.calc-select-wrapper {
  position: relative;
  width: 100%;
}

.calc-select-wrapper::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4.5px solid #64748B;
  pointer-events: none;
}

.calc-select {
  width: 100%;
  height: 38px;
  padding: 0 1.5rem 0 0.65rem;
  background-color: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #101B35;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.calc-select:focus {
  outline: none;
  border-color: #078A2E;
  box-shadow: 0 0 0 3px rgba(7, 138, 46, 0.15);
}

/* Submit Button */
.calc-button-row {
  margin-top: 1.5rem;
}

.btn-calc-submit {
  width: 100%;
  height: 46px;
  background-color: #078A2E;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(7, 138, 46, 0.25);
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn-calc-submit:hover {
  background-color: #006B27;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 107, 39, 0.35);
}

.btn-calc-submit:active {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Right Column: Estimate Card & Chart
   -------------------------------------------------------------------------- */
.calc-results-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Estimate Box */
.calc-estimate-card {
  background-color: #F4FBF5;
  border: 1px solid #D1F0D9;
  border-radius: 14px;
  padding: 1.35rem 1.5rem;
}

.calc-estimate-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.calc-estimate-super {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  color: #101B35;
  margin-bottom: 0.2rem;
}

.calc-estimate-sub {
  display: block;
  font-size: 0.8125rem;
  color: #64748B;
  margin-bottom: 0.35rem;
}

.calc-estimate-number {
  font-size: clamp(2rem, 3.2vw, 2.5rem);
  font-weight: 800;
  color: #078A2E;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.calc-estimate-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #078A2E;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #078A2E;
  background-color: #FFFFFF;
  flex-shrink: 0;
}

/* Breakdown Rows */
.calc-estimate-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem 0;
  border-top: 1px solid #E2F3E7;
  border-bottom: 1px solid #E2F3E7;
  margin-bottom: 1rem;
}

.calc-breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.875rem;
}

.breakdown-label {
  color: #101B35;
  font-weight: 600;
}

.breakdown-sublabel {
  display: block;
  font-size: 0.75rem;
  color: #64748B;
  font-weight: 400;
}

.breakdown-value {
  color: #101B35;
  font-weight: 700;
  font-size: 0.9375rem;
}

/* Monthly Income Pill */
.calc-income-pill {
  background-color: #EAF7EC;
  border: 1px solid #C6ECD0;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.income-pill-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #101B35;
}

.income-pill-left svg {
  color: #078A2E;
  flex-shrink: 0;
}

.income-pill-right {
  font-size: 1.35rem;
  font-weight: 800;
  color: #078A2E;
  letter-spacing: -0.02em;
}

/* --------------------------------------------------------------------------
   Chart Section
   -------------------------------------------------------------------------- */
.calc-chart-section {
  display: flex;
  flex-direction: column;
}

.calc-chart-heading {
  font-size: 0.9375rem;
  font-weight: 800;
  color: #101B35;
  margin: 0.5rem 0 0.75rem 0;
}

.calc-chart-container {
  position: relative;
  width: 100%;
  height: 200px;
  background-color: #FFFFFF;
}

.calc-chart-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.calc-chart-tooltip {
  position: absolute;
  pointer-events: none;
  background-color: #101B35;
  color: #FFFFFF;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.4;
  box-shadow: 0 4px 12px rgba(16, 27, 53, 0.2);
  z-index: 10;
  white-space: nowrap;
}
