/* ============================================================
   IRS Situation Estimator — Calculator Widget Styles
   ============================================================ */

/* ── Card wrapper ────────────────────────────────────────── */
.est-card-wrap {
  display: flex;
  justify-content: center;
  padding: 0 0 16px;
}

.est-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.06);
  border: 1px solid #ccd8ec;
  max-width: 520px;
  width: 100%;
  overflow: hidden;
}

/* ── Header ──────────────────────────────────────────────── */
.est-header {
  background: linear-gradient(135deg, #14375e 0%, #0d3349 100%);
  padding: 20px 24px 16px;
  text-align: center;
}

.est-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
  letter-spacing: -.01em;
}

.est-subtitle {
  font-size: .72rem;
  color: rgba(255,255,255,.65);
  font-style: italic;
  line-height: 1.4;
}

/* ── Progress bar ────────────────────────────────────────── */
.est-progress {
  padding: 12px 24px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.est-progress-bar {
  flex: 1;
  height: 5px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.est-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0e8a76, #52c4b2);
  border-radius: 3px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
  width: 25%;
}

.est-step-label {
  font-size: .7rem;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ── Body / panels ───────────────────────────────────────── */
.est-body {
  padding: 20px 24px 8px;
  min-height: 260px;
}

.est-panel {
  display: none;
}

.est-panel.active {
  display: block;
  animation: panelInFwd .28s ease both;
}

.est-panel.active.from-left {
  animation: panelInBck .28s ease both;
}

@keyframes panelInFwd {
  from { opacity: 0; transform: translateX(36px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes panelInBck {
  from { opacity: 0; transform: translateX(-36px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Question label ──────────────────────────────────────── */
.est-q {
  font-size: 1rem;
  font-weight: 800;
  color: #14375e;
  margin-bottom: 14px;
  line-height: 1.3;
  text-align: center;
}

/* ── Disclaimer ──────────────────────────────────────────── */
.est-disclaimer {
  font-size: .71rem;
  color: #94a3b8;
  line-height: 1.55;
  margin-bottom: 16px;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 6px;
  border-left: 3px solid #e2e8f0;
}

.est-disclaimer-sm {
  font-size: .69rem;
  color: #aaa;
  line-height: 1.5;
  text-align: center;
  margin: 8px 0 14px;
}

/* ── Balance display ─────────────────────────────────────── */
.est-balance-display {
  font-size: 2.4rem;
  font-weight: 900;
  color: #14375e;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: -.02em;
  line-height: 1;
}

/* ── Range slider ────────────────────────────────────────── */
.est-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  background: #e2e8f0; /* overridden inline by JS */
}

.est-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #14375e;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
  border: 3px solid #fff;
  transition: transform .1s ease;
}

.est-slider::-webkit-slider-thumb:active {
  transform: scale(1.15);
}

.est-slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #14375e;
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
}

/* ── Quick chips ─────────────────────────────────────────── */
.est-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
}

.est-chip {
  padding: 5px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
  color: #4b5563;
  cursor: pointer;
  background: #fff;
  font-family: inherit;
  transition: all .15s;
  line-height: 1.4;
}

.est-chip:hover {
  border-color: #0e8a76;
  color: #0e8a76;
}

.est-chip.active {
  border-color: #0e8a76;
  background: #0e8a76;
  color: #fff;
}

/* ── Issue cards (step 2) ────────────────────────────────── */
.est-issue-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.est-issue-card {
  padding: 10px 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  font-size: .81rem;
  font-weight: 600;
  color: #374151;
  background: #fafafa;
  transition: all .15s;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.3;
  font-family: inherit;
  width: 100%;
}

.est-issue-card:hover {
  border-color: #14375e;
  color: #14375e;
  background: #f0f4fa;
}

.est-issue-card.selected {
  border-color: #0e8a76;
  background: #0e8a76;
  color: #fff;
  box-shadow: 0 3px 10px rgba(14,138,118,.22);
}

/* ── Timeline buttons (step 3) ───────────────────────────── */
.est-timeline-opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.est-tl-btn {
  padding: 12px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  color: #374151;
  background: #fff;
  transition: all .15s;
  font-family: inherit;
  width: 100%;
  line-height: 1.3;
}

.est-tl-btn:hover {
  border-color: #14375e;
  color: #14375e;
  background: #f0f4fa;
}

.est-tl-btn.selected {
  border-color: #0e8a76;
  background: #0e8a76;
  color: #fff;
}

/* ── Notice code (step 3 conditional) ───────────────────── */
.est-notice-wrap {
  margin-top: 18px;
}

.est-notice-wrap .est-q {
  font-size: .88rem;
  margin-bottom: 8px;
}

.est-select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: .9rem;
  font-family: inherit;
  color: #14375e;
  background: #fff;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.est-select:focus {
  border-color: #14375e;
}

/* ── Results (step 4) ────────────────────────────────────── */
.est-results {
  background: #f8fafc;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 1px solid #e2e8f0;
}

.est-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #eef0f5;
  font-size: .87rem;
}

.est-result-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.est-result-label {
  color: #64748b;
  font-weight: 500;
}

.est-result-value {
  font-weight: 700;
  color: #14375e;
  text-align: right;
}

.est-risk-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: .73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.est-risk-low      { background: #dcfce7; color: #166534; }
.est-risk-moderate { background: #fef9c3; color: #854d0e; }
.est-risk-high     { background: #fee2e2; color: #991b1b; }

/* ── Contact form (step 4) ───────────────────────────────── */
.est-form-row {
  margin-bottom: 10px;
}

.est-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: .93rem;
  font-family: inherit;
  color: #14375e;
  background: #fff;
  outline: none;
  transition: border-color .15s;
}

.est-input:focus {
  border-color: #14375e;
}

.est-input::placeholder {
  color: #94a3b8;
}

/* TCPA reuse existing styles but scoped */
#est-tcpa-label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 10px 0 12px;
  cursor: pointer;
}

#est-tcpa-label input[type=checkbox] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #2563eb;
  cursor: pointer;
}

#est-tcpa-label span {
  font-size: .71rem;
  color: #64748b;
  line-height: 1.5;
}

#est-tcpa-label.error {
  border: 1.5px solid #dc2626;
  border-radius: 6px;
  background: #fff5f5;
  padding: 8px 10px;
}

