/* ======================================================
   HW GOALS PAGE
   Mobile-first / compact / app-like
====================================================== */

/* =========================
   PAGE WRAPPER
========================= */
.hw-goals-page {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 12px;
  box-sizing: border-box;
  color: var(--hw-color-text-strong);
}

.hw-goals-page * {
  box-sizing: border-box;
}

/* =========================
   HERO
========================= */
.hw-goals-header {
  margin-bottom: 12px;
}

.hw-goals-header-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.hw-goals-header-top h2,
.hw-goals-header-top #your-goals {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--hw-color-text-strong);
  font-family: var(--hw-font-family-display);
}

.hw-stage-option {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: var(--hw-radius-pill);
  border: 1px solid var(--hw-app-line);
  background: var(--hw-app-surface-soft);
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
  text-transform: capitalize;
}

/* Stage colors */
.stage-snapshot {
  background: #f8fafc;
  color: #475569;
}

.stage-budget {
  background: var(--hw-color-primary-soft);
  color: var(--hw-color-primary-strong);
}

.stage-debt {
  background: #fef2f2;
  color: #b91c1c;
}

.stage-emergency {
  background: #fff7ed;
  color: #c2410c;
}

.stage-investing {
  background: var(--hw-color-secondary-soft);
  color: var(--hw-color-secondary-strong);
}

.stage-wealth {
  background: var(--hw-color-primary-soft);
  color: var(--hw-color-primary);
}

