:root {
  --bg: #f8f8f8;
  --card: #ffffff;
  --ink: #111111;
  --muted: #444444;
  --accent: #111111;
  --accent-strong: #000000;
  --line: #111111;
  --radius: 10px;
  --stroke: 2px;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Space Grotesk", "IBM Plex Sans", "Avenir Next", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

.container {
  width: min(1080px, 92%);
  margin: 0 auto;
}

nav {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: var(--stroke) solid var(--line);
  background: #fff;
}

.nav-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-width: 32px;
  max-width: 32px;
  padding: 0;
  border-radius: 0;
  overflow: hidden;
}

img.logo-mark {
  display: block;
  object-fit: contain;
}

.logo-wordmark {
  display: block;
  height: 24px;
  width: auto;
}

.logo-full {
  display: block;
  height: 28px;
  width: auto;
}

.logo-context {
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
  margin-left: 2px;
}

.logo-text {
  display: block;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav a {
  text-decoration: none;
  color: var(--ink);
}

nav ul a {
  font-size: 0.9rem;
  border: var(--stroke) solid #fff;
  border-radius: var(--radius);
  padding: 0.45rem 0.8rem;
}

nav ul a:hover,
nav ul a.active {
  border-color: #111;
  background: #fff;
}

.hero {
  margin: 34px auto 18px;
  padding: clamp(26px, 5vw, 56px);
  border: var(--stroke) solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 3.6vw, 2.4rem);
  line-height: 1.2;
}

.hero p {
  margin: 0 auto;
  color: var(--muted);
  width: min(730px, 96%);
}

.badge {
  display: inline-block;
  margin-bottom: 10px;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius);
  border: var(--stroke) solid #111;
  color: #111;
  background: #fff;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

section.card {
  margin: 18px auto;
  padding: clamp(18px, 3.4vw, 30px);
  border: var(--stroke) solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.floating-panel {
  --float-tilt: 0deg;
  --float-scale: 1;
  --float-shadow-y: 12px;
  --float-shadow-blur: 28px;
  --float-shadow-alpha: 0.1;
  transform: perspective(1000px) rotateX(var(--float-tilt)) scale(var(--float-scale));
  transform-origin: 50% 50%;
  will-change: transform;
  box-shadow:
    0 var(--float-shadow-y) var(--float-shadow-blur) rgba(17, 17, 17, var(--float-shadow-alpha)),
    0 3px 8px rgba(17, 17, 17, 0.06);
  transition: box-shadow 220ms ease, border-color 220ms ease, transform 180ms ease;
}

.floating-panel:hover {
  box-shadow: 0 16px 34px rgba(17, 17, 17, 0.14), 0 5px 12px rgba(17, 17, 17, 0.08);
  border-color: #000;
}

h2 {
  margin: 0 0 10px;
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
}

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

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

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

.surface {
  border: var(--stroke) solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
}

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

.quiz-builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, 1fr);
  gap: 12px;
}

.quiz-builder-question {
  border: var(--stroke) solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.quiz-builder-question-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.quiz-builder-question-head h4 {
  margin: 0;
  font-size: 0.95rem;
}

.quiz-builder-option-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.quiz-builder-tips h4 {
  margin-top: 0;
  margin-bottom: 8px;
}

.quiz-builder-tips .list {
  margin-top: 8px;
  margin-bottom: 8px;
}

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

.email-card {
  border: var(--stroke) solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
}

.email-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.email-card-head h4 {
  margin: 0;
  font-size: 1rem;
}

.segment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin-bottom: 8px;
}

.segment-grid label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 0.88rem;
}

.segment-grid input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: var(--stroke) solid transparent;
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn.primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.btn.primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.btn.secondary {
  color: var(--ink);
  border-color: #111;
  background: #fff;
}

.btn.secondary:hover {
  background: #f4f4f4;
}

