/**
 * WiseIQ Financial Efficiency Score — Styles v1.0
 */

/* ── Floating widget ──────────────────────────────────────────── */
.wiq-es-widget {
  position: fixed;
  bottom: 90px;
  left: 16px;
  z-index: 9990;
}
.wiq-es-w-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid #BFDBFE;
  border-radius: 50px;
  padding: 10px 16px 10px 12px;
  box-shadow: 0 4px 20px rgba(29,78,216,0.15);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
}
.wiq-es-w-btn:hover { box-shadow: 0 6px 28px rgba(29,78,216,0.22); transform: translateY(-1px); }
.wiq-es-w-icon {
  width: 34px; height: 34px;
  background: #EFF6FF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1D4ED8;
  flex-shrink: 0;
}
.wiq-es-w-title { font-size: 12px; font-weight: 700; color: #111827; text-align: left; }
.wiq-es-w-sub   { font-size: 11px; color: #6B7280; text-align: left; }
.wiq-es-w-score-ring {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 3px solid var(--score-color, #1D4ED8);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.wiq-es-w-score-num { font-size: 11px; font-weight: 800; }
.wiq-es-w-delta { font-size: 11px; font-weight: 700; margin-left: 4px; }

/* ── Dashboard modal ──────────────────────────────────────────── */
.wiq-es-dashboard {
  position: fixed;
  inset: 0;
  z-index: 10003;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.wiq-es-dashboard.wiq-es-open {
  opacity: 1;
  pointer-events: auto;
}
.wiq-es-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
}
.wiq-es-panel {
  position: relative;
  background: #fff;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.18);
  transform: translateY(40px);
  transition: transform 0.35s cubic-bezier(0.34,1.2,0.64,1);
}
.wiq-es-dashboard.wiq-es-open .wiq-es-panel { transform: translateY(0); }
.wiq-es-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 0;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.wiq-es-title { font-size: 18px; font-weight: 800; color: #111827; margin: 0; }
.wiq-es-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #9CA3AF;
  cursor: pointer;
  line-height: 1;
}
.wiq-es-close:hover { color: #374151; }
.wiq-es-body { padding: 16px 20px 24px; }

/* ── Onboarding form ──────────────────────────────────────────── */
.wiq-es-onboard-intro {
  font-size: 14px;
  color: #6B7280;
  margin: 0 0 16px;
  line-height: 1.6;
}
.wiq-es-field { margin-bottom: 14px; }
.wiq-es-label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 5px; }
.wiq-es-hint  { font-size: 11px; color: #9CA3AF; margin-top: 3px; display: block; }
.wiq-es-input {
  width: 100%;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 15px;
  color: #111827;
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.wiq-es-input:focus { outline: none; border-color: #1D4ED8; }
.wiq-es-row { display: flex; gap: 8px; }
.wiq-es-select {
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 13px;
  color: #374151;
  background: #fff;
  cursor: pointer;
}
.wiq-es-tier-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.wiq-es-tier-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #F9FAFB;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  flex: 1;
  min-width: 60px;
}
.wiq-es-tier-btn span { font-size: 10px; color: #9CA3AF; font-weight: 400; margin-top: 2px; }
.wiq-es-tier-btn:hover { border-color: #1D4ED8; background: #EFF6FF; }
.wiq-es-tier-active { border-color: #1D4ED8 !important; background: #EFF6FF !important; color: #1D4ED8 !important; }
.wiq-es-calc-btn {
  width: 100%;
  background: #1D4ED8;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.15s;
}
.wiq-es-calc-btn:hover { background: #1E40AF; }

/* ── Score section ────────────────────────────────────────────── */
.wiq-es-score-section {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px;
  background: #F9FAFB;
  border-radius: 14px;
}
.wiq-es-gauge-wrap { flex-shrink: 0; width: 90px; }
.wiq-es-gauge-svg  { width: 90px; height: 90px; }
.wiq-es-score-info { flex: 1; }
.wiq-es-score-label { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.wiq-es-delta { font-size: 12px; margin-bottom: 6px; line-height: 1.4; }
.wiq-es-potential { font-size: 13px; color: #374151; line-height: 1.5; }

/* ── Sub-scores ───────────────────────────────────────────────── */
.wiq-es-sub-scores { margin-bottom: 18px; }
.wiq-es-sub-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.wiq-es-sub-label {
  font-size: 12px;
  color: #374151;
  width: 110px;
  flex-shrink: 0;
}
.wiq-es-sub-weight { color: #9CA3AF; font-weight: 400; }
.wiq-es-sub-bar-wrap {
  flex: 1;
  height: 6px;
  background: #E5E7EB;
  border-radius: 3px;
  overflow: hidden;
}
.wiq-es-sub-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
}
.wiq-es-sub-val { font-size: 12px; font-weight: 700; width: 28px; text-align: right; flex-shrink: 0; }

/* ── Top action ───────────────────────────────────────────────── */
.wiq-es-top-action {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.wiq-es-ta-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: #3B82F6; font-weight: 700; margin-bottom: 4px; }
.wiq-es-ta-title { font-size: 14px; font-weight: 700; color: #1E3A8A; margin-bottom: 4px; }
.wiq-es-ta-desc  { font-size: 12px; color: #374151; line-height: 1.5; margin-bottom: 10px; }
.wiq-es-ta-cta {
  display: inline-block;
  background: #1D4ED8;
  color: #fff;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.15s;
}
.wiq-es-ta-cta:hover { background: #1E40AF; }

/* ── Badges ───────────────────────────────────────────────────── */
.wiq-es-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.wiq-es-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  border-radius: 20px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #92400E;
}

/* ── Email capture ────────────────────────────────────────────── */
.wiq-es-email-capture {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.wiq-es-ec-title { font-size: 13px; font-weight: 700; color: #065F46; margin-bottom: 3px; }
.wiq-es-ec-sub   { font-size: 12px; color: #374151; margin-bottom: 10px; }
.wiq-es-ec-row   { display: flex; gap: 8px; }
.wiq-es-ec-input {
  flex: 1;
  border: 1.5px solid #D1FAE5;
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 13px;
  color: #111827;
}
.wiq-es-ec-input:focus { outline: none; border-color: #059669; }
.wiq-es-ec-btn {
  background: #059669;
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.wiq-es-ec-btn:hover { background: #047857; }
.wiq-es-ec-confirm { font-size: 13px; color: #059669; font-weight: 600; }

/* ── Edit button ──────────────────────────────────────────────── */
.wiq-es-edit-btn {
  background: none;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  color: #6B7280;
  cursor: pointer;
  width: 100%;
  margin-top: 4px;
}
.wiq-es-edit-btn:hover { border-color: #9CA3AF; color: #374151; }

/* ── Dark mode ────────────────────────────────────────────────── */
[data-theme="dark"] .wiq-es-w-btn   { background: #1F2937; border-color: #3B82F6; }
[data-theme="dark"] .wiq-es-w-title { color: #F9FAFB; }
[data-theme="dark"] .wiq-es-w-sub   { color: #9CA3AF; }
[data-theme="dark"] .wiq-es-panel   { background: #1F2937; }
[data-theme="dark"] .wiq-es-title   { color: #F9FAFB; }
[data-theme="dark"] .wiq-es-header  { background: #1F2937; }
[data-theme="dark"] .wiq-es-score-section { background: #111827; }
[data-theme="dark"] .wiq-es-input   { background: #111827; border-color: #374151; color: #F9FAFB; }
[data-theme="dark"] .wiq-es-select  { background: #111827; border-color: #374151; color: #F9FAFB; }
[data-theme="dark"] .wiq-es-tier-btn { background: #111827; border-color: #374151; color: #D1D5DB; }
[data-theme="dark"] .wiq-es-tier-active { background: #1E3A5F !important; color: #93C5FD !important; }
[data-theme="dark"] .wiq-es-top-action { background: #1E3A5F; border-color: #3B82F6; }
[data-theme="dark"] .wiq-es-ta-title { color: #93C5FD; }
[data-theme="dark"] .wiq-es-ta-desc  { color: #D1D5DB; }
