/* Panchangam website: interactive components (progress bar, tabs, calculators, simulators). Loaded after style.css. */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 70;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--saffron), var(--gold), var(--maroon));
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: var(--maroon);
  color: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s, transform 0.25s var(--ease), visibility 0.25s, background 0.2s;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover {
  background: var(--saffron-deep);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 90;
  max-width: calc(100vw - 32px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Stats strip */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stats-band {
  padding: 36px 0 0;
}

.stat {
  padding: 20px 14px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--gold-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.6vw, 2.6rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--maroon);
}

.stat span {
  color: var(--text-soft);
  font-size: 0.93rem;
}

/* Tabs (shared) */
.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font: 600 0.98rem/1.2 var(--font-body);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}

.tab:hover {
  border-color: var(--saffron);
  transform: translateY(-1px);
}

.tab[aria-selected='true'],
.tab[aria-pressed='true'] {
  background: var(--maroon);
  border-color: var(--maroon);
  color: #fff;
}

[hidden] {
  display: none !important;
}

/* How it works */
.how {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}

.how-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: how;
}

.how-step {
  position: relative;
  margin-bottom: 16px;
  padding: 22px 22px 22px 78px;
  counter-increment: how;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s var(--ease);
}

.how-step::before {
  content: counter(how);
  position: absolute;
  left: 20px;
  top: 20px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--saffron-soft);
  color: var(--maroon-deep);
  font-family: var(--font-display);
  font-size: 1.3rem;
  transition: background 0.25s, color 0.25s;
}

.how-step h3 {
  margin-bottom: 0.25em;
}

.how-step p {
  margin: 0;
  color: var(--text-soft);
}

.is-enhanced .how-step {
  cursor: pointer;
}

.is-enhanced .how-step:hover {
  border-color: var(--saffron);
  transform: translateX(4px);
}

.how-step.is-active {
  border-color: var(--gold);
  box-shadow: var(--shadow);
}

.how-step.is-active::before {
  background: linear-gradient(145deg, var(--saffron), var(--maroon));
  color: #fff;
}

.how-progress {
  height: 3px;
  margin-top: 14px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}

.how-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--saffron);
}

.how-phone {
  display: flex;
  justify-content: center;
}

.how-phone .phone {
  width: min(280px, 72vw);
}

.how-phone img {
  transition: opacity 0.3s;
}

.how-phone img.is-fading {
  opacity: 0;
}

/* Rahu Kalam calculator */
.calc {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  overflow: hidden;
  border: 1px solid var(--gold);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
}

.calc-inputs {
  padding: clamp(22px, 3vw, 34px);
  background: linear-gradient(170deg, var(--ivory-deep), #fff);
  border-right: 1px solid var(--line);
}

.calc-inputs h3 {
  margin-bottom: 0.4em;
}

.calc-inputs .field {
  margin-bottom: 14px;
}

.calc-out {
  padding: clamp(22px, 3vw, 34px);
}

.day-bar {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  margin: 14px 0 8px;
}

.day-bar button {
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--ivory-deep);
  color: var(--text-soft);
  font: 600 0.8rem/1 var(--font-body);
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s, color 0.2s;
}

.day-bar button:hover {
  transform: translateY(-3px);
}

.day-bar button.is-rahu {
  background: var(--maroon);
  color: #fff;
}

.day-bar button.is-yama {
  background: var(--saffron);
  color: #fff;
}

.day-bar button.is-gulika {
  background: var(--gold);
  color: var(--maroon-deep);
}

.day-bar button.is-selected {
  outline: 3px solid var(--text);
  outline-offset: 2px;
}

.day-ends {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.85rem;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.88rem;
  color: var(--text-soft);
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

.calc-results {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
}

.calc-results div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-left: 5px solid var(--line);
  border-radius: 14px;
  background: var(--ivory);
}

.calc-results dt {
  font-weight: 600;
  color: var(--maroon-deep);
}

.calc-results dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.calc-results .r-rahu {
  border-left-color: var(--maroon);
}

.calc-results .r-yama {
  border-left-color: var(--saffron);
}

.calc-results .r-gulika {
  border-left-color: var(--gold);
}

.calc-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.calc-error {
  margin: 12px 0 0;
  color: #b91c1c;
  font-weight: 500;
}

/* Credits wallet */
.wallet {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 22px;
  align-items: start;
}

