:root {
  --primary: #0263fe;
  --ink: #071426;
  --text: #142338;
  --muted: #647084;
  --soft: #f6f8fb;
  --surface: #ffffff;
  --line: #dfe5ef;
  --line-soft: #edf1f6;
  --green: #1f9d5a;
  --red: #d92d20;
  --orange: #f59f00;
  --violet: #7048e8;
  --shadow-sm: 0 8px 24px rgba(7, 20, 38, .05);
  --shadow-md: 0 18px 52px rgba(7, 20, 38, .10);
  --radius: 8px;
  --radius-lg: 12px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  display: block;
}

button,
input,
textarea {
  font: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  color: var(--ink);
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: 0;
  margin-bottom: 8px;
}

h2 {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
  margin-bottom: 12px;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 650;
  padding: 0 18px;
  white-space: nowrap;
}

.button-secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.card,
.section-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.section-card {
  margin-top: 18px;
  padding: 22px;
}

.alert {
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 16px;
}

.alert-error {
  background: #fff1f0;
  color: #b42318;
}

.alert-success {
  background: #ecfdf3;
  color: #067647;
}

input,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfd7e6;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 12px;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(2, 99, 254, .10);
}

input[readonly] {
  background: #f4f6f9;
  color: #536174;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

.required-dot {
  justify-self: start;
  border-radius: 999px;
  background: #eef4ff;
  color: #244b8f;
  font-size: 10px;
  font-weight: 650;
  padding: 2px 7px;
}

.field-hint {
  display: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.field-hint.is-error,
.field-hint.is-ok {
  display: block;
}

.field-hint.is-error {
  color: var(--red);
}

.field-hint.is-ok {
  color: var(--green);
}

input.is-invalid,
textarea.is-invalid {
  border-color: rgba(217, 45, 32, .72);
  background: #fffafa;
}

input.is-invalid:focus,
textarea.is-invalid:focus {
  box-shadow: 0 0 0 4px rgba(217, 45, 32, .10);
}

input.is-valid,
textarea.is-valid {
  border-color: rgba(31, 157, 90, .72);
}

.password-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: -2px;
}

.password-rules span {
  display: flex;
  min-height: 30px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #f8fafc;
  color: #59677c;
  font-size: 12px;
  font-weight: 650;
  padding: 0 9px;
}

.password-rules span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #b9c3d3;
  flex: 0 0 auto;
}

.password-rules span.is-valid {
  border-color: rgba(31, 157, 90, .28);
  background: #effaf4;
  color: #087443;
}

.password-rules span.is-valid::before {
  background: var(--green);
}

.legal-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #31415a;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  padding: 10px 12px;
}

.legal-check input {
  width: 18px;
  min-height: 18px;
  margin-top: 1px;
  accent-color: var(--primary);
}

.legal-check a {
  color: var(--primary);
  font-weight: 650;
}

.legal-check.is-invalid {
  border-color: rgba(217, 45, 32, .72);
  background: #fffafa;
}

.form-stack {
  display: grid;
  gap: 11px;
}

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

.form-section {
  border-top: 1px solid var(--line-soft);
  margin-top: 6px;
  padding-top: 20px;
}

.compact-note {
  margin: 14px 0 0;
  font-size: 13px;
}

.auth-page {
  min-height: calc(100vh - 56px);
  display: grid;
  grid-template-columns: minmax(460px, 1.12fr) minmax(440px, .98fr);
  background:
    radial-gradient(circle at 72% 18%, rgba(230, 248, 242, .68), transparent 34%),
    linear-gradient(135deg, #f8fbff 0%, #eef5f3 100%);
}

.auth-visual {
  position: relative;
  min-height: calc(100vh - 56px);
  overflow: hidden;
  color: #fff;
  background: url("/assets/auth-bg.png") center/cover;
}

.auth-visual-inner {
  width: min(650px, calc(100% - 132px));
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  padding: 84px 0 72px 92px;
}

.auth-kicker {
  margin: auto 0 18px;
  color: #baf3da;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.auth-title {
  max-width: 540px;
  margin: 0;
  color: #fff;
  font-size: clamp(38px, 3.65vw, 56px);
  line-height: 1.12;
  font-weight: 500;
}

.auth-copy {
  max-width: 560px;
  margin: 24px 0 12vh;
  color: rgba(255, 255, 255, .88);
  font-size: 21px;
  line-height: 1.45;
}

.auth-panel {
  display: grid;
  min-height: calc(100vh - 56px);
  place-items: center;
  padding: 48px 24px;
}

.auth-card {
  width: min(496px, 100%);
  border: 1px solid rgba(221, 227, 238, .94);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 76px rgba(7, 20, 38, .12);
  padding: 30px 34px;
}

.auth-card h1 {
  font-size: 29px;
  margin-bottom: 8px;
}

.auth-card p {
  color: #34466b;
}

.auth-card > p:not(.auth-kicker) {
  margin-bottom: 18px;
}

.auth-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 18px;
  color: #24405f;
  font-size: 14px;
}