#est-tcpa-label.error span {
  color: #9b1c1c;
}

#est-tcpa-err {
  display: none;
  color: #dc2626;
  font-size: .78rem;
  font-weight: 600;
  margin: 4px 0 10px;
}

.est-form-err {
  color: #c44e00;
  font-size: .82rem;
  font-weight: 600;
  text-align: center;
  margin: 6px 0 2px;
  min-height: 1.1em;
}

/* ── Submit button ───────────────────────────────────────── */
.est-submit-btn {
  width: 100%;
  background: #e8620a;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 20px;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
  letter-spacing: .01em;
}

.est-submit-btn:hover:not(:disabled) {
  background: #c4530a;
}

.est-submit-btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

/* ── Confirmation ────────────────────────────────────────── */
.est-confirm {
  text-align: center;
  padding: 12px 0 8px;
}

.est-confirm-icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
}

.est-confirm h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #14375e;
  margin-bottom: 10px;
  line-height: 1.3;
}

.est-confirm p {
  font-size: .85rem;
  color: #64748b;
  margin-bottom: 8px;
  line-height: 1.6;
}

.est-confirm a {
  color: #e8620a;
  font-weight: 700;
}

/* ── Footer buttons ──────────────────────────────────────── */
.est-footer {
  display: flex;
  gap: 10px;
  padding: 14px 24px 20px;
  border-top: 1px solid #f1f5f9;
}

.est-btn-back {
  flex: 0 0 auto;
  background: none;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  color: #64748b;
  font-size: .88rem;
  font-weight: 600;
  padding: 10px 18px;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}

.est-btn-back:hover:not(:disabled) {
  border-color: #94a3b8;
  color: #374151;
}

.est-btn-cont {
  flex: 1;
  background: #e8620a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .97rem;
  font-weight: 700;
  padding: 12px 20px;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}

.est-btn-cont:hover:not(:disabled) {
  background: #c4530a;
}

.est-btn-cont:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

/* ── Timeline slider display ─────────────────────────────── */
.est-tl-display {
  font-size: 1.5rem;
  font-weight: 800;
  color: #14375e;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: -.01em;
  line-height: 1.2;
  min-height: 1.8rem;
}

/* ── Timeline tick labels ─────────────────────────────────── */
.est-tl-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.est-tl-labels span {
  font-size: .65rem;
  color: #94a3b8;
  font-weight: 600;
  text-align: center;
  width: 20%;
  line-height: 1.3;
}

/* ── Notice code radio grid ──────────────────────────────── */
.est-notice-radios {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.est-radio-opt {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  font-size: .82rem;
  font-weight: 600;
  color: #374151;
  background: #fff;
  transition: border-color .15s, background .15s, color .15s;
  line-height: 1.2;
}

.est-radio-opt:hover {
  border-color: #14375e;
  color: #14375e;
}

.est-radio-opt input[type=radio] {
  accent-color: #0e8a76;
  cursor: pointer;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.est-radio-opt:has(input:checked) {
  border-color: #0e8a76;
  background: #f0faf8;
  color: #0e8a76;
}

/* ── First / Last name row ───────────────────────────────── */
.est-name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── Mobile adjustments ──────────────────────────────────── */
@media (max-width: 580px) {
  .est-card {
    border-radius: 14px;
    max-width: 100%;
  }

  .est-header {
    padding: 16px 20px 14px;
  }

  .est-title {
    font-size: 1.05rem;
  }

  .est-progress {
    padding: 10px 20px 0;
  }

  .est-body {
    padding: 18px 20px 6px;
    min-height: 240px;
  }

  .est-q {
    font-size: .95rem;
  }

  .est-balance-display {
    font-size: 2rem;
  }

  .est-issue-card {
    min-height: 56px;
    font-size: .79rem;
    padding: 8px 8px;
  }

  .est-tl-btn {
    font-size: .86rem;
    padding: 11px 14px;
  }

  .est-result-row {
    font-size: .83rem;
  }

  .est-footer {
    padding: 12px 20px 18px;
  }

  .est-tl-display {
    font-size: 1.2rem;
  }

  .est-tl-labels span {
    font-size: .6rem;
  }

  .est-notice-radios {
    grid-template-columns: 1fr 1fr;
  }

  .est-name-row {
    grid-template-columns: 1fr;
  }
}
