/* Lidaix app chrome. Do not load on sales pages. Does not redefine .dash. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --navy: #0A1128;
  --blue: #0066FF;
  --blue-hover: #0052CC;
  --body: #4B5568;
  --muted: #6B7386;
  --quiet: #8B93A4;
  --line: #E8ECF3;
  --line-strong: #E4E8F0;
  --canvas: #F4F6F8;
  --active: #E8F1FF;
  --live: #16A34A;
  --dot: #22C55E;
  --card: #FFFFFF;
  --radius-card: 8px;
  --radius-frame: 12px;
  --side-w: 232px;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--body);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

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

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

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 60;
  padding: 8px 12px;
  background: var(--navy);
  color: #fff;
  border-radius: 8px;
}

.skip:focus {
  top: 12px;
  color: #fff;
}

/* —— Login —— */

body.is-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 20px;
  background: var(--canvas);
}

.login-card {
  width: min(420px, 100%);
  padding: 36px 32px 32px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-frame);
  box-shadow: 0 1px 2px rgba(10, 17, 40, 0.04), 0 16px 40px rgba(10, 17, 40, 0.07);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 28px;
  color: var(--navy);
  text-decoration: none;
}

.login-brand:hover {
  color: var(--navy);
}

.login-brand img {
  width: 40px;
  height: 40px;
}

.login-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.login-brand-text strong {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.login-brand-text span {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

.login-card h1 {
  margin: 0 0 20px;
  color: var(--navy);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-form label,
.account-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--navy);
  font-size: 0.88rem;
  font-weight: 600;
}

.login-form input,
.account-form input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  background: #fff;
  color: var(--navy);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
}

.login-form input:focus,
.account-form input:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
  border-color: var(--blue);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-card);
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn-fill {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.btn-fill:hover {
  background: var(--blue-hover);
  border-color: var(--blue-hover);
  color: #fff;
}

.btn-line {
  background: #fff;
  border-color: var(--blue);
  color: var(--blue);
}

.btn-line:hover {
  background: var(--active);
  color: var(--blue-hover);
}

.btn-block {
  width: 100%;
}

.login-forgot {
  text-align: center;
  font-size: 0.88rem;
  font-weight: 500;
}

.login-home {
  margin-top: 20px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
}

/* —— App shell —— */

body.is-app {
  background: var(--canvas);
}

.app {
  display: flex;
  min-height: 100vh;
}

.app-side {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: min(var(--side-w), 86vw);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  background: #fff;
  border-right: 1px solid var(--line);
  transform: translateX(-105%);
  transition: transform 0.2s ease;
}

.app-side.is-open {
  transform: translateX(0);
}

.app-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(10, 17, 40, 0.36);
}

.app.is-nav-open .app-backdrop {
  display: block;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 8px 22px;
  color: var(--navy);
}

.app-brand:hover {
  color: var(--navy);
}

.app-brand img {
  width: 32px;
  height: 32px;
}

.app-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.app-brand-text strong {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.app-brand-text span {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
}

.app-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.app-nav a:hover {
  background: var(--canvas);
  color: var(--navy);
}

.app-nav a.is-on,
.app-nav a[aria-current="page"] {
  background: var(--active);
  color: var(--blue);
}

.app-nav svg {
  flex-shrink: 0;
}

.app-shell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.app-top {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.app-nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: -6px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--navy);
}

.app-nav-toggle-bars,
.app-nav-toggle-bars::before,
.app-nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  position: relative;
}

.app-nav-toggle-bars::before,
.app-nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.app-nav-toggle-bars::before {
  top: -5px;
}

.app-nav-toggle-bars::after {
  top: 5px;
}