.auth-actions a,
.auth-actions a:visited,
.auth-actions a:hover,
.auth-actions a:active {
  color: var(--primary) !important;
  font-weight: 650;
}

.auth-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-choice label {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  border: 1px solid #d7deea;
  border-radius: var(--radius);
  cursor: pointer;
  padding: 0 14px;
  font-weight: 600;
}

.auth-choice input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--green);
}

.code-input {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: .34em;
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand img {
  width: 170px;
  height: auto;
}

.auth-visual .brand img {
  width: 214px;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px);
  padding: 18px 0;
}

.legal-page {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 72px;
}

.legal-page h1 {
  font-size: 38px;
}

.legal-lead {
  max-width: 680px;
  font-size: 17px;
}

.legal-section + .legal-section {
  border-top: 1px solid var(--line-soft);
  margin-top: 18px;
  padding-top: 18px;
}

.legal-section h2 {
  font-size: 17px;
  margin-bottom: 6px;
}

.legal-section p {
  color: #42526a;
  margin-bottom: 0;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.legal-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #31415a;
  font-size: 13px;
  font-weight: 650;
  padding: 0 12px;
}

.legal-nav a:hover {
  border-color: rgba(2, 99, 254, .35);
  color: var(--primary);
}

.dark-header {
  background: var(--ink);
  color: #fff;
  padding: 20px;
}

.mobile-wrap {
  width: min(560px, calc(100% - 32px));
  margin: 0 auto;
}

.site-footer {
  background: #fff;
  color: #48617f;
  padding: 18px 0 22px;
}

.site-footer-inner {
  width: min(1980px, calc(100% - 176px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-top: 1px solid #e6ebf2;
  padding-top: 18px;
  font-size: 13px;
  font-weight: 400;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.footer-meta nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.site-footer a,
.site-footer span,
.site-footer p {
  color: #48617f;
  white-space: nowrap;
}

.site-footer span + span,
.footer-meta nav::before,
.footer-meta nav a {
  color: #9aa8bb;
}

.footer-meta nav::before {
  content: "·";
}

.site-footer a:hover {
  color: var(--primary);
}

.site-footer p {
  margin: 0;
  text-align: right;
}

.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  padding: 24px;
}

.side-nav {
  display: grid;
  gap: 6px;
  margin-top: 34px;
}

.side-nav a {
  min-height: 44px;
  border-radius: var(--radius);
  color: #344054;
  display: flex;
  align-items: center;
  font-weight: 600;
  padding: 0 14px;
}

.side-nav a:hover {
  background: #edf4ff;
  color: var(--primary);
}

.app-main {
  min-width: 0;
  padding-bottom: 0;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
  padding: 18px 28px;
}

.app-logout {
  font-weight: 650;
}

.app-content {
  width: min(1160px, calc(100% - 44px));
  margin: 0 auto;
  padding: 30px 0 64px;
}

.page-head,
.intro-panel {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.intro-panel {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
  padding: 26px;
}

.intro-panel h1 {
  max-width: 680px;
  font-size: 34px;
  margin-bottom: 10px;
}

.intro-panel p {
  max-width: 720px;
  margin-bottom: 0;
}

.camper-hero {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 360px);
  gap: 24px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(7, 20, 38, .96), rgba(16, 42, 72, .92)),
    url("/assets/auth-bg.jpg") center/cover;
  color: #fff;
  padding: 30px;
}

.camper-hero h2 {
  color: #fff;
  margin: 18px 0 8px;
  font-size: 30px;
}

.camper-hero p {
  color: rgba(255, 255, 255, .78);
}

.hero-panel {
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .08);
  padding: 18px;
}

