/* tools.php — utilities hub (rich layout) */

.tp-shell {
  min-height: 50vh;
  padding-bottom: 8px;
  background:
    radial-gradient(1200px 480px at 10% -10%, rgba(13, 148, 136, 0.12) 0, transparent 55%),
    radial-gradient(900px 400px at 95% 20%, rgba(15, 118, 110, 0.06) 0, transparent 50%),
    linear-gradient(180deg, #faf8f3 0%, #f4f1ea 38%, #f8fafc 100%);
}

.tp-page {
  --tp-teal: var(--na-teal, #0d9488);
  --tp-teal-dark: var(--na-teal-dark, #0f766e);
  --tp-ink: var(--na-ink, #0c1222);
  --tp-muted: var(--na-muted, #64748b);
  --tp-line: #e2e8f0;
  width: min(1120px, 94%);
  margin: 0 auto;
  padding: 0 0 40px;
  font-family: var(--na-font);
  color: var(--tp-ink);
}

.tp-bc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 18px 0 10px;
  font-size: 0.8125rem;
  color: var(--tp-muted);
}

.tp-bc a {
  color: var(--na-teal-dark, #0f766e);
  text-decoration: none;
  font-weight: 600;
}

.tp-bc a:hover {
  text-decoration: underline;
}

.tp-bc__sep {
  color: #cbd5e1;
  user-select: none;
}

.tp-disclaimer {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(234, 179, 8, 0.4);
  background: linear-gradient(180deg, #fffbeb 0%, #fefce8 100%);
  font-size: 0.8125rem;
  line-height: 1.55;
  color: #713f12;
  box-shadow: 0 4px 18px rgba(180, 83, 9, 0.06);
}

.tp-kicker {
  margin: 0 0 10px;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tp-teal-dark);
}

.tp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 24px;
  align-items: start;
}

.tp-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tp-hero {
  position: relative;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 50%, rgba(240, 253, 250, 0.5) 100%);
  box-shadow:
    0 0 0 1px rgba(226, 232, 240, 0.8) inset,
    0 20px 50px rgba(15, 23, 42, 0.08);
  padding: 24px 24px 20px;
  overflow: hidden;
}

.tp-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--na-teal), var(--na-teal-mid), var(--na-teal-dark));
  border-radius: 22px 22px 0 0;
}

.tp-hero__eyebrow {
  margin: 8px 0 10px;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tp-teal-dark);
}

.tp-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.45rem, 3.2vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.15;
  background: linear-gradient(120deg, #0f172a 0%, #134e4a 55%, #0f172a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tp-hero > p {
  margin: 0;
  max-width: 58ch;
  font-size: 1.02rem;
  line-height: 1.6;
  color: #475569;
}

.tp-segments {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--tp-line);
}

.tp-segments__label {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--tp-muted);
  margin-bottom: 8px;
}

.tp-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tp-pill {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  color: #334155;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.tp-pill:hover {
  border-color: rgba(0, 150, 136, 0.4);
  color: var(--tp-teal-dark);
  transform: translateY(-1px);
}

.tp-pill--active {
  border-color: rgba(0, 150, 136, 0.5);
  background: linear-gradient(180deg, rgba(0, 150, 136, 0.12) 0%, #fff 100%);
  color: var(--tp-teal-dark);
  box-shadow: 0 6px 18px rgba(0, 150, 136, 0.15);
}

.tp-cal-intro {
  margin: 0;
  font-size: 0.9375rem;
  color: #475569;
  line-height: 1.55;
  max-width: 62ch;
}

.tp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tp-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--tp-line);
  border-radius: 18px;
  padding: 18px 18px 16px;
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.07);
  scroll-margin-top: calc(var(--na-header-offset, 72px) + 12px);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tp-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  opacity: 0.95;
}

.tp-card--budget::before {
  background: linear-gradient(90deg, var(--na-teal), #2dd4bf);
}
.tp-card--emi::before {
  background: linear-gradient(90deg, #2563eb, #38bdf8);
}
.tp-card--loan::before {
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
}
.tp-card--area::before {
  background: linear-gradient(90deg, #d97706, #fbbf24);
}

.tp-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.1);
  border-color: #d8e0ec;
}

.tp-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.tp-card__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.tp-card--budget .tp-card__icon {
  background: linear-gradient(135deg, var(--na-teal), var(--na-teal-ink, #115e59));
}
.tp-card--emi .tp-card__icon {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
}
.tp-card--loan .tp-card__icon {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
}
.tp-card--area .tp-card__icon {
  background: linear-gradient(135deg, #d97706, #b45309);
}

.tp-card h2 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.tp-card > p.tp-card__sub {
  margin: 0 0 14px;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--tp-muted);
}

.tp-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tp-field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.tp-field label {
  font-size: 0.75rem;
  color: #475569;
  font-weight: 800;
}

.tp-field input,
.tp-field select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fafbfc;
  font: inherit;
  font-size: 0.9375rem;
  box-sizing: border-box;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.tp-field input:focus,
.tp-field select:focus {
  outline: none;
  border-color: rgba(0, 150, 136, 0.55);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 150, 136, 0.12);
}

.tp-result {
  margin-top: 12px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: linear-gradient(145deg, #eff6ff 0%, #f0fdfa 55%, #f8fafc 100%);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.06);
}

.tp-result > div:first-child {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tp-muted);
}

.tp-result strong {
  display: block;
  margin-top: 8px;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--tp-ink);
}

.tp-meta {
  font-size: 0.78rem;
  color: var(--tp-muted);
  margin-top: 8px;
  line-height: 1.45;
}

.tp-cta {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--na-teal) 0%, var(--na-teal-dark) 100%);
  color: #fff !important;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.875rem;
  box-shadow: 0 8px 22px rgba(0, 150, 136, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tp-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0, 150, 136, 0.42);
}

.tp-aside {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: calc(var(--na-header-offset, 72px) + 12px);
}

.tp-aside-card {
  display: block;
  padding: 18px 16px;
  border-radius: 16px;
  border: 1px solid var(--tp-line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.tp-aside-card:hover {
  border-color: rgba(0, 150, 136, 0.35);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.tp-aside-card__k {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--tp-teal-dark);
  margin-bottom: 6px;
}

.tp-aside-card__t {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.tp-aside-card__d {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--tp-muted);
}

.tp-aside-card__go {
  margin-top: 10px;
  font-size: 0.8125rem;
  font-weight: 800;
  color: var(--tp-teal-dark);
}

@media (max-width: 900px) {
  .tp-layout {
    grid-template-columns: 1fr;
  }

  .tp-aside {
    position: static;
    order: -1;
  }

  .tp-grid {
    grid-template-columns: 1fr;
  }

  .tp-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tp-card,
  .tp-pill,
  .tp-cta,
  .tp-aside-card {
    transition: none;
  }

  .tp-card:hover,
  .tp-pill:hover,
  .tp-cta:hover,
  .tp-aside-card:hover {
    transform: none;
  }
}