.app-title {
  margin: 0;
  flex: 1;
  min-width: 0;
  color: var(--navy);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.app-hops {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.app-hop {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-card);
  font-size: 0.85rem;
  font-weight: 600;
}

.app-logout {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 4px;
}

.app-logout:hover {
  color: var(--navy);
}

.app-main {
  flex: 1;
  padding: 24px 16px 48px;
}

.app-inner {
  width: min(1040px, 100%);
  margin-inline: auto;
}

.app-hello {
  margin: 0 0 4px;
  color: var(--navy);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.app-email {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.app-lead {
  margin: 0 0 20px;
  max-width: 36rem;
  color: var(--body);
}

.app-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.app-card {
  padding: 16px 16px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.app-card-k {
  display: block;
  color: #7A8294;
  font-size: 0.78rem;
  font-weight: 500;
}

.app-card-k i {
  font-style: normal;
  color: #9AA3B5;
}

.app-card-v {
  display: block;
  margin-top: 6px;
  color: var(--navy);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.app-card-go {
  display: inline-block;
  margin-top: 10px;
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 600;
}

.app-card-go:hover {
  color: var(--blue-hover);
}

.app-cols {
  display: grid;
  gap: 12px;
}

.app-panel {
  padding: 16px 16px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.app-h {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: 0.95rem;
  font-weight: 600;
}

.app-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #3D4658;
  font-size: 0.92rem;
  font-weight: 500;
}

.site-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.site-live {
  color: var(--live);
  font-size: 0.8rem;
  font-weight: 600;
}

.live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot);
  flex-shrink: 0;
}

.camp-name {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.camp-name small {
  color: var(--quiet);
  font-size: 0.75rem;
  font-weight: 500;
}

.app-spend b {
  color: #5C6578;
  font-weight: 600;
  flex-shrink: 0;
}

.app-quiet {
  margin: 16px 0 0;
  color: var(--quiet);
  font-size: 0.82rem;
}

.account-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 440px;
  padding: 22px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.account-form .btn {
  margin-top: 6px;
  align-self: flex-start;
}

.account-form + .account-form,
.account-form + .secondary-needs-billing,
.app-lead + .account-form {
  margin-top: 16px;
}

.account-h {
  margin: 0;
  color: var(--navy);
  font-size: 0.95rem;
  font-weight: 600;
}

.account-hint,
.login-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

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

.account-actions .btn {
  margin-top: 0;
}

.account-form input[readonly] {
  background: var(--canvas);
  color: var(--muted);
}

@media (min-width: 900px) {
  .app-side {
    position: sticky;
    top: 0;
    height: 100vh;
    width: var(--side-w);
    transform: none;
    flex-shrink: 0;
  }

  .app-backdrop,
  .app.is-nav-open .app-backdrop {
    display: none;
  }

  .app-nav-toggle {
    display: none;
  }

  .app-top {
    padding: 10px 28px;
  }

  .app-main {
    padding: 28px 28px 56px;
  }

  .app-stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .app-cols {
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-side {
    transition: none;
  }
}

.app-select {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  background: #fff;
  color: var(--body);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
}

.app-side-foot {
  margin-top: auto;
  padding-top: 16px;
}

.app-side-foot .app-logout {
  display: block;
  padding: 9px 10px;
}

.login-error,
.app-notice {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.92rem;
}

.login-error,
.app-notice.is-bad {
  color: #9b1c1c;
  background: #fde8e8;
}

.app-notice.is-ok {
  color: #166534;
  background: #e7f6ed;
}

/* —— Support —— */

.support-session {
  max-width: 440px;
  padding: 22px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.support-status {
  display: inline-flex;
  align-items: center;
  margin: 0 0 16px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--canvas);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.support-session[data-support-state="connected"] .support-status {
  background: #e7f6ed;
  color: #16A34A;
}

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

.support-copy {
  max-width: 36rem;
  margin: 0 0 16px;
  color: var(--body);
}

.support-copy p {
  margin: 0 0 10px;
}

.support-copy p:last-child {
  margin-bottom: 0;
}

#support-end {
  display: none;
}

.support-session[data-support-state="connected"] #support-end {
  display: inline-flex;
}

.support-session[data-support-state="connected"] #support-start {
  display: none;
}

.support-join {
  margin: 16px 0 0;
  display: none;
}

.support-session[data-support-state="connected"] .support-join {
  display: block;
}

.support-code-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.support-code {
  margin: 0 0 8px;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--navy);
}

.support-join-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
}
