/* Calculators — shared layout + components */

.calc-page {
  --calc-navy: #0f172a;
  --calc-muted: #64748b;
  --calc-border: #e5e9f0;
  --calc-cream: #fff8f1;
  --calc-soft: #f4f6fb;
  --calc-shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
  --calc-shadow-sm: 0 4px 16px rgba(15, 23, 42, 0.05);
  --calc-radius: 18px;
  --calc-theme-a: #fde6d3;
  --calc-theme-b: #ffe8b8;
  --calc-theme-c: #fff4e6;
  --calc-theme-accent: #ec6734;
  background: var(--calc-soft);
}

/* Theme variants — softly tinted hero backgrounds */
.calc-page--theme-sunrise {
  --calc-theme-a: #ffe5cc;
  --calc-theme-b: #ffd6a5;
  --calc-theme-c: #fff4e6;
  --calc-theme-accent: #ec6734;
}
.calc-page--theme-mint {
  --calc-theme-a: #d1fae5;
  --calc-theme-b: #fde68a;
  --calc-theme-c: #ecfdf5;
  --calc-theme-accent: #059669;
}
.calc-page--theme-violet {
  --calc-theme-a: #ede9fe;
  --calc-theme-b: #fce7f3;
  --calc-theme-c: #f5f3ff;
  --calc-theme-accent: #7c3aed;
}
.calc-page--theme-sky {
  --calc-theme-a: #dbeafe;
  --calc-theme-b: #cffafe;
  --calc-theme-c: #eff6ff;
  --calc-theme-accent: #2563eb;
}
.calc-page--theme-coral {
  --calc-theme-a: #fee2e2;
  --calc-theme-b: #fde68a;
  --calc-theme-c: #fff1f2;
  --calc-theme-accent: #ec6734;
}

/* —— Hero —— */
.calc-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(96px, 10vw, 130px) 0 clamp(40px, 5vw, 64px);
  background: linear-gradient(160deg, var(--calc-theme-c) 0%, #ffffff 60%, var(--calc-theme-c) 100%);
  border-bottom: 1px solid var(--calc-border);
}

.calc-hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.calc-hero__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  will-change: transform;
}

.calc-hero__blob--a {
  top: -120px;
  right: -80px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, var(--calc-theme-a) 0%, transparent 70%);
  animation: calc-blob-float 14s ease-in-out infinite;
}

.calc-hero__blob--b {
  bottom: -160px;
  left: -100px;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, var(--calc-theme-b) 0%, transparent 70%);
  animation: calc-blob-float 18s ease-in-out infinite reverse;
}

.calc-hero__blob--c {
  top: 30%;
  left: 45%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(236, 103, 52, 0.18) 0%, transparent 70%);
  animation: calc-blob-float 22s ease-in-out infinite 4s;
}

.calc-hero__dots {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(15, 23, 42, 0.08) 1.2px, transparent 1.5px);
  background-size: 22px 22px;
  background-position: 0 0;
  opacity: 0.5;
  mask-image: linear-gradient(180deg, transparent 0, #000 30%, #000 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 30%, #000 70%, transparent 100%);
}

@keyframes calc-blob-float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(20px, -28px, 0) scale(1.06); }
}

.calc-hero__inner {
  position: relative;
}

.calc-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 28px;
  font-size: 0.875rem;
  color: var(--calc-muted);
}

.calc-breadcrumb a:hover {
  color: var(--calc-theme-accent);
}

.calc-hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(32px, 5vw, 56px);
  align-items: center;
}

@media (min-width: 880px) {
  .calc-hero__grid {
    grid-template-columns: 1.05fr 1fr;
  }
}

.calc-hero__copy {
  position: relative;
  z-index: 2;
}

.calc-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 7px 14px 7px 7px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--calc-navy);
}

.calc-hero__badge-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: linear-gradient(145deg, var(--calc-theme-accent) 0%, color-mix(in srgb, var(--calc-theme-accent) 70%, #000) 100%);
  color: #fff;
}

.calc-hero__badge-icon svg {
  width: 16px;
  height: 16px;
}

.calc-hero__title {
  margin: 0 0 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 1.3rem + 2.6vw, 3.2rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--calc-navy);
  letter-spacing: -0.025em;
}

.calc-hero__deck {
  margin: 0 0 26px;
  max-width: 56ch;
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.12rem);
  line-height: 1.65;
  color: #334155;
}

.calc-hero__highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
}

.calc-hero__highlights li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.calc-hero__highlights strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  color: var(--calc-navy);
  font-weight: 800;
  line-height: 1.2;
}

.calc-hero__highlights span {
  font-size: 0.78rem;
  color: var(--calc-muted);
  line-height: 1.3;
}