.btn-row {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

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

.list li {
  margin: 7px 0;
}

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

.progress {
  height: 10px;
  border-radius: var(--radius);
  background: #e3e3e3;
  overflow: hidden;
  margin-bottom: 16px;
}

.progress > span {
  display: block;
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width 0.25s ease;
}

.quiz-question {
  font-size: 1.2rem;
  margin: 0 0 14px;
}

.options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.option-btn {
  text-align: left;
  border-radius: var(--radius);
  border: var(--stroke) solid var(--line);
  padding: 0.75rem 0.85rem;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.option-btn:hover {
  border-color: #000;
}

.option-btn.is-selected {
  border-color: #111;
  background: #f1f1f1;
}

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

input,
textarea,
select {
  width: 100%;
  margin-top: 8px;
  margin-bottom: 12px;
  border: var(--stroke) solid var(--line);
  border-radius: var(--radius);
  padding: 0.68rem 0.74rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.color-chip-input {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 12px;
}

.color-chip-control {
  width: 48px !important;
  min-width: 48px;
  height: 40px;
  margin: 0 !important;
  padding: 2px !important;
  border-radius: 999px !important;
  border: var(--stroke) solid var(--line) !important;
  background: #fff;
  cursor: pointer;
}

.color-chip-control::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-chip-control::-webkit-color-swatch {
  border: none;
  border-radius: 999px;
}

.color-chip-preview {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: var(--stroke) solid var(--line);
  border-radius: 999px;
  padding: 0 12px 0 8px;
  background: #fff;
}

.color-chip-preview .swatch {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.25);
  background: #111;
}

.color-chip-preview .hex {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
}

.help-wrap {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  margin-left: 6px;
}

.help-icon {
  width: 18px;
  height: 18px;
  border: var(--stroke) solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.help-icon:hover {
  background: #f2f2f2;
}

.help-popover {
  position: absolute;
  top: -6px;
  left: 24px;
  z-index: 50;
  width: min(320px, 78vw);
  border: var(--stroke) solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.45;
  padding: 10px 11px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

form .grid {
  margin-top: 8px;
}

.notice {
  padding: 12px;
  border-radius: var(--radius);
  border: var(--stroke) solid #111;
  background: #fff;
  color: #111;
}

.button-status {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.button-status.is-error {
  color: #b00020;
}

.btn-row .button-status {
  width: 100%;
  flex-basis: 100%;
  margin-top: 2px;
}

.small {
  font-size: 0.85rem;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

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

.portal-tab-btn.active {
  color: #fff;
  border-color: #111;
  background: #111;
}

.kpi-card {
  border: var(--stroke) solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
}

.kpi-card p {
  margin: 0;
}

.kpi-value {
  font-size: 1.35rem;
  font-weight: 700;
}

.traffic-chart {
  min-height: 220px;
}

.traffic-chart-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  gap: 8px;
  align-items: end;
  min-height: 175px;
  padding-top: 10px;
}

.traffic-bar-wrap {
  display: grid;
  gap: 6px;
  align-items: end;
  justify-items: center;
}

.traffic-bar {
  width: 100%;
  max-width: 44px;
  min-height: 10%;
  border: var(--stroke) solid var(--line);
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #111 0%, #343434 100%);
  position: relative;
}

.traffic-bar span {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.traffic-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
}

.route-table-wrap {
  padding: 0;
  overflow-x: auto;
}

.route-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 360px;
}

.route-table th,
.route-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #d9d9d9;
  text-align: left;
  font-size: 0.9rem;
}

.route-table th {
  font-weight: 700;
  background: #f7f7f7;
}

.route-table td:nth-child(2),
.route-table td:nth-child(3) {
  text-align: right;
}

#wl-last-generation-banner {
  margin: 10px auto 18px;
  padding: 14px 16px;
}

#wl-last-generation-banner p {
  margin: 0;
}

#wl-dashboard-last-generated {
  font-size: 0.96rem;
  font-weight: 700;
}

.response-bars {
  display: grid;
  gap: 8px;
}

.response-bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.response-bar-label {
  font-size: 0.84rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.response-bar-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.1);
  overflow: hidden;
}

.response-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.response-bar-value {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
}

