/**
 * Darbhanga Monthly Budget Planner v2 — glassmorphism, gauge, sticky total, mobile-first
 */

.psh-budget-calculator--v2 {
  position: relative;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
  padding: clamp(1.15rem, 3vw, 1.65rem);
  border-radius: 20px;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.82) 0%,
    rgba(248, 250, 252, 0.88) 50%,
    rgba(236, 253, 245, 0.75) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow:
    0 4px 24px rgba(15, 23, 42, 0.06),
    0 0 0 1px rgba(5, 150, 105, 0.08) inset;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
}

.psh-budget-v2__title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.2rem, 3vw, 1.45rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0c1222;
  line-height: 1.2;
}

.psh-budget-v2__subtitle {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #64748b;
}

.psh-budget-v2__presets-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.65rem 0.75rem;
  margin-bottom: 1.25rem;
}

.psh-budget-v2__presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex: 1 1 16rem;
  min-width: 0;
}

.psh-budget-v2__preset {
  flex: 1 1 auto;
  min-width: calc(33.333% - 0.35rem);
  padding: 0;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.65);
  color: #0f172a;
  cursor: pointer;
  overflow: hidden;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.psh-budget-v2__preset-hero {
  display: block;
  line-height: 0;
  background: rgba(248, 250, 252, 0.8);
}

.psh-budget-v2__preset-hero img {
  display: block;
  width: 100%;
  height: 3.25rem;
  object-fit: cover;
  object-position: center;
}

.psh-budget-v2__preset-label {
  display: block;
  padding: 0.45rem 0.5rem 0.5rem;
}

.psh-budget-v2__method {
  flex: 0 0 auto;
  max-width: 100%;
  font-size: 0.8rem;
  color: #475569;
  border-radius: 12px;
  border: 1px dashed rgba(100, 116, 139, 0.4);
  background: rgba(255, 255, 255, 0.5);
  padding: 0 0.55rem 0.45rem;
  align-self: center;
}

.psh-budget-v2__method-summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.15rem 0.35rem;
  font-weight: 600;
  color: #334155;
  user-select: none;
}

.psh-budget-v2__method-summary:focus-visible {
  outline: 2px solid #059669;
  outline-offset: 2px;
  border-radius: 6px;
}

.psh-budget-v2__method-summary::-webkit-details-marker {
  display: none;
}

.psh-budget-v2__method-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  background: rgba(5, 150, 105, 0.15);
  color: #047857;
  line-height: 1;
}

.psh-budget-v2__method-body {
  padding: 0 0.15rem 0.2rem;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  margin-top: 0.15rem;
  padding-top: 0.5rem;
}

.psh-budget-v2__method-body p {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.55;
  color: #64748b;
}

@media (max-width: 420px) {
  .psh-budget-v2__preset {
    min-width: 100%;
  }

  .psh-budget-v2__method {
    flex: 1 1 100%;
  }
}

.psh-budget-v2__preset:hover {
  border-color: #059669;
  box-shadow: 0 2px 12px rgba(5, 150, 105, 0.15);
}

.psh-budget-v2__preset:active {
  transform: scale(0.98);
}

.psh-budget-v2__preset--active {
  border-color: #059669;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  color: #065f46;
}

.psh-budget-v2__gauge-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.psh-budget-v2__gauge-svg {
  width: 132px;
  height: 132px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(15, 23, 42, 0.08));
}

.psh-budget-v2__gauge-ring-bg {
  fill: none;
  stroke: rgba(226, 232, 240, 0.95);
  stroke-width: 9;
}

.psh-budget-v2__gauge-ring {
  fill: none;
  stroke: #059669;
  stroke-width: 9;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 0.45s ease, stroke 0.35s ease;
}

.psh-budget-v2__gauge-ring.psh-budget-v2--zone-safe {
  stroke: #059669;
}

.psh-budget-v2__gauge-ring.psh-budget-v2--zone-mid {
  stroke: #2563eb;
}

.psh-budget-v2__gauge-ring.psh-budget-v2--zone-high {
  stroke: #ea580c;
}

.psh-budget-v2__gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.psh-budget-v2__gauge-wrap {
  position: relative;
  width: 132px;
  height: 132px;
}

.psh-budget-v2__gauge-amount {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0c1222;
  line-height: 1.1;
}

.psh-budget-v2__gauge-cap {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-top: 2px;
}

.psh-budget-v2__zone-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.psh-budget-v2__zone-pill.psh-budget-v2--zone-safe {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.psh-budget-v2__zone-pill.psh-budget-v2--zone-mid {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}

.psh-budget-v2__zone-pill.psh-budget-v2--zone-high {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fdba74;
}

.psh-budget-v2__name-field {
  margin-bottom: 1rem;
}

.psh-budget-v2__name-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.4rem;
}