.calc-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.calc-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 700;
  background: linear-gradient(145deg, var(--calc-theme-accent) 0%, color-mix(in srgb, var(--calc-theme-accent) 75%, #000) 100%);
  box-shadow: 0 14px 28px rgba(236, 103, 52, 0.28);
}

.calc-hero__cta span {
  display: inline-block;
  transition: transform 0.25s ease;
}

.calc-hero__cta:hover span {
  transform: translateY(3px);
}

.calc-hero__link {
  font-weight: 700;
  color: var(--calc-navy);
  text-decoration: none;
  border-bottom: 2px solid currentColor;
  padding-bottom: 2px;
  transition: color 0.18s ease;
}

.calc-hero__link:hover {
  color: var(--calc-theme-accent);
}

/* —— Illustration —— */
.calc-hero__visual {
  position: relative;
}

.calc-illus {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  padding: 18px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.4) 60%),
    linear-gradient(145deg, var(--calc-theme-a) 0%, var(--calc-theme-b) 100%);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow:
    0 30px 60px rgba(15, 23, 42, 0.12),
    0 8px 24px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  overflow: hidden;
}

.calc-illus::before {
  content: "";
  position: absolute;
  inset: -2px;
  background:
    radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.5), transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(255, 255, 255, 0.25), transparent 60%);
  pointer-events: none;
  border-radius: inherit;
}

.calc-illus__svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
}

.calc-illus__float {
  transform-origin: center;
  will-change: transform;
}

.calc-illus__float--slow {
  animation: calc-float 6.5s ease-in-out infinite;
}

.calc-illus__float--med {
  animation: calc-float 4.5s ease-in-out infinite;
}

.calc-illus__float--fast {
  animation: calc-float 3.2s ease-in-out infinite;
}

@keyframes calc-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(1.5deg); }
}

.calc-illus__sparkles text {
  animation: calc-sparkle 2.4s ease-in-out infinite;
  transform-origin: center;
}

.calc-illus__sparkles text:nth-child(2) { animation-delay: 0.4s; }
.calc-illus__sparkles text:nth-child(3) { animation-delay: 0.8s; }
.calc-illus__sparkles text:nth-child(4) { animation-delay: 1.2s; }
.calc-illus__sparkles text:nth-child(5) { animation-delay: 1.6s; }

@keyframes calc-sparkle {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}

/* —— Body layout —— */
.calc-shell {
  padding: clamp(32px, 4vw, 56px) 0 clamp(64px, 8vw, 88px);
}

.calc-shell__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 960px) {
  .calc-shell__grid {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 32px;
    align-items: flex-start;
  }
}

.calc-main {
  min-width: 0;
}

/* —— Card —— */
.calc-card {
  padding: clamp(24px, 3vw, 36px);
  border-radius: 22px;
  background: #fff;
  border: 1px solid var(--calc-border);
  box-shadow: var(--calc-shadow);
}

.calc-card__head {
  margin-bottom: 24px;
}

.calc-card__head h2 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.3rem, 1.1rem + 0.6vw, 1.65rem);
  color: var(--calc-navy);
}

.calc-card__head p {
  margin: 0;
  color: var(--calc-muted);
  line-height: 1.55;
}

/* —— Form —— */
.calc-form {
  display: grid;
  gap: 18px;
}

.calc-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calc-field > label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--calc-navy);
}

.calc-field input[type="number"],
.calc-field input[type="date"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  border: 1.5px solid var(--calc-border);
  border-radius: 12px;
  background: #fff;
  color: var(--calc-navy);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.calc-field input:focus {
  outline: none;
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px rgba(236, 103, 52, 0.15);
}

.calc-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.calc-inline input {
  flex: 1;
  min-width: 0;
}

/* Toggle (Add / Remove) */
.calc-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--calc-soft);
  border: 1px solid var(--calc-border);
  border-radius: 14px;
}

.calc-toggle--sm {
  padding: 3px;
}

.calc-toggle__btn {
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--calc-muted);
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.calc-toggle--sm .calc-toggle__btn {
  padding: 8px 14px;
  font-size: 0.8rem;
}

.calc-toggle__btn.is-active {
  background: #fff;
  color: var(--brand-orange);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

/* Chips (GST rate quick-pick) */
.calc-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.calc-chip {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--calc-navy);
  background: var(--calc-soft);
  border: 1.5px solid var(--calc-border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.calc-chip:hover {
  border-color: rgba(236, 103, 52, 0.4);
}

.calc-chip.is-active {
  background: var(--brand-orange);
  border-color: var(--brand-orange);
  color: #fff;
}

/* Radio grid (CGPA / SGPA formulas) */
.calc-radio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 540px) {
  .calc-radio-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.calc-radio {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--calc-border);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.calc-radio:hover {
  border-color: rgba(236, 103, 52, 0.35);
}

.calc-radio input {
  margin-top: 4px;
  accent-color: var(--brand-orange);
}

.calc-radio span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calc-radio strong {
  font-size: 0.9rem;
  color: var(--calc-navy);
}

.calc-radio em {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--calc-muted);
}

.calc-radio input:checked + span strong {
  color: var(--brand-orange);
}

.calc-radio:has(input:checked) {
  border-color: var(--brand-orange);
  background: var(--calc-cream);
}

/* Actions */
.calc-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.calc-form__actions .btn {
  min-height: 46px;
  padding-inline: 22px;
}

.calc-error {
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.875rem;
  border: 1px solid #fecaca;
}

/* —— Result —— */
.calc-result {
  display: block;
  margin-top: 28px;
  padding: 24px;
  border-radius: 18px;
  background: linear-gradient(150deg, var(--calc-cream) 0%, #fff 100%);
  border: 1px solid rgba(236, 103, 52, 0.2);
  animation: calc-result-in 0.4s ease-out;
}

@keyframes calc-result-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.calc-result__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.calc-result__cell {
  padding: 18px 14px;
  text-align: center;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--calc-border);
  box-shadow: var(--calc-shadow-sm);
}

.calc-result__cell span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--calc-muted);
}