.wallet-panel {
  padding: clamp(22px, 3vw, 32px);
}

.balance {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 6px 0 4px;
}

.balance strong {
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 4.4rem);
  font-weight: 400;
  line-height: 1;
  color: var(--maroon);
}

.balance span {
  color: var(--text-soft);
}

.meter {
  height: 12px;
  margin: 10px 0 20px;
  border-radius: 12px;
  background: var(--ivory-deep);
  overflow: hidden;
}

.meter span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--saffron), var(--gold));
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.earn-row {
  margin-bottom: 18px;
}

.earn-row label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--maroon-deep);
}

.earn-row output {
  color: var(--saffron-deep);
}

input[type='range'] {
  width: 100%;
  height: 32px;
  background: transparent;
  accent-color: var(--saffron);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

input[type='range']::-webkit-slider-runnable-track {
  height: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ivory-deep);
}

input[type='range']::-moz-range-track {
  height: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ivory-deep);
}

input[type='range']::-webkit-slider-thumb {
  width: 26px;
  height: 26px;
  margin-top: -10px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--saffron);
  box-shadow: 0 1px 6px rgba(82, 20, 37, 0.45);
  -webkit-appearance: none;
  appearance: none;
}

input[type='range']::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--saffron);
  box-shadow: 0 1px 6px rgba(82, 20, 37, 0.45);
}

.earn-total {
  display: grid;
  gap: 6px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--ivory-deep);
  font-size: 0.95rem;
}

.earn-total div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.earn-total span {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #dcfce7;
  color: var(--success);
  font-size: 0.88rem;
  font-weight: 600;
}

.unlock-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.unlock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease), opacity 0.2s;
}

.unlock:hover:not(:disabled) {
  border-color: var(--saffron);
  transform: translateX(3px);
}

.unlock .cost {
  flex: none;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--saffron-soft);
  color: var(--maroon-deep);
  font-size: 0.88rem;
  font-weight: 700;
}

.unlock[aria-pressed='true'] {
  border-color: var(--success);
  background: #f0fdf4;
}

.unlock[aria-pressed='true'] .cost {
  background: #dcfce7;
  color: var(--success);
}

.unlock:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.unlock small {
  display: block;
  color: var(--muted);
}

.wallet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.btn-sm {
  min-height: 40px;
  padding: 8px 16px;
  font-size: 0.92rem;
}

/* Benefit cards */
.benefit {
  display: flex;
  gap: 16px;
  padding: 24px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s;
}

.benefit:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.benefit h3 {
  margin-bottom: 0.25em;
  font-size: 1.15rem;
}

.benefit p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.97rem;
}

.benefit .feature-icon {
  flex: none;
  margin-bottom: 0;
}

/* Comparison */
.compare-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

table.compare {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

.compare th,
.compare td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
}

.compare thead th {
  background: var(--ivory-deep);
  color: var(--maroon-deep);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 400;
}

.compare thead th.us {
  background: var(--maroon);
  color: #fff;
}

.compare tbody th {
  font-weight: 500;
  text-align: left;
}

.compare td.us {
  background: rgba(212, 175, 55, 0.12);
}

.compare tr:last-child th,
.compare tr:last-child td {
  border-bottom: 0;
}

.compare .yes,
.compare .no,
.compare .meh {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-weight: 700;
}

.compare .yes {
  background: #dcfce7;
  color: var(--success);
}

.compare .no {
  background: #fee2e2;
  color: #991b1b;
}

.compare .meh {
  width: auto;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--ivory-deep);
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 600;
}

.compare-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.checkup {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
  align-items: start;
}

.checklist {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.checklist label:hover {
  border-color: var(--saffron);
}

.checklist input {
  flex: none;
  width: 20px;
  height: 20px;
  accent-color: var(--maroon);
}

.checklist input:checked + span {
  font-weight: 600;
  color: var(--maroon-deep);
}

.score {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  padding: 24px;
}

.score h3 {
  margin-bottom: 0.3em;
}

.score-row {
  margin-top: 16px;
}

.score-row p {
  display: flex;
  justify-content: space-between;
  margin: 0 0 4px;
  font-weight: 600;
}

.bar {
  height: 14px;
  border-radius: 14px;
  background: var(--ivory-deep);
  overflow: hidden;
}

.bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 14px;
  transition: width 0.5s var(--ease);
}