.question-breakdown {
  border-bottom: 1px solid #dfdfdf;
  padding: 8px 0;
}

.question-breakdown:last-child {
  border-bottom: none;
}

.question-breakdown h4 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.automation-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.automation-chip {
  display: inline-flex;
  align-items: center;
  border: var(--stroke) solid var(--line);
  border-radius: var(--radius);
  padding: 0.3rem 0.55rem;
  font-size: 0.85rem;
  background: #fff;
}

.automation-step {
  border: var(--stroke) solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 8px;
}

.automation-step h5 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.hidden {
  display: none !important;
}

.client-glass-app {
  min-height: 100vh;
  background-color: #0e1218;
  background-image:
    radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 45%),
    radial-gradient(circle at 80% 0%, rgba(60, 92, 160, 0.32), rgba(25, 35, 52, 0) 48%),
    linear-gradient(130deg, rgba(8, 11, 18, 0.9), rgba(12, 17, 26, 0.86)),
    var(--client-bg-desktop-image, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.client-glass-app::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(9, 12, 18, 0.45), rgba(9, 12, 18, 0.62));
  z-index: -1;
}

.client-glass-app nav,
.client-glass-app .hero,
.client-glass-app section.card,
.client-glass-app .surface {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(16px) saturate(145%);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
}

.client-glass-app nav ul a {
  border-color: rgba(255, 255, 255, 0.24);
  color: #f3f8ff;
  background: rgba(255, 255, 255, 0.08);
}

.client-glass-app nav ul a:hover,
.client-glass-app nav ul a.active {
  border-color: rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.2);
}

.client-glass-app,
.client-glass-app .muted,
.client-glass-app .small,
.client-glass-app p,
.client-glass-app li,
.client-glass-app label,
.client-glass-app h1,
.client-glass-app h2,
.client-glass-app h3,
.client-glass-app h4 {
  color: #eef3ff;
}

.client-glass-app .badge,
.client-glass-app .option-btn,
.client-glass-app input,
.client-glass-app textarea,
.client-glass-app select {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.14);
  color: #eef3ff;
}

.client-glass-app .btn.secondary {
  border-color: rgba(255, 255, 255, 0.46);
  color: #eef3ff;
  background: rgba(255, 255, 255, 0.18);
}

.client-glass-app .btn.secondary:hover {
  background: rgba(255, 255, 255, 0.26);
}

.client-glass-app .traffic-label,
.client-glass-app .traffic-bar span {
  color: #e6ecff;
}

.client-glass-app .route-table th,
.client-glass-app .route-table td {
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.client-glass-app footer {
  color: #e6ecff;
}

footer {
  margin: 26px auto 36px;
  padding: 18px 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

.footer-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.client-secondary-logo {
  max-height: 44px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
}

.footer-mark {
  display: inline-block;
  margin: 0 auto 8px;
}

.footer-mark-img {
  width: 24px;
  height: auto;
  display: block;
}

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

  .grid.three {
    grid-template-columns: 1fr;
  }

  .quiz-builder-layout {
    grid-template-columns: 1fr;
  }

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

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

  .portal-tabs {
    flex-direction: column;
    align-items: stretch;
  }

  .segment-grid {
    grid-template-columns: 1fr;
  }

  .nav-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 0;
  }

  nav ul {
    justify-content: flex-start;
  }

  .help-popover {
    top: 24px;
    left: 0;
    width: min(300px, 90vw);
  }

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

  .client-glass-app {
    background-image:
      radial-gradient(circle at 10% 8%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 42%),
      radial-gradient(circle at 88% 0%, rgba(60, 92, 160, 0.28), rgba(25, 35, 52, 0) 48%),
      linear-gradient(130deg, rgba(8, 11, 18, 0.9), rgba(12, 17, 26, 0.86)),
      var(--client-bg-mobile-image, var(--client-bg-desktop-image, none));
  }
}

@media (prefers-reduced-motion: reduce) {
  .floating-panel {
    transform: none !important;
    transition: none;
  }
}