.hero-panel span,
.hero-panel p {
  color: rgba(255, 255, 255, .72);
}

.hero-panel strong {
  display: block;
  margin: 8px 0 12px;
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 18px;
}

.status {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  border-radius: var(--radius);
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  padding: 8px 12px;
}

.split-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.mode-card {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 14px;
  text-align: left;
}

.mode-card.active {
  border-color: var(--primary);
  background: #edf4ff;
}

.mode-card strong,
.mode-card span {
  display: block;
}

.mode-card span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.product-grid {
  gap: 22px;
}

.product-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-md);
}

.product-card figure {
  margin: 0;
  overflow: hidden;
}

.product-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.product-body {
  padding: 22px;
}

.product-body h2 {
  margin: 8px 0 10px;
  font-size: 24px;
}

.product-body p:not(.eyebrow) {
  color: var(--muted);
  margin-bottom: 0;
}

.product-body strong {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  margin-top: 16px;
  padding: 0 16px;
}

.product-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 10px;
  background: #edf4ff;
  color: var(--primary);
  margin-bottom: 14px;
}

.product-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.note-band {
  display: flex;
  gap: 14px;
  margin-top: 22px;
  border: 1px solid #dbe8ff;
  border-radius: var(--radius);
  background: #f3f8ff;
  color: #12396c;
  padding: 18px;
}

.selected-product {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
  padding: 14px;
}

.selected-product img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius);
}

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

.list-row,
.report-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 14px;
}

.report-row {
  align-items: flex-start;
}

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

.report-option {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  padding: 14px;
  text-align: left;
}

.report-option input {
  margin-right: 8px;
}

.notice {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  border-radius: var(--radius);
  background: #edf4ff;
  color: #0f3469;
  padding: 16px;
}

.check-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(6, auto);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 12px;
}

.check-row label {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.check-row input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  accent-color: var(--primary);
}

.mobile-tabbar {
  display: none;
}

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

  .auth-visual {
    min-height: 320px;
  }

  .auth-visual-inner {
    width: min(100% - 32px, 560px);
    min-height: 320px;
    padding: 28px 0 36px 20px;
  }

  .auth-kicker {
    margin-top: auto;
  }

  .auth-title {
    font-size: 40px;
  }

  .auth-copy {
    font-size: 16px;
    margin: 18px 0 0;
  }

  .auth-panel {
    min-height: auto;
    padding: 22px 16px 36px;
  }

  .auth-card {
    padding: 24px;
  }

  .app-layout,
  .dashboard-grid,
  .product-grid,
  .form-grid,
  .camper-hero,
  .mode-grid,
  .report-grid,
  .selected-product {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 18px 18px 12px;
  }

  .side-nav {
    display: none;
  }

  .app-topbar {
    padding: 14px 18px;
  }

  .app-content {
    width: min(100% - 28px, 760px);
    padding: 24px 0 92px;
  }

  .page-head,
  .intro-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .intro-panel {
    padding: 20px;
  }

  .intro-panel h1,
  .page-head h1 {
    font-size: 28px;
  }

  .camper-hero {
    padding: 22px;
  }

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

  .mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(16px);
    padding: 8px 8px max(8px, env(safe-area-inset-bottom));
  }

  .mobile-tabbar a {
    min-height: 42px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    color: #536174;
    font-size: 12px;
    font-weight: 650;
  }

  .site-footer {
    padding: 18px 0 78px;
  }

  .site-footer-inner {
    width: min(100% - 32px, 760px);
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    font-size: 12px;
    padding-top: 16px;
  }

  .site-footer p {
    text-align: left;
  }

  .footer-meta,
  .footer-meta nav {
    gap: 7px 10px;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 14px;
  }

  h1 {
    font-size: 27px;
  }

  h2 {
    font-size: 19px;
  }

  .auth-title {
    font-size: 34px;
  }

  .auth-choice {
    grid-template-columns: 1fr;
  }

  .password-rules {
    grid-template-columns: 1fr;
  }

  .legal-page {
    padding: 34px 0 54px;
  }

  .legal-page h1 {
    font-size: 30px;
  }

  .section-card,
  .product-body {
    padding: 18px;
  }

  .list-row,
  .report-row,
  .note-band {
    align-items: flex-start;
    flex-direction: column;
  }
}