.bar .you {
  background: var(--muted);
}

.bar .pg {
  background: linear-gradient(90deg, var(--saffron), var(--maroon));
}

.score .verdict {
  margin: 18px 0 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

/* Expandable five-limb cards */
.anga .more {
  display: none;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--maroon);
  font: 600 0.9rem/1 var(--font-body);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.anga .detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  color: var(--text-soft);
  font-size: 0.9rem;
  text-align: left;
}

.is-enhanced .anga .more {
  display: inline-block;
}

.is-enhanced .anga .detail {
  display: none;
}

.is-enhanced .anga.is-open .detail {
  display: block;
}

/* Screenshot lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(30, 10, 16, 0.86);
  backdrop-filter: blur(4px);
}

.lightbox.is-open {
  display: flex;
}

.lightbox figure {
  max-height: 100%;
  margin: 0;
  color: #fff;
  text-align: center;
}

.lightbox img {
  width: auto;
  max-height: calc(100vh - 150px);
  margin: 0 auto;
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
}

.lightbox figcaption {
  margin-top: 12px;
  font-weight: 500;
}

.lightbox button {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}

.lightbox button:hover {
  background: rgba(255, 255, 255, 0.28);
}

.lightbox .lb-close {
  top: 16px;
  right: 16px;
}

.lightbox .lb-prev {
  top: 50%;
  left: 16px;
}

.lightbox .lb-next {
  top: 50%;
  right: 16px;
}

.is-enhanced .shot .phone {
  cursor: zoom-in;
}

/* Search box on documents and the FAQ */
.doc-tools {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.is-enhanced .doc-tools {
  display: flex;
}

.search {
  position: relative;
  flex: 1 1 240px;
}

.search .icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 20px;
  height: 20px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px 10px 44px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search input:focus {
  outline: none;
  border-color: var(--saffron);
  box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.18);
}

.result-count {
  color: var(--muted);
  font-size: 0.92rem;
}

mark {
  padding: 0 2px;
  border-radius: 4px;
  background: var(--gold-soft);
  color: inherit;
}

.no-results {
  padding: 22px;
  border: 1px dashed var(--saffron);
  border-radius: var(--radius);
  background: var(--ivory);
  color: var(--text-soft);
  text-align: center;
}

.copy-link {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-left: 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
}

.doc h2:hover .copy-link,
.copy-link:focus-visible {
  opacity: 1;
}

.copy-link:hover {
  background: var(--saffron-soft);
  color: var(--maroon);
}

@media (hover: none) {
  .copy-link {
    opacity: 0.7;
  }
}

/* Delete account helper */
.chooser {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.choice {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease);
}

.choice:hover {
  border-color: var(--saffron);
  transform: translateY(-3px);
}

.choice strong {
  color: var(--maroon-deep);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
}

.choice span {
  color: var(--text-soft);
  font-size: 0.93rem;
}

.choice[aria-pressed='true'] {
  border-color: var(--maroon);
  background: var(--maroon-soft);
  box-shadow: 0 0 0 3px var(--maroon-soft);
}

.mail-builder {
  margin-top: 18px;
  padding: 22px;
}

.mail-preview {
  margin: 14px 0 0;
  padding: 14px 16px;
  border: 1px dashed var(--saffron);
  border-radius: 12px;
  background: var(--ivory-deep);
  font: 0.92rem/1.6 var(--font-body);
  white-space: pre-wrap;
  word-break: break-word;
}

.prep-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.prep-progress {
  margin-top: 14px;
  color: var(--text-soft);
  font-size: 0.93rem;
  font-weight: 500;
}

@media (max-width: 1060px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .how,
  .calc,
  .wallet,
  .checkup {
    grid-template-columns: 1fr;
  }

  .how-phone {
    order: -1;
  }

  .calc-inputs {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .score {
    position: static;
  }

  .chooser {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .how-step {
    padding: 74px 18px 18px;
  }

  .how-step::before {
    top: 18px;
    left: 18px;
  }

  .day-bar button {
    height: 46px;
    font-size: 0.72rem;
  }

  .lightbox .lb-prev,
  .lightbox .lb-next {
    top: auto;
    bottom: 16px;
  }
}

@media print {
  .scroll-progress,
  .to-top,
  .toast,
  .doc-tools,
  .copy-link {
    display: none !important;
  }
}
