:root {
  --bg: #f3f6fb;
  --bg-2: #edf3fb;
  --surface: rgba(255, 255, 255, 0.8);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --surface-soft: rgba(244, 248, 255, 0.92);
  --text: #10233d;
  --muted: #5f6f86;
  --line: rgba(28, 68, 118, 0.12);
  --brand: #1570d8;
  --brand-2: #4ebeff;
  --brand-deep: #0c3f8c;
  --brand-ink: #0f4e94;
  --shadow: 0 22px 48px rgba(29, 62, 112, 0.09);
  --shadow-soft: 0 10px 24px rgba(29, 62, 112, 0.07);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  line-height: 1.45;
  background:
    radial-gradient(circle at top left, rgba(111, 196, 255, 0.22), transparent 30%),
    radial-gradient(circle at 82% 8%, rgba(71, 128, 221, 0.18), transparent 24%),
    linear-gradient(180deg, #f9fbff, var(--bg) 28%, var(--bg-2));
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(16px);
  opacity: 0.55;
}

body::before {
  top: 80px;
  left: -100px;
  width: 280px;
  height: 280px;
  background: rgba(81, 186, 255, 0.24);
}

body::after {
  right: -120px;
  bottom: 70px;
  width: 320px;
  height: 320px;
  background: rgba(23, 112, 216, 0.15);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(249, 251, 255, 0.72);
  backdrop-filter: blur(18px) saturate(160%);
}

.brand-lockup {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  min-width: 0;
}

.brand-image {
  display: block;
  width: 118px;
  height: auto;
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 14px rgba(17, 79, 149, 0.1));
}

.brand-copy {
  min-width: 0;
  padding-bottom: 10px;
}

.brand-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

#currentUser {
  max-width: 52vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 8px 13px;
  border: 1px solid rgba(21, 112, 216, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--brand-ink);
  font-size: 0.83rem;
  box-shadow: var(--shadow-soft);
}

.layout {
  max-width: 1120px;
  margin: 28px auto;
  padding: 0 16px 48px;
}

.panel {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.66);
  border-radius: 28px;
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(160%);
}

#onboarding {
  max-width: 860px;
  margin: 10px auto;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.45fr 0.55fr;
  gap: 22px;
  margin-bottom: 20px;
  padding: 26px;
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.97), rgba(241, 247, 255, 0.9)),
    linear-gradient(145deg, rgba(32, 110, 205, 0.05), rgba(95, 196, 255, 0.08));
  border: 1px solid rgba(20, 108, 208, 0.09);
  box-shadow: var(--shadow-soft);
}

.hero-copy {
  display: grid;
  gap: 8px;
  align-content: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(20, 112, 216, 0.08);
  color: var(--brand-ink);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero-panel h2 {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.hero-panel p {
  max-width: 42rem;
  margin: 0;
  font-size: 1.02rem;
}

.hero-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  background:
    radial-gradient(circle at 30% 20%, rgba(89, 200, 255, 0.24), transparent 36%),
    linear-gradient(180deg, rgba(240, 247, 255, 0.96), rgba(226, 238, 255, 0.9));
  border: 1px solid rgba(20, 108, 208, 0.12);
}

.hero-logo-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.hero-logo-image {
  width: min(100%, 170px);
  height: auto;
  display: block;
  filter: drop-shadow(0 16px 24px rgba(17, 79, 149, 0.1));
}

h2,
h3,
h4 {
  margin: 0 0 10px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
}

p {
  margin: 0 0 10px;
}

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

.stack {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.93rem;
  color: #233754;
}

a {
  color: var(--brand-deep);
}

a:hover {
  color: var(--brand);
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(22, 69, 123, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(21, 112, 216, 0.34);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 0 0 4px rgba(21, 112, 216, 0.1);
}

button {
  border: 0;
  border-radius: 16px;
  padding: 12px 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  box-shadow: 0 14px 24px rgba(21, 112, 216, 0.22);
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 28px rgba(21, 112, 216, 0.25);
  filter: saturate(1.03);
}

button:active {
  transform: translateY(0);
}

button.secondary {
  color: var(--brand-ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 245, 255, 0.94));
  box-shadow: 0 10px 18px rgba(29, 62, 112, 0.1);
}

button:disabled {
  opacity: 0.56;
  cursor: default;
  transform: none;
}

.consent-card {
  padding: 14px 16px;
  border: 1px solid rgba(20, 108, 208, 0.09);
  border-radius: 20px;
  background: rgba(244, 248, 255, 0.82);
}

.consent-check {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
}

.consent-check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.legal-note {
  margin: 10px 0 0;
  font-size: 0.88rem;
}

.tabs {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 16px;
}

.tabs button {
  color: #47627e;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
  border: 1px solid rgba(21, 112, 216, 0.08);
  font-weight: 600;
}

.tabs button.active {
  color: #ffffff;
  background: linear-gradient(180deg, #36a2f5, #156fd8);
  box-shadow: 0 14px 24px rgba(21, 112, 216, 0.22);
}

.tab {
  animation: fadeUp 260ms ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none;
}

.card {
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid rgba(20, 108, 208, 0.08);
  border-radius: 22px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
}

.card h3,
.card h4 {
  margin-bottom: 7px;
}

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

.tag {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(20, 108, 208, 0.1);
  background: linear-gradient(180deg, rgba(227, 241, 255, 0.96), rgba(240, 248, 255, 0.92));
  color: var(--brand-ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.chat-log {
  max-height: 360px;
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(20, 108, 208, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 248, 255, 0.96));
}

.message {
  margin-bottom: 8px;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(235, 244, 255, 0.96), rgba(246, 250, 255, 0.98));
  border: 1px solid rgba(20, 108, 208, 0.08);
}

.message b {
  color: var(--brand-deep);
}

ul {
  margin: 8px 0 0 18px;
  padding: 0;
}

li {
  margin-bottom: 5px;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 0 16px 34px;
  font-size: 0.92rem;
}

.site-footer a {
  text-decoration: none;
}

.legal-page {
  min-height: 100vh;
}

.legal-shell {
  max-width: 880px;
  margin: 32px auto 48px;
  padding: 0 16px;
}

.legal-header,
.legal-section {
  padding: 22px 24px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(160%);
}

.legal-header {
  margin-bottom: 18px;
}

.legal-intro {
  max-width: 46rem;
}

.legal-back {
  display: inline-flex;
  margin-top: 10px;
  font-weight: 700;
  text-decoration: none;
}

.legal-section + .legal-section {
  margin-top: 14px;
}

.legal-section h2 {
  margin-bottom: 10px;
}

@media (max-width: 800px) {
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .hero-badge {
    min-height: 180px;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .brand-copy {
    padding-bottom: 4px;
  }

  #currentUser {
    max-width: 100%;
  }

  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}

@media (min-width: 920px) {
  .two-col {
    grid-template-columns: 1.3fr 1fr;
  }
}
