@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+SC:wght@400;500;700;800&display=swap');

:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-alt: #eef3fb;
  --surface-hover: #f8fbff;
  --border: #d8e2f0;
  --border-hover: #b8cae3;
  --text: #162033;
  --text-secondary: #52627a;
  --text-tertiary: #7f90aa;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --bg-rgb: 243, 246, 251;
  --accent-rgb: 37, 99, 235;
  --success: #0f9f6e;
  --error: #dc2626;
  --warning: #d97706;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(var(--accent-rgb), 0.14), transparent 24rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(var(--bg-rgb), 1));
  color: var(--text);
  font-family: "Noto Sans SC", "Inter", sans-serif;
  line-height: 1.75;
  letter-spacing: 0.02em;
}

button,
input {
  font: inherit;
}

.background-glow {
  position: fixed;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  filter: blur(10px);
  opacity: 0.35;
  pointer-events: none;
  z-index: -1;
}

.background-glow-left {
  top: -6rem;
  left: -4rem;
  background: rgba(var(--accent-rgb), 0.16);
}

.background-glow-right {
  right: -6rem;
  bottom: 2rem;
  background: rgba(14, 165, 233, 0.14);
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 24px;
}

.hero-grid {
  display: block;
  margin-bottom: 14px;
}

.panel,
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.panel:hover,
.result-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.08);
}

.panel:focus-within,
.result-card:focus-within {
  border-color: rgba(var(--accent-rgb), 0.42);
}

.hero-panel,
.result-card {
  padding: 24px;
}

.page-top,
.section-heading,
.helper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-brand,
.eyebrow,
.side-label,
.summary-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-brand,
.summary-label {
  color: var(--text-tertiary);
}

.eyebrow,
.side-label {
  color: var(--accent);
  margin: 0 0 10px;
}

.hero-copy {
  margin: 14px 0 14px;
}

.hero-title {
  margin: 0;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  max-width: 18ch;
}

.hero-description {
  margin: 10px 0 0;
  max-width: 62ch;
  color: var(--text-secondary);
}

.query-form {
  display: grid;
  gap: 8px;
}

.field {
  display: grid;
  gap: 10px;
}

.field-label {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
}

.query-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
}

.field-input {
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.field-input::placeholder {
  color: var(--text-tertiary);
}

.field-input:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

.field-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12);
  background: #fff;
}

.field-input:disabled {
  background: #f5f7fb;
  color: var(--text-tertiary);
  cursor: not-allowed;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 30px rgba(var(--accent-rgb), 0.18);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(var(--accent-rgb), 0.16);
}

.btn-primary:focus-visible,
a:focus-visible,
:focus-visible {
  outline: 3px solid rgba(var(--accent-rgb), 0.2);
  outline-offset: 3px;
}

.btn-primary:disabled {
  background: #9fb9ef;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.btn-primary.is-loading .spinner {
  display: inline-block;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.04em;
}

.badge-success {
  color: var(--success);
  border-color: rgba(15, 159, 110, 0.18);
  background: rgba(15, 159, 110, 0.08);
}

.badge-warning {
  color: var(--warning);
  border-color: rgba(217, 119, 6, 0.16);
  background: rgba(217, 119, 6, 0.08);
}

.helper-text,
.form-message,
.info-list,
.empty-description {
  color: var(--text-secondary);
}

.helper-row {
  flex-wrap: wrap;
}

.form-message {
  min-height: 20px;
  margin: 0;
  font-size: 14px;
}

.form-message.is-error {
  color: var(--error);
}

.form-message.is-success {
  color: var(--success);
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 6px 0 0;
  font-size: 24px;
  line-height: 1.3;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 14px;
}

.summary-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.summary-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}

.summary-value {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.summary-value-sm {
  font-size: 18px;
  line-height: 1.45;
  word-break: break-all;
}

.empty-state {
  padding: 18px 18px;
  border-radius: 20px;
  border: 1px dashed var(--border);
  background: linear-gradient(180deg, rgba(238, 243, 251, 0.6), rgba(255, 255, 255, 0.92));
  text-align: center;
}

.empty-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
}

.empty-description {
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.result-table th,
.result-table td {
  padding: 16px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.result-table th {
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.result-table td {
  font-size: 15px;
}

.result-table tbody tr:hover {
  background: var(--surface-hover);
}

.result-table tbody tr:last-child td {
  border-bottom: none;
}

.amount {
  font-weight: 700;
}

.hidden {
  display: none;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1024px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .page-shell {
    width: min(100% - 20px, 1120px);
    padding: 14px 0 20px;
  }

  .hero-panel,
  .result-card {
    padding: 22px;
    border-radius: 20px;
  }

  .hero-title {
    font-size: 28px;
  }

  .query-row,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .page-top {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