.psh-budget-v2__name-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.85rem;
  font-size: 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
}

.psh-budget-v2__name-input:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
}

.psh-budget-calculator--v2 .psh-bc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem 1.25rem;
  margin-bottom: 1rem;
}

@media (min-width: 480px) {
  .psh-budget-calculator--v2 .psh-bc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.psh-budget-calculator--v2 .psh-bc-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.4rem;
}

.psh-budget-calculator--v2 .psh-bc-field .psh-bc-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 52px;
  padding: 0.7rem 0.85rem;
  font-size: 1.0625rem;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
}

.psh-budget-calculator--v2 .psh-bc-field .psh-bc-input:focus {
  outline: none;
  border-color: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
}

.psh-budget-v2__accordion {
  margin: 0.5rem 0 1rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.5);
  overflow: hidden;
}

.psh-budget-v2__accordion summary {
  padding: 0.85rem 1rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: #0f172a;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.psh-budget-v2__accordion summary::-webkit-details-marker {
  display: none;
}

.psh-budget-v2__accordion summary::after {
  content: '▾';
  font-size: 0.75rem;
  color: #64748b;
  transition: transform 0.2s ease;
}

.psh-budget-v2__accordion[open] summary::after {
  transform: rotate(-180deg);
}

.psh-budget-v2__accordion-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid rgba(226, 232, 240, 0.8);
}

.psh-budget-v2__addon {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(241, 245, 249, 0.9);
  font-size: 0.875rem;
  line-height: 1.45;
  color: #334155;
}

.psh-budget-v2__addon:last-child {
  border-bottom: none;
}

.psh-budget-v2__addon input[type='checkbox'] {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: #059669;
}

.psh-budget-v2__addon-icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  color: #059669;
  opacity: 0.9;
}

.psh-budget-v2__addon-text {
  flex: 1;
  min-width: 0;
}

.psh-budget-v2__addon-text strong {
  display: block;
  color: #0f172a;
  margin-bottom: 0.15rem;
}

.psh-budget-v2__addon-amt {
  font-weight: 800;
  color: #047857;
  white-space: nowrap;
}

.psh-budget-v2__advice {
  min-height: 2.75rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.45;
  background: rgba(254, 252, 232, 0.85);
  border: 1px solid rgba(253, 224, 71, 0.5);
  color: #713f12;
}

.psh-budget-v2__advice:empty {
  display: none;
}

.psh-budget-v2__saver {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  margin-bottom: 0.85rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border: 1px solid #6ee7b7;
  color: #065f46;
}

.psh-budget-v2__saver.is-visible {
  display: flex;
}

.psh-budget-v2__actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

@media (min-width: 520px) {
  .psh-budget-v2__actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

.psh-budget-v2__btn {
  flex: 1 1 auto;
  min-height: 48px;
  padding: 0.65rem 1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  text-align: center;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    filter 0.15s ease,
    box-shadow 0.15s ease;
}

.psh-budget-v2__btn--primary {
  background: linear-gradient(180deg, #059669, #047857);
  color: #fff;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
}

.psh-budget-v2__btn--wa {
  background: linear-gradient(180deg, #25d366, #128c7e);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.25);
}

.psh-budget-v2__btn:hover {
  filter: brightness(1.05);
}

.psh-budget-v2__btn:active {
  transform: scale(0.99);
}

.psh-budget-v2__sticky {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 1rem calc(-1 * clamp(1.15rem, 3vw, 1.65rem)) calc(-1 * clamp(1.15rem, 3vw, 1.65rem));
  margin-top: 1.25rem;
  padding: 1rem clamp(1.15rem, 3vw, 1.65rem);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.92) 35%, #fff 100%);
  border-top: 1px solid rgba(226, 232, 240, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.psh-budget-v2__sticky-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.psh-budget-v2__sticky .psh-budget-sum {
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0c1222;
}

.psh-budget-v2__sticky.psh-budget-v2--zone-safe .psh-budget-sum {
  color: #047857;
}

.psh-budget-v2__sticky.psh-budget-v2--zone-mid .psh-budget-sum {
  color: #1d4ed8;
}

.psh-budget-v2__sticky.psh-budget-v2--zone-high .psh-budget-sum {
  color: #c2410c;
}

@media print {
  .psh-budget-v2__presets,
  .psh-budget-v2__actions,
  .psh-budget-v2__sticky {
    display: none !important;
  }
}
