:root {
  color-scheme: light;
  --bg-1: #f7fbff;
  --bg-2: #edf4ff;
  --bg-3: #f8fbff;
  --card: rgba(255, 255, 255, 0.9);
  --text-main: #1f3852;
  --text-soft: #4b647c;
  --line: rgba(16, 98, 163, 0.2);
  --cta: #0a84d8;
  --cta-hover: #076eb3;
  --cta-text: #ffffff;
  --accent: #f59e0b;
  --brand-color: #0f6eb3;
  --secondary-border: rgba(22, 65, 102, 0.28);
  --card-title: #125089;
  --card-text: #375775;
  --muted: #5c7086;
  --legal-link: #24557f;
  --legal-link-hover: #0d3f6b;
  --toggle-bg: rgba(255, 255, 255, 0.86);
  --toggle-border: #d0e2f5;
  --toggle-text: #1b4468;
  --toggle-shadow: 0 8px 20px rgba(30, 76, 121, 0.16);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg-1: #07111f;
  --bg-2: #0f172a;
  --bg-3: #132238;
  --card: rgba(15, 23, 42, 0.78);
  --text-main: #ecfeff;
  --text-soft: #c7d2fe;
  --line: rgba(45, 212, 191, 0.28);
  --cta: #14b8a6;
  --cta-hover: #0d9488;
  --cta-text: #052e2b;
  --accent: #f59e0b;
  --brand-color: #67e8f9;
  --secondary-border: rgba(255, 255, 255, 0.3);
  --card-title: #ccfbf1;
  --card-text: #cbd5e1;
  --muted: #94a3b8;
  --legal-link: #cbd5e1;
  --legal-link-hover: #ecfeff;
  --toggle-bg: rgba(17, 29, 45, 0.9);
  --toggle-border: rgba(71, 196, 255, 0.26);
  --toggle-text: #dff6ff;
  --toggle-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body.landing-page,
body.doc-page {
  margin: 0;
  min-height: 100vh;
  color: var(--text-main);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(circle at 8% 14%, rgba(20, 184, 166, 0.2) 0%, transparent 40%),
    radial-gradient(circle at 92% 0%, rgba(245, 158, 11, 0.2) 0%, transparent 38%),
    linear-gradient(165deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-3) 100%);
}

.theme-toggle {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  width: 68px;
  height: 36px;
  border: 1px solid var(--toggle-border);
  background: var(--toggle-bg);
  color: var(--toggle-text);
  border-radius: 999px;
  padding: 0 9px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: var(--toggle-shadow);
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  transform: translateY(-1px);
}

.theme-toggle .theme-icon {
  font-size: 0.88rem;
  line-height: 1;
  opacity: 0.5;
  transition: opacity 0.2s ease;
  z-index: 1;
  width: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle .theme-icon-sun {
  opacity: 1;
}

html[data-theme="dark"] .theme-toggle .theme-icon-sun {
  opacity: 0.45;
}

html[data-theme="dark"] .theme-toggle .theme-icon-moon {
  opacity: 1;
}

.theme-toggle .theme-icon-moon {
  transform: translateX(-2px);
}

.theme-toggle .theme-toggle-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--cta);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.22s ease, background-color 0.22s ease;
}

html[data-theme="dark"] .theme-toggle .theme-toggle-thumb {
  transform: translateX(32px);
}

body.landing-page {
  padding: 28px 16px 36px;
  display: grid;
  place-items: center;
}

.landing-page .shell {
  width: min(1040px, 100%);
  display: grid;
  gap: 18px;
  text-align: center;
}

.landing-page .hero {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 20px;
  backdrop-filter: blur(6px);
  padding: clamp(20px, 4vw, 38px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}

.landing-page .brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.landing-page .brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.landing-page .brand-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--brand-color);
}

.landing-page h1 {
  margin: 0 auto 12px;
  font-size: clamp(1.7rem, 4.4vw, 3rem);
  line-height: 1.1;
  max-width: 18ch;
}

.landing-page h3 {
  margin: 0 auto;
  max-width: 68ch;
  line-height: 1.4;
  font-weight: 500;
  color: var(--text-main);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
}

.landing-page .lead {
  margin: 0 auto;
  max-width: 68ch;
  line-height: 1.65;
  color: var(--text-soft);
  font-size: clamp(0.98rem, 2vw, 1.08rem);
}

.landing-page .actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.landing-page .btn {
  border: none;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 140ms ease, background-color 140ms ease, color 140ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 16px;
}

.landing-page .btn-primary {
  background: var(--cta);
  color: var(--cta-text);
  min-height: 70px;
  padding: 18px 42px;
  font-size: 1.04rem;
}

