:root {
  /* tokens live in theme.css — light is default */
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--cxd-bg);
  color: var(--cxd-text);
}

button,
input,
textarea,
select {
  font-family: inherit;
}

.auth-body {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background:
    radial-gradient(900px 420px at 8% 88%, rgba(0, 167, 185, 0.16), transparent 55%),
    radial-gradient(700px 360px at 100% 0%, rgba(0, 167, 185, 0.08), transparent 45%),
    #f7fcff;
}

html[data-theme="dark"] .auth-body {
  background:
    radial-gradient(900px 420px at 8% 88%, rgba(0, 167, 185, 0.22), transparent 55%),
    radial-gradient(700px 360px at 100% 0%, rgba(0, 167, 185, 0.12), transparent 45%),
    var(--cxd-bg);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--cxd-surface);
  border: 1px solid var(--cxd-border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--cxd-shadow);
}

.auth-brand {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.auth-logo {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--cxd-cta);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 20px;
}

.auth-brand h1 {
  font-family: var(--font-head);
  margin: 12px 0 4px;
  font-size: 22px;
}

.auth-brand p,
.auth-switch {
  color: var(--cxd-muted);
  font-size: 14px;
  margin: 0;
}

.auth-form h2 {
  font-family: var(--font-head);
  font-size: 14px;
  margin: 20px 0 10px;
  color: var(--cxd-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-form label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin: 10px 0 6px;
}

.auth-form input,
.auth-form select {
  width: 100%;
  box-sizing: border-box;
  background-color: var(--cxd-bg);
  border: 1px solid var(--cxd-border);
  color: var(--cxd-text);
  border-radius: 8px;
  padding: 10px 12px;
  outline: none;
  transition: border-color var(--ease);
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
}

.auth-form select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
}

.auth-form select option {
  background: var(--cxd-surface);
  color: var(--cxd-text);
}

.auth-form input:focus,
.auth-form select:focus {
  border-color: var(--cxd-cta);
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: min(18px, 2.5dvh);
  background: linear-gradient(90deg, #00B8C8, #00A7B9);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: min(12px, 1.5dvh) 24px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background var(--ease), box-shadow var(--ease), filter var(--ease);
}
.auth-btn:hover {
  filter: brightness(0.96);
  box-shadow: 0 8px 20px rgba(0, 167, 185, 0.28);
}
.auth-btn:disabled {
  opacity: 0.65;
  cursor: default;
  filter: none;
  box-shadow: none;
}

.auth-alert {
  background: #fff1f2;
  color: var(--cxd-danger);
  border: 1px solid #fecdd3;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  white-space: pre-wrap;
}

html[data-theme="dark"] .auth-alert {
  background: rgba(248, 113, 113, 0.12);
  border-color: #7f1d1d;
}

.auth-success {
  color: var(--cxd-online);
}

.auth-note,
.auth-switch {
  text-align: center;
  margin-top: 16px;
}

.auth-switch a,
.auth-note a {
  color: var(--cxd-link);
  text-decoration: none;
}

.auth-switch a:hover,
.auth-note a:hover {
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ============================================================
   Login landing — full bleed, matches the reference composition
   ============================================================ */

body.auth-landing {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 100dvh;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  font-family: Inter, var(--font-body);
  color: #1e293b;
  background: #f9fbfc;
}

.auth-landing h1,
.auth-landing h2,
.auth-wordmark,
.auth-brandblock strong {
  font-family: Poppins, var(--font-head);
}

.auth-stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  min-height: 0;
}

/* ---------- background decoration ---------- */

.auth-deco {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.auth-dots {
  position: absolute;
  top: clamp(16px, 3dvh, 34px);
  left: clamp(18px, 3vw, 40px);
  width: 86px;
  height: 64px;
  color: #cbd5e1;
  background-image: radial-gradient(currentColor 1.3px, transparent 1.4px);
  background-size: 11px 11px;
  opacity: 0.9;
}
.auth-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
}
.auth-glow--tr {
  width: 340px;
  height: 260px;
  right: -70px;
  top: -60px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.13), transparent 70%);
}
.auth-wave {
  position: absolute;
  left: 0;
  bottom: 0;
  width: min(66%, 760px);
  height: min(50%, 380px);
}

