:root {
  --primary: #303394;
  --primary-dark: #24266f;
  --accent: #675cff;
  --ink: #182033;
  --muted: #667085;
  --line: #e4e7ec;
  --surface: #ffffff;
  --background: #f4f6fb;
  --success: #16794b;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(28, 35, 90, .10);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 90% 0, rgba(103, 92, 255, .12), transparent 26rem),
    var(--background);
  color: var(--ink);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

a { color: inherit; }
button, input, select { font: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid rgba(228, 231, 236, .9);
  backdrop-filter: blur(12px);
}

.nav {
  width: min(1120px, calc(100% - 32px));
  min-height: 72px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 800; }
.brand img { width: 130px; height: auto; object-fit: contain; }
.brand small { display: block; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }

.nav-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nav-links a {
  padding: 10px 13px;
  border-radius: 10px;
  color: #475467;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { background: #eff0ff; color: var(--primary); }

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

.hero { max-width: 760px; margin-bottom: 38px; }
.eyebrow {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 999px;
  background: #eaeaff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.hero h1 { margin: 16px 0 12px; font-size: clamp(34px, 6vw, 58px); line-height: 1.04; letter-spacing: -.045em; }
.hero p { margin: 0; color: var(--muted); font-size: 18px; line-height: 1.65; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.tools-section-heading { margin: 52px 0 18px; }
.tools-section-heading:first-of-type { margin-top: 0; }
.tools-section-heading span { color: var(--primary); font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.tools-section-heading h2 { margin: 5px 0 0; font-size: 28px; }
.fiscal-hub-notice { margin: -4px 0 18px; padding: 12px 14px; border-left: 4px solid #f79009; border-radius: 8px; background: #fffaeb; color: #7a2e0e; font-size: 13px; line-height: 1.5; }
.tool-card {
  position: relative;
  min-height: 210px;
  padding: 26px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(28, 35, 90, .05);
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.tool-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 28px;
  border-radius: 15px;
  background: #eff0ff;
  color: var(--primary);
  font-size: 25px;
  font-weight: 900;
}
.tool-card h2 { margin: 0 0 9px; font-size: 21px; }
.tool-card p { margin: 0; color: var(--muted); line-height: 1.55; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .72fr);
  gap: 24px;
  align-items: start;
}
.panel {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.panel h2 { margin: 0 0 6px; font-size: 22px; }
.panel-intro { margin: 0 0 25px; color: var(--muted); line-height: 1.5; }

.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 800; }
.field input, .field select {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #cfd4dc;
  border-radius: 11px;
  outline: none;
  background: #fff;
  color: var(--ink);
}
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(103, 92, 255, .12); }
.field small { display: block; margin-top: 6px; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.input-action { position: relative; }
.input-action input { padding-right: 88px; }
.input-button {
  position: absolute;
  top: 50%;
  right: 7px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: #eef0f5;
  color: #344054;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  transform: translateY(-50%);
}
.check-field { display: flex; align-items: center; gap: 9px; margin: 0 0 20px; cursor: pointer; font-weight: 700; }
.check-field input { width: 18px; height: 18px; accent-color: var(--primary); }
.form-error { min-height: 20px; margin: 14px 0 0; color: #b42318; font-size: 14px; font-weight: 700; }
.wifi-caption { display: flex; flex-direction: column; gap: 4px; margin: 16px 0; }
.wifi-caption strong { color: var(--primary); font-size: 20px; }
.wifi-caption span { color: var(--muted); font-size: 13px; }

.button {
  min-height: 48px;
  padding: 12px 18px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}
.button:hover { filter: brightness(1.05); }
.button.secondary { background: #eef0f5; color: #344054; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.result-box {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.result-box.empty { color: var(--muted); }
.result-value { margin: 10px 0; color: var(--primary); font-size: clamp(36px, 7vw, 58px); font-weight: 900; letter-spacing: -.04em; }
.result-detail { color: var(--muted); line-height: 1.6; }
#qrcode { padding: 14px; background: #fff; border-radius: 10px; }
#qrcode img, #qrcode canvas { display: block; max-width: 100%; height: auto !important; }
.qr-caption { max-width: 340px; margin: 16px auto 0; overflow-wrap: anywhere; color: var(--muted); font-size: 13px; }

.footer { padding: 0 16px 34px; color: var(--muted); text-align: center; font-size: 13px; }
.footer a { color: var(--primary); font-weight: 700; }

@media (max-width: 820px) {
  .nav { padding: 12px 0; align-items: flex-start; flex-direction: column; gap: 8px; }
  .brand small { display: none; }
  .nav-links { width: 100%; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .nav-links a { flex: 0 0 auto; }
  .nav-links a { padding: 8px; font-size: 12px; }
  .page { padding: 40px 0; }
  .tool-grid, .workspace { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .nav { width: min(100% - 20px, 1120px); }
  .brand span { display: none; }
  .page { width: min(100% - 24px, 1120px); }
  .panel { padding: 20px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
}

@media print {
  .topbar, .hero, .panel:first-child, .footer, .actions { display: none !important; }
  .page, .workspace { width: 100%; margin: 0; padding: 0; display: block; }
  .panel { border: 0; box-shadow: none; }
}