.calc-result__cell strong {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem);
  font-weight: 800;
  color: var(--calc-navy);
}

.calc-result__hero {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 24px;
  margin-bottom: 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-orange) 0%, #c2410c 100%);
  color: #fff;
}

.calc-result__hero span {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.92;
}

.calc-result__hero strong {
  font-size: clamp(1.8rem, 1.3rem + 1.5vw, 2.6rem);
  font-weight: 800;
}

.calc-result__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.calc-result__list--lg {
  gap: 10px;
}

.calc-result__list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--calc-border);
}

.calc-result__list--lg li {
  padding: 14px 18px;
}

.calc-result__list span {
  font-size: 0.875rem;
  color: var(--calc-muted);
}

.calc-result__list strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--calc-navy);
}

.calc-result__breakdown {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #fff;
  border: 1px dashed #fdba74;
  font-size: 0.85rem;
  color: var(--calc-navy);
}

.calc-result__breakdown:empty {
  display: none;
}

.calc-result__chart {
  margin-top: 16px;
  height: 14px;
  border-radius: 999px;
  background: #fee2c4;
  overflow: hidden;
  display: flex;
}

.calc-result__chart span {
  display: block;
  height: 100%;
  background: var(--brand-orange);
}

.calc-result__chart span:last-child {
  background: #fbbf24;
}

/* —— Explainer —— */
.calc-explainer {
  margin-top: 24px;
  padding: clamp(20px, 2.5vw, 28px);
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--calc-border);
  box-shadow: var(--calc-shadow-sm);
}

.calc-explainer h2 {
  margin: 0 0 10px;
  font-size: 1.2rem;
  color: var(--calc-navy);
}

.calc-explainer h3 {
  margin: 14px 0 8px;
  font-size: 1rem;
  color: var(--calc-navy);
}

.calc-explainer p,
.calc-explainer li {
  margin: 0 0 8px;
  line-height: 1.65;
  color: #334155;
}

.calc-explainer ol {
  margin: 0;
  padding-left: 1.25em;
}

/* —— Aside —— */
.calc-aside {
  padding: 22px;
  background: #fff;
  border-radius: 20px;
  border: 1px solid var(--calc-border);
  box-shadow: var(--calc-shadow-sm);
  position: sticky;
  top: calc(66px + 16px);
}

.calc-aside__title {
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--calc-muted);
}

.calc-aside__list {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.calc-aside__link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--calc-navy);
  transition: background 0.15s ease, color 0.15s ease;
}

.calc-aside__link:hover {
  background: var(--calc-soft);
}

.calc-aside__link.is-active {
  background: var(--calc-cream);
}

.calc-aside__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  flex-shrink: 0;
  background: var(--calc-soft);
  color: var(--brand-orange);
}

.calc-aside__link.is-active .calc-aside__icon {
  background: var(--brand-orange);
  color: #fff;
}

.calc-aside__icon svg {
  width: 18px;
  height: 18px;
}

.calc-aside__link span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.calc-aside__link strong {
  font-size: 0.9rem;
  font-weight: 700;
}

.calc-aside__link em {
  font-style: normal;
  font-size: 0.75rem;
  color: var(--calc-muted);
  line-height: 1.35;
}

.calc-aside__link.is-active strong {
  color: var(--brand-orange);
}

.calc-aside__cta {
  padding: 18px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--calc-navy) 0%, #1e293b 100%);
  color: #fff;
}

.calc-aside__cta-kicker {
  margin: 0 0 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fdba74;
}

.calc-aside__cta-text {
  margin: 0 0 12px;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #cbd5e1;
}

.calc-aside__cta-btn {
  width: 100%;
  justify-content: center;
}

@media (max-width: 959px) {
  .calc-aside {
    position: static;
  }
}

@media (max-width: 640px) {
  .calc-hero__highlights {
    grid-template-columns: 1fr;
  }
  .calc-illus {
    padding: 14px;
    border-radius: 22px;
  }
}

@media (max-width: 540px) {
  .calc-result__grid {
    grid-template-columns: 1fr;
  }
  .calc-hero__actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .calc-hero__cta {
    justify-content: center;
  }
  .calc-hero__link {
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .calc-result,
  .calc-hero__blob,
  .calc-illus__float,
  .calc-illus__sparkles text {
    animation: none;
  }
}