.landing-page .btn-primary:hover,
.landing-page .btn-primary:focus-visible {
  background: var(--cta-hover);
  color: var(--cta-text);
  transform: translateY(-1px);
}

.landing-page .btn-secondary {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--secondary-border);
}

.landing-page .btn-secondary:hover,
.landing-page .btn-secondary:focus-visible {
  border-color: var(--accent);
  color: #fde68a;
  transform: translateY(-1px);
}

.landing-page .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.landing-page .card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: border-color 140ms ease, transform 140ms ease;
}

.landing-page .card:hover,
.landing-page .card:focus-visible {
  border-color: var(--cta);
  transform: translateY(-2px);
}

.landing-page .card h2 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  color: var(--card-title);
}

.landing-page .card p {
  margin: 0;
  color: var(--card-text);
  line-height: 1.5;
  font-size: 0.94rem;
}

.landing-page .small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.landing-page .legal-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.9rem;
}

.landing-page .legal-links a {
  color: var(--legal-link);
  text-decoration: none;
}

.landing-page .legal-links a:hover,
.landing-page .legal-links a:focus-visible {
  color: var(--legal-link-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.doc-page {
  padding: 24px 0 40px;
  color: #1f3852;
  background:
    radial-gradient(circle at 8% 14%, rgba(0, 160, 255, 0.1) 0%, transparent 42%),
    radial-gradient(circle at 92% 0%, rgba(255, 193, 78, 0.12) 0%, transparent 42%),
    linear-gradient(165deg, #f7fbff 0%, #eef5ff 52%, #f8fbff 100%);
  background-attachment: fixed;
  background-size: cover;
}

.doc-page .doc-shell {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

.doc-page .legal-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  color: #5c7086;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.doc-page .legal-links a {
  color: #24557f;
  text-decoration: none;
}

.doc-page .legal-links a:hover,
.doc-page .legal-links a:focus-visible {
  color: #0d3f6b;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.doc-page .doc-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: left;
  padding: 48px 24px 16px;
}

.doc-page .doc-header h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4.4vw, 3rem);
  line-height: 1.1;
  color: #163f66;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.doc-page .doc-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 0;
  flex: 0 0 auto;
}

.doc-page .doc-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0, 115, 201, 0.2));
}

.doc-page .doc-close-row {
  display: none;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.doc-page .doc-button {
  appearance: none;
  border: 1px solid #c8dff5;
  border-radius: 12px;
  background: #ffffff;
  color: #164166;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.doc-page .doc-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 116, 201, 0.16);
}

.doc-page .doc-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  border: 1px solid #d7e6f7;
  padding: 32px;
  box-shadow: 0 16px 38px rgba(30, 76, 121, 0.12);
}

.doc-page .doc-card p {
  line-height: 1.65;
  color: #2e4a66;
}

.doc-page .doc-section + .doc-section {
  margin-top: 28px;
}

.doc-page .doc-section h2 {
  margin: 0 0 10px;
  color: #125089;
}

.doc-page .doc-cta-wrap {
  margin-top: 24px;
  text-align: center;
}

.doc-page .doc-cta {
  background: #0a84d8;
  color: #ffffff;
  box-shadow: none;
  font-size: 1.15rem;
  padding: 16px 34px;
  border-radius: 16px;
  min-width: 220px;
}

.doc-page .doc-cta:hover,
.doc-page .doc-cta:focus-visible {
  background: #076eb3;
  color: #ffffff;
  transform: translateY(-1px);
}

.doc-page .doc-disclaimer {
  margin-top: 18px;
  font-size: 0.88rem;
  color: #6a7d90;
}

.doc-page .doc-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #d5e6f7;
}

.doc-page .doc-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 320px;
  background: #ffffff;
}

.doc-page .doc-table th,
.doc-page .doc-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid #e5eff9;
}

.doc-page .doc-table th {
  font-weight: 700;
  color: #133e64;
  background: #eaf3fc;
}

.doc-page .doc-table-tax-brackets th:nth-child(1),
.doc-page .doc-table-tax-brackets td:nth-child(1) {
  width: 18%;
  white-space: nowrap;
}

.doc-page .doc-table-tax-brackets th:nth-child(2),
.doc-page .doc-table-tax-brackets td:nth-child(2) {
  width: 56%;
  min-width: 260px;
  white-space: nowrap;
}

.doc-page .doc-table-tax-brackets th:nth-child(3),
.doc-page .doc-table-tax-brackets td:nth-child(3) {
  width: 26%;
  white-space: nowrap;
}

.doc-page .doc-link-list {
  margin: 0;
  padding-left: 20px;
}

.doc-page .doc-link-list li + li {
  margin-top: 10px;
}