.hw-goals-edit-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--hw-app-line);
  background: var(--hw-app-surface);
  border-radius: var(--hw-radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.hw-goals-edit-btn:hover {
  background: var(--hw-color-primary-soft);
}

.hw-goals-edit-btn:active {
  transform: scale(0.96);
}

/* =========================
   STATS
========================= */
.hw-goals-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.hw-stat-card {
  background: var(--hw-app-surface);
  border: 1px solid var(--hw-app-line);
  border-radius: var(--hw-radius-xl);
  padding: 10px 8px;
  text-align: center;
  box-shadow: var(--hw-app-shadow);
}

.hw-stat-circle {
  width: 52px;
  height: 52px;
  margin: 0 auto 6px;
  border-radius: var(--hw-radius-pill);
  background: linear-gradient(180deg, #faf7fc 0%, var(--hw-color-primary-soft) 100%);
  border: 1px solid rgba(136, 60, 166, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hw-stat-circle span {
  font-size: 13px;
  font-weight: 800;
  color: #111827;
}

.hw-stat-card small {
  display: block;
  margin: 0;
  font-size: 11px;
  line-height: 1.2;
  color: var(--hw-color-muted);
}

/* =========================
   YOUR WHY
========================= */
.hw-goals-why {
  margin-bottom: 14px;
}

.hw-goals-why-header {
  margin-bottom: 8px;
}

.hw-goals-why-header h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 800;
  color: var(--hw-color-text-strong);
}

.hw-goals-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.hw-goal {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 7px 10px;
  border-radius: var(--hw-radius-pill);
  background: var(--hw-app-surface-soft);
  border: 1px solid var(--hw-app-line);
  font-size: 11px;
  line-height: 1.1;
  font-weight: 600;
  color: var(--hw-color-text);
}

.hw-goal.primary {
  background: var(--hw-color-primary-soft);
  border-color: rgba(136, 60, 166, 0.16);
  color: var(--hw-color-primary-strong);
}

/* =========================
   VAULTS WRAPPER
========================= */
.hw-goals-vaults {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

/* =========================
   GOAL CARD
========================= */
.hw-goal-card {
  background: var(--hw-app-surface);
  border: 1px solid var(--hw-app-line);
  border-radius: var(--hw-radius-xl);
  padding: 10px;
  box-shadow: var(--hw-app-shadow);
  overflow: hidden;
}

.hw-goal-card.locked {
  background: #fcfcfd;
}

.hw-goal-warning {
  margin-bottom: 10px;
  padding: 9px 10px;
  border-radius: var(--hw-radius-lg);
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 600;
}

.hw-goal-warning small {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.35;
  color: #b45309;
  font-weight: 500;
}

/* =========================
   CARD HEADER
========================= */
.hw-goal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}

.hw-goal-card-header > div:first-child {
  min-width: 0;
  flex: 1;
}

.hw-goal-card-header strong {
  display: block;
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 800;
  color: #0f172a;
  word-break: break-word;
}

.hw-goal-sub {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.2;
  color: #64748b;
  font-weight: 600;
}

.hw-goal-meta {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
}

/* =========================
   PROGRESS BAR
========================= */
.hw-progress-vaultbar {
  display: block;
  position: relative;
  width: 100%;
  min-width: 100%;
  height: 8px;
  min-height: 8px;
  margin-top: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.hw-progress-vaultbar > div {
  display: block;
  height: 100%;
  min-height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6 0%, #22c55e 100%);
  transition: width 0.25s ease;
}

/* =========================
   EXPANDABLE PANEL
========================= */
.hw-goal-expand {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.hw-goal-card.open .hw-goal-expand {
  display: block;
}

/* =========================
   GOAL TABS
========================= */
.hw-goal-icons {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.hw-goal-tab {
  flex: 1;
  min-height: 34px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hw-goal-tab.active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.hw-goal-panel {
  display: none;
}

.hw-goal-panel.active {
  display: block;
}

.hw-goal-panel p {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.4;
  color: #334155;
}

.hw-goal-panel p:last-child {
  margin-bottom: 0;
}

.hw-goal-ai {
  margin-top: 8px;
  padding: 9px 10px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  font-size: 11px;
  line-height: 1.4;
  color: #475569;
}

/* =========================
   WHAT IF
========================= */
.hw-whatif-slider {
  width: 100%;
  margin: 0;
  accent-color: #111827;
}

.hw-whatif-result {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.3;
  color: #0f172a;
  font-weight: 600;
}

/* =========================
   MILESTONES
========================= */
.hw-goals-milestones {
  margin-bottom: 14px;
}

.hw-goals-milestones h4 {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 800;
  color: #0f172a;
}

.hw-milestone {
  margin-bottom: 8px;
  padding: 10px 11px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  font-size: 12px;
  line-height: 1.35;
  color: #334155;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}

.hw-milestone:last-child {
  margin-bottom: 0;
}

/* =========================
   ALIGNMENT
========================= */
.hw-goals-alignment {
  margin-bottom: 14px;
}

.hw-alignment-box {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}

.hw-alignment-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 9px;
  margin-bottom: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
}

.hw-alignment-box strong {
  display: block;
  margin: 0 0 5px;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 800;
}

.hw-alignment-box p {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

.hw-alignment-box.success {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}

.hw-alignment-box.warning {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.hw-alignment-box.critical {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

/* =========================
   MODAL GOALS
========================= */
.hw-modal-goals {
  padding: 4px 2px 2px;
}

.hw-modal-goals h3 {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 800;
  color: #0f172a;
}

.hw-goals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.hw-goal-option {
  min-height: 42px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #334155;
  font-size: 11px;
  line-height: 1.25;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hw-goal-option:hover {
  background: #f8fafc;
}

.hw-goal-option.active {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.hw-goal-custom {
  margin-top: 10px;
}

.hw-goal-custom label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
  color: #334155;
}

.hw-goal-custom input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  font-size: 12px;
  color: #0f172a;
  outline: none;
}

.hw-goal-custom input:focus {
  border-color: #cbd5e1;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
}

.hw-btn-primary {
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
  padding: 10px 12px;
  border: none;
  border-radius: 12px;
  background: #111827;
  color: #ffffff;
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.hw-btn-primary:active {
  transform: scale(0.99);
}

.hw-btn-primary:hover {
  opacity: 0.94;
}

/* =========================
   TABLET / DESKTOP
========================= */
@media (min-width: 768px) {
  .hw-goals-page {
    padding: 16px;
  }

  .hw-goals-header-top h2,
  .hw-goals-header-top #your-goals {
    font-size: 20px;
  }

  .hw-goals-stats {
    gap: 10px;
  }

  .hw-stat-card {
    padding: 12px 10px;
  }

  .hw-goals-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hw-goal-card {
    padding: 12px;
  }
}

.hw-goal-motivational {
  border-style: dashed;
  background: #fafafa;
}

span.month-stat {
    font-size: xx-small;
}