/* ---------- layout ---------- */

.auth-wrap {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  min-height: 0;
  gap: clamp(8px, 1.6dvh, 18px);
  padding: clamp(12px, 2.4dvh, 28px) clamp(18px, 3.2vw, 44px) clamp(10px, 1.6dvh, 18px);
}
.auth-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(324px, 31vw, 448px);
  grid-auto-rows: minmax(0, 1fr);
  gap: clamp(20px, 3vw, 56px);
  align-items: center;
}

/* ---------- left column ---------- */

.auth-intro {
  position: relative;
  min-width: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
}
.auth-copyblock {
  padding-left: clamp(0px, 7vw, 84px);
}
.auth-brandblock {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: fit-content;
  gap: 6px;
  margin: 0 0 clamp(12px, 2.6dvh, 28px);
}
.auth-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.05em;
  font-size: min(clamp(32px, 4.6vw, 68px), 9dvh);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}
.auth-logo-img {
  height: min(clamp(56px, 8vw, 88px), 11dvh);
  width: auto;
  max-width: min(280px, 72vw);
  object-fit: contain;
  display: block;
  border-radius: 0;
}
.auth-wordmark-ico {
  width: 0.56em;
  height: 0.56em;
  flex: none;
  color: #12b5cb;
  margin-right: -0.03em;
  filter: drop-shadow(0 5px 10px rgba(0, 167, 185, 0.26));
}
.auth-wordmark-text {
  background: linear-gradient(96deg, #17c3d2 0%, #00a7b9 42%, #0b7fc4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-wordmark-wave {
  display: inline-flex;
  align-items: center;
  gap: 0.055em;
  height: 0.58em;
  margin-left: 0.04em;
}
.auth-wordmark-wave i {
  width: 0.08em;
  border-radius: 0.06em;
  background: linear-gradient(180deg, #19b8d4, #0b7fc4);
}
.auth-wordmark-wave i:nth-child(1) { height: 44%; }
.auth-wordmark-wave i:nth-child(2) { height: 82%; }
.auth-wordmark-wave i:nth-child(3) { height: 100%; }
.auth-wordmark-wave i:nth-child(4) { height: 62%; }
.auth-brandblock strong {
  font-size: min(clamp(10.5px, 1.15vw, 16.5px), 2.4dvh);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0f172a;
}

.auth-intro h1 {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  font-size: min(clamp(25px, 3.1vw, 46px), 7.4dvh);
  line-height: 1.16;
  font-weight: 700;
  color: #1e293b;
}
.auth-h1-brand { font-weight: 800; }
.auth-h1-brand em {
  font-style: normal;
  background: linear-gradient(96deg, #17c3d2, #00a7b9 55%, #0b7fc4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-dash {
  display: block;
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: #00a7b9;
  margin: clamp(8px, 1.6dvh, 15px) 0;
}
.auth-lead {
  margin: 0;
  max-width: 31ch;
  font-size: min(clamp(12px, 1.22vw, 17.5px), 2.7dvh);
  line-height: 1.62;
  color: #64748b;
}

/* floating chat decorations (positioned inside the left column) */
.auth-float {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  border-radius: 50% 50% 50% 6px;
  pointer-events: none;
}
.auth-float svg { width: 46%; height: 46%; }
.auth-float--1 {
  top: 16%;
  right: 6%;
  width: clamp(34px, 5.4vw, 56px);
  height: clamp(34px, 5.4vw, 56px);
  background: #eef3f5;
  color: #b6c6cd;
}
.auth-float--2 {
  top: 38%;
  right: 17%;
  width: clamp(24px, 3.6vw, 36px);
  height: clamp(24px, 3.6vw, 36px);
  background: #dcf0f5;
  color: #8cc3d1;
}
.auth-float--3 {
  top: 47%;
  right: 25%;
  width: clamp(20px, 3vw, 30px);
  height: clamp(20px, 3vw, 30px);
  background: #eff5f7;
  color: #c2d3d9;
}
.auth-float--4 {
  top: 53%;
  right: 12%;
  width: clamp(28px, 4.2vw, 40px);
  height: clamp(28px, 4.2vw, 40px);
  background: #cfeaf2;
  color: #3aa8c2;
  border-radius: 50% 50% 6px 50%;
}
.auth-float--5 {
  top: 60%;
  left: 11%;
  width: clamp(28px, 4.2vw, 40px);
  height: clamp(28px, 4.2vw, 40px);
  background: #00a7b9;
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 167, 185, 0.3);
}
.auth-float--6 {
  top: 65%;
  right: 5%;
  width: clamp(26px, 4vw, 38px);
  height: clamp(26px, 4vw, 38px);
  background: #d3eff5;
  color: #17a9c0;
  border-radius: 50% 50% 50% 6px;
}

/* hero photo — cut-out feel, no frame */
.auth-hero {
  position: relative;
  margin: clamp(4px, 1.2dvh, 12px) 0 0 clamp(0px, 2.6vw, 32px);
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.auth-hero img {
  display: block;
  flex: 0 1 auto;
  min-height: 0;
  width: clamp(280px, 80%, 560px);
  height: min(clamp(170px, 24vw, 360px), 34dvh);
  object-fit: cover;
  object-position: 48% 20%;
  border-radius: 0;
  box-shadow: none;
  -webkit-mask-image: radial-gradient(60% 68% at 46% 40%, #000 30%, rgba(0, 0, 0, 0.45) 60%, transparent 84%);
  mask-image: radial-gradient(60% 68% at 46% 40%, #000 30%, rgba(0, 0, 0, 0.45) 60%, transparent 84%);
}

/* feature cards overlapping the bottom of the photo */
.auth-features {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(7px, 1vw, 12px);
  margin-top: clamp(-30px, -3.4dvh, -20px);
}
.auth-features article {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 12px;
  padding: clamp(9px, 1.5dvh, 13px) clamp(12px, 1.3vw, 16px);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}
.auth-features span {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  color: #00a7b9;
  background: #e2f6f9;
}
.auth-features p {
  margin: 0;
  min-width: 0;
  text-align: left;
}
.auth-features strong {
  display: block;
  font-size: min(clamp(11.5px, 1.05vw, 15px), 2.3dvh);
  font-weight: 700;
  line-height: 1.25;
  color: #1e293b;
}
.auth-features small {
  display: block;
  font-size: min(clamp(10.5px, 0.95vw, 13.5px), 2.1dvh);
  line-height: 1.3;
  color: #64748b;
}

/* ---------- login card ---------- */

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.auth-card--login {
  position: relative;
  width: 100%;
  max-width: 448px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 46px rgba(15, 23, 42, 0.07);
  padding: clamp(16px, 3dvh, 32px) clamp(18px, 3.5vw, 52px) clamp(20px, 3.4dvh, 40px);
  text-align: center;
  overflow: visible;
}
.auth-lang {
  position: absolute;
  top: clamp(10px, 1.8dvh, 18px);
  right: clamp(12px, 1.6vw, 20px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #e2e8f0;
  border-radius: 15px;
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  color: #1e293b;
}
.auth-lang svg { flex: none; }
.auth-lang .auth-lang-chev { color: #94a3b8; }

.auth-card-ico {
  position: relative;
  width: min(clamp(94px, 10.5vw, 158px), 21dvh);
  height: min(clamp(94px, 10.5vw, 158px), 21dvh);
  margin: clamp(10px, 2.2dvh, 26px) auto clamp(10px, 1.8dvh, 18px);
  display: grid;
  place-items: center;
}
.auth-orbit {
  position: absolute;
  border-radius: 50%;
}
.auth-orbit--a {
  inset: 0;
  border: 1px solid rgba(0, 167, 185, 0.22);
}
.auth-orbit--b {
  inset: 13%;
  border: 1px solid rgba(0, 167, 185, 0.16);
}
.auth-orbit--glow {
  inset: 20%;
  background: radial-gradient(circle, rgba(0, 167, 185, 0.11), transparent 68%);
}
.auth-orbit-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #00a7b9;
}
.auth-orbit-dot--1 { top: 6%; right: 20%; }
.auth-orbit-dot--2 { top: 30%; left: 3%; width: 4px; height: 4px; opacity: 0.75; }
.auth-orbit-dot--3 { bottom: 16%; right: 6%; width: 4px; height: 4px; opacity: 0.6; }
.auth-orbit-dot--4 { bottom: 4%; left: 32%; width: 3px; height: 3px; opacity: 0.5; }
.auth-ico-bubble {
  position: relative;
  z-index: 1;
  width: min(clamp(48px, 5.4vw, 82px), 11dvh);
  height: min(clamp(48px, 5.4vw, 82px), 11dvh);
  display: grid;
  place-items: center;
}
.auth-ico-bubble svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 9px 18px rgba(0, 150, 190, 0.28));
}

.auth-card--login h2 {
  margin: 0 0 5px;
  font-size: min(clamp(17px, 1.85vw, 26px), 3.6dvh);
  font-weight: 700;
  color: #1e293b;
}
.auth-glad {
  margin: 0;
  font-size: min(clamp(11.5px, 1.1vw, 15.5px), 2.4dvh);
  color: #64748b;
}

.auth-card--login .auth-btn {
  margin-top: 0;
  border-radius: 10px;
  min-height: min(clamp(38px, 3.6vw, 54px), 7.6dvh);
  padding: clamp(8px, 1.4dvh, 14px) 18px;
  font-size: min(clamp(13px, 1.2vw, 17px), 2.6dvh);
  font-weight: 600;
}
.auth-card--login .auth-btn--cta {
  margin-top: clamp(12px, 2.4dvh, 22px);
  background: #00a3b5;
  box-shadow: 0 6px 16px rgba(0, 163, 181, 0.24);
}
.auth-card--login .auth-btn--cta:hover {
  background: #008ea0;
  box-shadow: 0 8px 20px rgba(0, 163, 181, 0.3);
}
.auth-btn--ghost {
  margin-top: 0;
  background: #fff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  box-shadow: none;
  filter: none;
}
.auth-btn--ghost:hover {
  background: #f8fafc;
  border-color: #00a7b9;
  color: #00a7b9;
  box-shadow: none;
  filter: none;
}
.auth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: clamp(9px, 1.8dvh, 16px) 0;
  color: #94a3b8;
  font-size: 13px;
}
.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.auth-privacy {
  display: flex;
  align-items: center;
  gap: clamp(8px, 0.9vw, 11px);
  margin: clamp(10px, 2dvh, 18px) 0 0;
  padding: clamp(8px, 1.2dvh, 11px) clamp(9px, 1vw, 13px);
  background: #f4fcfd;
  border: 1px solid #cdeef4;
  border-radius: 10px;
  text-align: left;
}
.auth-privacy > span {
  display: grid;
  place-items: center;
  width: clamp(22px, 2.2vw, 28px);
  height: clamp(22px, 2.2vw, 28px);
  flex: none;
  border-radius: 8px;
  background: #dff3f7;
  color: #00a7b9;
}
.auth-privacy p { margin: 0; min-width: 0; }
.auth-privacy b {
  display: block;
  font-size: clamp(11.2px, 0.88vw, 12.5px);
  font-weight: 600;
  color: #1e293b;
}
.auth-privacy small {
  display: block;
  font-size: clamp(9.8px, 0.78vw, 11.5px);
  line-height: 1.35;
  color: #64748b;
}
.auth-card--login .auth-alert { text-align: left; }
.auth-card--login .auth-switch {
  margin: clamp(10px, 2dvh, 18px) 0 0;
  font-size: 13px;
  color: #64748b;
}
.auth-btn:focus-visible,
.auth-text-btn:focus-visible,
.auth-form input:focus-visible,
.auth-form select:focus-visible {
  outline: 2px solid #00a7b9;
  outline-offset: 2px;
}
.auth-text-btn {
  background: none;
  border: 0;
  color: #00a7b9;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.auth-text-btn:hover { text-decoration: underline; }

/* ---------- footer bar ---------- */

.auth-foot {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, 1.6vw, 22px);
  width: 100%;
  margin: 0;
  padding: clamp(6px, 1dvh, 9px) clamp(10px, 1.4vw, 18px);
  background: #fff;
  border: 1px solid #eef2f6;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  font-size: 12px;
  color: #475569;
}
.auth-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.auth-copy .auth-badge {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 9px;
  background: #e2f6f9;
  color: #00a7b9;
}
.auth-copy-txt { min-width: 0; }
.auth-copy b {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #00a7b9;
}
.auth-copy small {
  display: block;
  font-size: 11px;
  color: #64748b;
}
.auth-foot nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(8px, 2.2vw, 26px);
}
.auth-foot a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #475569;
  text-decoration: none;
}
.auth-foot a svg { color: #64748b; }
.auth-foot a:hover { color: #00a7b9; }
.auth-foot a:hover svg { color: #00a7b9; }
.auth-langbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 30px;
  padding: 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  color: #1e293b;
}

.auth-page .auth-foot {
  width: 100%;
  max-width: none;
  margin: 16px 0 0;
  border: 0;
  border-radius: 0;
  justify-content: center;
  box-shadow: none;
  background: transparent;
}

/* ---------- modals / other auth pages ---------- */

.auth-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  z-index: 30;
  padding: 16px;
  overflow-y: auto;
}
.auth-modal[hidden] { display: none; }
.auth-modal .auth-card { text-align: left; }
.auth-card h2 {
  font-family: var(--font-head);
  margin: 0 0 12px;
}
.auth-box__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.auth-box__head h2 { margin: 0; }
.auth-page { flex-direction: column; }
.auth-card--wide { max-width: 720px; }
.auth-legal { color: var(--cxd-text); line-height: 1.65; font-size: 14.5px; }
.auth-form textarea {
  width: 100%;
  min-height: 120px;
  background: var(--cxd-bg);
  border: 1px solid var(--cxd-border);
  color: var(--cxd-text);
  border-radius: 8px;
  padding: 10px 12px;
}

/* —— Legal / rules / contact pages —— */
/* Override .auth-body centering — that was letting content sit under the sticky bar */
.legal-page.auth-body,
body.legal-page {
  min-height: 100vh;
  height: auto;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  background: var(--cxd-bg);
}
.legal-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  flex: 0 0 auto;
  width: 100%;
  background: var(--cxd-surface);
  border-bottom: 1px solid var(--cxd-border);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
}
.legal-bar__inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.legal-bar__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--cxd-text);
  font-family: var(--font-head);
  font-size: 15px;
  margin-right: auto;
}
.legal-bar__brand .chat-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--cxd-cta);
  color: var(--cxd-logo-fg, #fff);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
}
.legal-bar__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.legal-bar__link {
  text-decoration: none;
  color: var(--cxd-muted);
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
}
.legal-bar__link:hover {
  color: var(--cxd-text);
  background: var(--cxd-surface-2);
}
.legal-bar__link.is-on {
  color: var(--cxd-text);
  background: var(--cxd-surface-2);
}
.legal-bar__back {
  color: #fff;
  background: var(--cxd-cta);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 10px;
  white-space: nowrap;
}
.legal-bar__back:hover {
  filter: brightness(1.05);
}
/* legacy class kept if any cached markup references it */
.legal-top {
  display: none;
}
.legal-wrap {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  box-sizing: border-box;
  flex: 1 0 auto;
}
.legal-page > .auth-foot {
  flex: 0 0 auto;
  margin-top: auto;
}
.legal-card {
  background: var(--cxd-surface);
  border: 1px solid var(--cxd-border);
  border-radius: 18px;
  padding: 22px 22px 28px;
  box-shadow: var(--cxd-shadow);
}
.legal-card h1 {
  margin: 0 0 10px;
  font-family: var(--font-head);
  font-size: 26px;
  letter-spacing: 0.2px;
}
.legal-card h2 {
  margin: 0 0 8px;
  font-family: var(--font-head);
  font-size: 17px;
}
.legal-lead {
  margin: 0 0 16px;
  color: var(--cxd-text);
  opacity: 0.88;
  line-height: 1.55;
  font-size: 14.5px;
}
.legal-meta {
  margin: 0 0 12px;
  color: var(--cxd-muted);
  font-size: 12.5px;
}
.legal-olist {
  margin: 0 0 18px;
  padding-left: 1.25rem;
  color: var(--cxd-text);
  line-height: 1.7;
}
.legal-olist li { margin: 0 0 8px; }
.legal-section {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--cxd-border);
}
.legal-note {
  margin: 18px 0 0;
  color: var(--cxd-muted);
  line-height: 1.55;
  font-size: 14px;
}
.legal-note a { color: var(--cxd-link); }

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rules-item {
  border: 0;
  background: transparent;
}
.rules-item > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.rules-item > summary::-webkit-details-marker { display: none; }
.rules-num {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  font-family: var(--font-head);
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.18);
}
.rules-num--orange { background: #f97316; }
.rules-num--slate { background: #334155; }
.rules-num--blue { background: #3b82f6; }
.rules-num--green { background: #22c55e; }
.rules-num--teal { background: #14b8a6; }
.rules-num--rose { background: #f43f5e; }
.rules-num--violet { background: #8b5cf6; }
.rules-title {
  flex: 1;
  min-width: 0;
  background: var(--cxd-surface-2);
  border: 1px solid var(--cxd-border);
  border-radius: 12px;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 15px;
  color: var(--cxd-text);
  letter-spacing: 0.2px;
}
.rules-item[open] .rules-title {
  background: var(--cxd-surface);
  border-color: color-mix(in srgb, var(--cxd-cta) 35%, var(--cxd-border));
}
.rules-body {
  margin: 8px 0 0 56px;
  color: var(--cxd-text);
  opacity: 0.9;
  font-size: 14px;
  line-height: 1.6;
}
.rules-note {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--cxd-cta) 12%, var(--cxd-surface));
  border: 1px solid color-mix(in srgb, var(--cxd-cta) 28%, var(--cxd-border));
}
.rules-note strong {
  display: block;
  margin-bottom: 8px;
  color: var(--cxd-text);
  font-size: 15px;
  font-weight: 800;
}
.rules-note p {
  margin: 0;
  color: var(--cxd-text);
  opacity: 0.9;
  font-size: 14px;
  line-height: 1.6;
}

html[data-theme="dark"] .rules-note {
  background: rgba(0, 167, 185, 0.16);
  border-color: rgba(0, 167, 185, 0.4);
}
html[data-theme="dark"] .rules-note strong,
html[data-theme="dark"] .rules-note p,
html[data-theme="dark"] .rules-title,
html[data-theme="dark"] .rules-body,
html[data-theme="dark"] .legal-lead {
  color: #e8eef5;
  opacity: 1;
}

@media (max-width: 720px) {
  .legal-bar__nav { order: 3; width: 100%; }
  .legal-bar__link { padding: 7px 10px; font-size: 13px; }
}
@media (max-width: 560px) {
  .legal-card { padding: 18px 16px 22px; border-radius: 14px; }
  .rules-body { margin-left: 0; }
  .rules-num { width: 38px; height: 38px; font-size: 16px; }
  .legal-bar__brand strong { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------- dark theme ---------- */

html[data-theme="dark"] body.auth-landing {
  background: var(--cxd-bg);
  color: var(--cxd-text);
}
html[data-theme="dark"] .auth-brandblock strong,
html[data-theme="dark"] .auth-intro h1,
html[data-theme="dark"] .auth-features strong,
html[data-theme="dark"] .auth-privacy b,
html[data-theme="dark"] .auth-card--login h2 {
  color: var(--cxd-text);
}
html[data-theme="dark"] .auth-features article,
html[data-theme="dark"] .auth-card--login,
html[data-theme="dark"] .auth-lang,
html[data-theme="dark"] .auth-langbtn,
html[data-theme="dark"] .auth-landing .auth-foot {
  background: var(--cxd-surface);
  border-color: var(--cxd-border);
}
html[data-theme="dark"] .auth-lang,
html[data-theme="dark"] .auth-langbtn,
html[data-theme="dark"] .auth-foot,
html[data-theme="dark"] .auth-foot a {
  color: var(--cxd-text);
}
html[data-theme="dark"] .auth-privacy {
  background: rgba(0, 167, 185, 0.1);
  border-color: rgba(0, 167, 185, 0.28);
}
html[data-theme="dark"] .auth-btn--ghost {
  background: var(--cxd-surface);
  color: var(--cxd-text);
}
html[data-theme="dark"] .auth-card--login .auth-form input,
html[data-theme="dark"] .auth-form input,
html[data-theme="dark"] .auth-form select {
  background-color: var(--cxd-surface-2);
}
html[data-theme="dark"] .auth-form select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%94a3b8' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
}
html[data-theme="dark"] .auth-dots { color: #334155; }

/* ---------- responsive ---------- */

/* narrow desktop / tablet landscape — keep both columns, drop the far floats */
@media (max-width: 1040px) {
  .auth-float--1,
  .auth-float--3 { display: none; }
  .auth-copyblock { padding-left: clamp(0px, 3.5vw, 40px); }
}

/* mobile & small tablets — login card + footer only */
@media (max-width: 880px) {
  .auth-intro,
  .auth-dots { display: none; }
  .auth-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    justify-items: center;
    align-items: center;
  }
  .auth-panel { width: 100%; }
  .auth-card--login {
    max-width: 420px;
    margin: 0 auto;
    padding: clamp(20px, 3dvh, 34px) clamp(20px, 6vw, 34px) clamp(22px, 3.2dvh, 34px);
  }
  .auth-card-ico {
    width: min(120px, 19dvh);
    height: min(120px, 19dvh);
  }
  .auth-ico-bubble {
    width: min(62px, 10dvh);
    height: min(62px, 10dvh);
  }
  .auth-card--login h2 { font-size: 21px; }
  .auth-glad { font-size: 13px; }
  .auth-card--login .auth-btn {
    min-height: 47px;
    font-size: 15px;
  }
  .auth-wrap {
    padding: clamp(14px, 2.6dvh, 26px) 16px 14px;
    gap: 14px;
  }
  .auth-wave { width: 100%; height: min(52%, 340px); }
  .auth-foot {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    row-gap: 10px;
    padding: 10px 14px;
  }
  .auth-copy { justify-content: center; }
  .auth-foot nav { justify-content: center; }
}

@media (max-width: 560px) {
  .auth-card--login { max-width: none; }
  .auth-lang {
    position: static;
    display: inline-flex;
    margin: 0 0 4px;
  }
  .auth-foot { font-size: 11.5px; }
  .auth-foot nav { gap: 8px 14px; }
  .auth-foot a { font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-btn { transition: none; }
}