.doc-page .doc-link-list a,
.doc-page .doc-topic-list a {
  color: #0a6cb2;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

.doc-page .doc-link-list li,
.doc-page .doc-topic-list li,
.doc-page .doc-section li {
  color: #2e4a66;
}

.doc-page .doc-link-list li::marker,
.doc-page .doc-topic-list li::marker,
.doc-page .doc-section li::marker {
  color: #5b7692;
}

.doc-page .doc-topic-grid {
  display: grid;
  gap: 14px;
  margin-top: 4px;
}

.doc-page .doc-topic-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #d6e7f8;
  border-radius: 12px;
  padding: 14px;
}

html[data-theme="dark"] body.doc-page {
  color: rgba(235, 241, 255, 0.8);
  background:
    radial-gradient(circle at 8% 14%, rgba(20, 184, 166, 0.2) 0%, transparent 40%),
    radial-gradient(circle at 92% 0%, rgba(245, 158, 11, 0.2) 0%, transparent 38%),
    linear-gradient(165deg, #07111f 0%, #0f172a 45%, #132238 100%);
}

html[data-theme="dark"] .doc-page .legal-links {
  color: #94a3b8;
}

html[data-theme="dark"] .doc-page .legal-links a {
  color: #cbd5e1;
}

html[data-theme="dark"] .doc-page .legal-links a:hover,
html[data-theme="dark"] .doc-page .legal-links a:focus-visible {
  color: #ecfeff;
}

html[data-theme="dark"] .doc-page .doc-logo {
  filter: drop-shadow(0 6px 18px rgba(0, 160, 255, 0.28));
}

html[data-theme="dark"] .doc-page .doc-header h1 {
  color: #e6f3ff;
  text-shadow: none;
}

html[data-theme="dark"] .doc-page .doc-button {
  border: 1px solid rgba(0, 160, 255, 0.35);
  background: rgba(22, 26, 44, 0.85);
  color: rgba(235, 241, 255, 0.92);
}

html[data-theme="dark"] .doc-page .doc-button:hover {
  box-shadow: 0 8px 20px rgba(0, 160, 255, 0.18);
}

html[data-theme="dark"] .doc-page .doc-card {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(45, 212, 191, 0.28);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .doc-page .doc-card p,
html[data-theme="dark"] .doc-page .doc-link-list li,
html[data-theme="dark"] .doc-page .doc-topic-list li,
html[data-theme="dark"] .doc-page .doc-section li {
  color: #cbd5e1;
}

html[data-theme="dark"] .doc-page .doc-section h2 {
  color: #ccfbf1;
}

html[data-theme="dark"] .doc-page .doc-cta {
  background: #14b8a6;
  color: #052e2b;
}

html[data-theme="dark"] .doc-page .doc-cta:hover,
html[data-theme="dark"] .doc-page .doc-cta:focus-visible {
  background: #0d9488;
  color: #e6fffb;
}

html[data-theme="dark"] .doc-page .doc-disclaimer {
  color: #cbd5e1;
}

html[data-theme="dark"] .doc-page .doc-table-wrap {
  border: 1px solid rgba(235, 241, 255, 0.14);
}

html[data-theme="dark"] .doc-page .doc-table {
  background: rgba(20, 24, 40, 0.42);
}

html[data-theme="dark"] .doc-page .doc-table th,
html[data-theme="dark"] .doc-page .doc-table td {
  border-bottom: 1px solid rgba(235, 241, 255, 0.09);
}

html[data-theme="dark"] .doc-page .doc-table th {
  color: rgba(235, 241, 255, 0.9);
  background: rgba(0, 160, 255, 0.14);
}

html[data-theme="dark"] .doc-page .doc-link-list a,
html[data-theme="dark"] .doc-page .doc-topic-list a {
  color: #8fd2ff;
}

html[data-theme="dark"] .doc-page .doc-link-list li::marker,
html[data-theme="dark"] .doc-page .doc-topic-list li::marker,
html[data-theme="dark"] .doc-page .doc-section li::marker {
  color: #cbd5e1;
}

html[data-theme="dark"] .doc-page .doc-topic-card {
  background: rgba(20, 24, 40, 0.36);
  border: 1px solid rgba(235, 241, 255, 0.1);
}

.doc-page .doc-topic-card h3 {
  margin: 0;
  font-size: 1.02rem;
}

.doc-page .doc-topic-list {
  margin: 10px 0 0;
  padding-left: 20px;
}

.doc-page .doc-topic-list li + li {
  margin-top: 8px;
}

@media (min-width: 780px) {
  .doc-page .doc-topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .landing-page .actions {
    flex-direction: column;
  }

  .landing-page .btn {
    width: 100%;
  }
}
