:root {
  color-scheme: light;
  --auth-ink: #101215;
  --auth-muted: #666c75;
  --auth-line: rgba(16, 18, 21, .11);
  --auth-blue: #1769ff;
  --auth-blue-dark: #0b4dc7;
  --auth-canvas: #f4f4f1;
  --auth-panel: #ffffff;
  --auth-navy: #0d1726;
  --auth-success: #087a5c;
  --auth-danger: #bb2d46;
  --auth-ease: cubic-bezier(.2, .75, .2, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  color: var(--auth-ink);
  background: var(--auth-canvas);
  font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid rgba(23, 105, 255, .28);
  outline-offset: 3px;
}

.auth-page {
  min-height: 100svh;
  display: grid;
  grid-template-rows: 66px minmax(0, 1fr);
}

.auth-header {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid var(--auth-line);
  background: rgba(244, 244, 241, .9);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.auth-header-inner {
  width: min(100% - 36px, 1460px);
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.auth-brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.auth-brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(16, 18, 21, .08);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(16, 18, 21, .08);
}

.auth-brand-mark img { width: 34px; height: 34px; object-fit: contain; }
.auth-brand-copy { min-width: 0; display: grid; gap: 1px; }
.auth-brand-copy strong { font-family: "Manrope", sans-serif; font-size: 15px; line-height: 1.1; }
.auth-brand-copy span { color: #747982; font-size: 10px; line-height: 1.25; }

.auth-header-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid var(--auth-line);
  border-radius: 8px;
  color: #555b64;
  background: rgba(255, 255, 255, .65);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  transition: color .25s ease, background .25s ease, transform .25s var(--auth-ease);
}

.auth-header-link:hover { color: var(--auth-blue); background: #fff; transform: translateY(-1px); }
.auth-header-link svg { width: 15px; height: 15px; }

.auth-main {
  width: min(100%, 1460px);
  min-height: 0;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(410px, .88fr) minmax(520px, 1.12fr);
  background: var(--auth-panel);
}

.auth-form-pane {
  min-width: 0;
  display: grid;
  place-items: center;
  padding: clamp(40px, 6vw, 92px) clamp(28px, 6vw, 92px);
}

.auth-form-shell { width: min(100%, 440px); }

.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  color: var(--auth-blue-dark);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-kicker::before { content: ""; width: 20px; height: 2px; background: currentColor; }

.auth-title {
  margin: 0;
  max-width: 410px;
  font-family: "Manrope", sans-serif;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.02;
  font-weight: 650;
}

.auth-intro { margin: 15px 0 0; color: var(--auth-muted); font-size: 15px; }
.auth-intro a { color: var(--auth-blue-dark); font-weight: 700; text-underline-offset: 3px; }

.auth-google {
  width: 100%;
  min-height: 50px;
  margin-top: 29px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--auth-line);
  border-radius: 8px;
  color: var(--auth-ink);
  background: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 7px 20px rgba(16, 18, 21, .05);
  transition: transform .25s var(--auth-ease), border-color .25s ease, box-shadow .25s ease;
}

.auth-google:hover { transform: translateY(-2px); border-color: rgba(23, 105, 255, .28); box-shadow: 0 12px 28px rgba(16, 18, 21, .09); }
.auth-google svg { width: 18px; height: 18px; }

.auth-divider { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 24px 0; color: #898e96; font-size: 11px; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; background: var(--auth-line); }

.auth-form { display: grid; gap: 17px; }
.auth-field { display: grid; gap: 7px; }
.auth-field-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-field label { color: #30343a; font-size: 12px; font-weight: 800; }
.auth-field-help { color: #858a92; font-size: 10px; }

.auth-input-wrap { position: relative; }
.auth-input-wrap > svg { position: absolute; top: 50%; left: 14px; width: 17px; height: 17px; transform: translateY(-50%); color: #858c96; pointer-events: none; }

.auth-input {
  width: 100%;
  height: 50px;
  padding: 0 46px 0 43px;
  border: 1px solid var(--auth-line);
  border-radius: 8px;
  color: var(--auth-ink);
  background: #fbfbf9;
  font-size: 14px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.auth-input::placeholder { color: #a0a4aa; }
.auth-input:hover { border-color: rgba(16, 18, 21, .2); }
.auth-input:focus { outline: none; border-color: var(--auth-blue); background: #fff; box-shadow: 0 0 0 4px rgba(23, 105, 255, .1); }

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 6px;
  color: #6e747d;
  background: transparent;
  cursor: pointer;
}

.auth-password-toggle:hover { color: var(--auth-blue); background: #edf3ff; }
.auth-password-toggle svg { width: 16px; height: 16px; }

.auth-form-meta { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.auth-check { display: inline-flex; align-items: flex-start; gap: 9px; color: var(--auth-muted); font-size: 11px; cursor: pointer; }
.auth-check input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--auth-blue); }
.auth-check a { color: var(--auth-blue-dark); font-weight: 700; text-underline-offset: 3px; }

.auth-text-button {
  padding: 0;
  border: 0;
  color: var(--auth-blue-dark);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.auth-text-button:hover { text-decoration: underline; text-underline-offset: 3px; }

.auth-submit {
  width: 100%;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--auth-ink);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(16, 18, 21, .18);
  transition: transform .25s var(--auth-ease), background .25s ease, box-shadow .25s ease;
}

.auth-submit:hover { transform: translateY(-2px); background: var(--auth-blue); box-shadow: 0 15px 34px rgba(23, 105, 255, .2); }
.auth-submit:disabled, .auth-google:disabled { opacity: .65; cursor: wait; transform: none; }
.auth-submit svg { width: 16px; height: 16px; }

.auth-status { min-height: 20px; margin: 2px 0 0; color: var(--auth-muted); font-size: 12px; }
.auth-status[data-state="error"] { color: var(--auth-danger); }
.auth-status[data-state="success"] { color: var(--auth-success); }

.auth-security-note { margin: 24px 0 0; display: flex; align-items: center; gap: 8px; color: #82878e; font-size: 10px; }
.auth-security-note svg { width: 14px; height: 14px; color: var(--auth-success); }

.auth-context {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: clamp(34px, 5vw, 72px);
  display: grid;
  align-content: space-between;
  color: #fff;
  background: var(--auth-navy);
}

.auth-context::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .14;
  background-image: linear-gradient(rgba(255, 255, 255, .1) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .1) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
  pointer-events: none;
}

.auth-context-head, .auth-context-system, .auth-context-foot { position: relative; z-index: 2; }
.auth-context-label { display: inline-flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, .62); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.auth-live-dot { width: 7px; height: 7px; border-radius: 50%; background: #62deb5; box-shadow: 0 0 0 5px rgba(98, 222, 181, .1); }

.auth-context h2 { max-width: 650px; margin: 21px 0 0; font-family: "Manrope", sans-serif; font-size: clamp(32px, 4.2vw, 64px); line-height: 1.02; font-weight: 600; }
.auth-context-copy { max-width: 570px; margin: 17px 0 0; color: rgba(255, 255, 255, .62); font-size: 14px; }

.auth-context-system {
  width: min(100%, 650px);
  margin: clamp(34px, 7vh, 72px) 0;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .05);
  box-shadow: 0 28px 70px rgba(0, 0, 0, .25);
}

.auth-system-top { min-height: 48px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid rgba(255, 255, 255, .09); }
.auth-system-brand { display: flex; align-items: center; gap: 9px; font-size: 11px; font-weight: 800; }
.auth-system-brand img { width: 25px; height: 25px; object-fit: contain; }
.auth-system-state { color: #69dfba; font-size: 9px; font-weight: 800; text-transform: uppercase; }

.auth-system-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.auth-system-item { min-width: 0; min-height: 126px; padding: 20px; border-right: 1px solid rgba(255, 255, 255, .09); }
.auth-system-item:last-child { border-right: 0; }
.auth-system-item svg { width: 21px; height: 21px; color: #73a9ff; }
.auth-system-item:nth-child(2) svg { color: #62deb5; }
.auth-system-item:nth-child(3) svg { color: #f0b873; }
.auth-system-item strong { display: block; margin-top: 22px; font-size: 13px; }
.auth-system-item span { display: block; margin-top: 4px; overflow: hidden; color: rgba(255, 255, 255, .5); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.auth-context-foot { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .48); font-size: 10px; }
.auth-context-foot a { color: rgba(255, 255, 255, .78); text-decoration: none; font-weight: 700; }
.auth-context-foot a:hover { color: #fff; }

@media (max-width: 980px) {
  .auth-page { grid-template-rows: 62px auto; }
  .auth-main { grid-template-columns: 1fr; }
  .auth-form-pane { min-height: calc(100svh - 62px); padding: 48px 24px 56px; }
  .auth-context { min-height: 420px; padding: 40px 24px; }
  .auth-context h2 { max-width: 720px; }
  .auth-context-system { margin: 34px 0; }
}

@media (max-width: 620px) {
  .auth-header-inner { width: calc(100% - 24px); }
  .auth-brand-copy span { display: none; }
  .auth-header-link span { display: none; }
  .auth-header-link { width: 38px; padding: 0; justify-content: center; }
  .auth-form-pane { place-items: start center; min-height: calc(100svh - 62px); padding: 38px 18px 46px; }
  .auth-title { font-size: 36px; }
  .auth-form-meta { align-items: flex-start; }
  .auth-context { min-height: 390px; padding: 32px 18px; }
  .auth-context h2 { font-size: 34px; }
  .auth-context-copy { font-size: 12px; }
  .auth-system-grid { grid-template-columns: 1fr; }
  .auth-system-item { min-height: 76px; padding: 15px; display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 0 10px; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .09); }
  .auth-system-item:last-child { border-bottom: 0; }
  .auth-system-item strong { margin-top: 0; }
  .auth-system-item span { grid-column: 2; margin-top: -8px; }
  .auth-context-foot { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

body[data-auth-mode] {
  background: var(--auth-canvas);
}

body[data-auth-mode] .page-main {
  min-height: 0;
  padding: 0;
}

body[data-auth-mode] .page-main > .container {
  width: min(100%, 1460px);
}

body[data-auth-mode] .page-panel {
  display: grid;
  grid-template-columns: minmax(410px, .88fr) minmax(520px, 1.12fr);
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--auth-panel);
}

body[data-auth-mode] .auth-title {
  max-width: 650px;
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: clamp(36px, 4.2vw, 64px);
  line-height: 1.02;
  font-weight: 600;
}

@media (max-width: 980px) {
  body[data-auth-mode] .page-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  body[data-auth-mode] .page-panel {
    width: 100%;
  }
}

@media (min-width: 1081px) {
  body.direct-site[data-auth-mode] #megaShell {
    width: auto !important;
    max-width: none !important;
    right: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    transform: translateY(-12px) !important;
  }

  body.direct-site[data-auth-mode] #megaShell.open {
    transform: none !important;
  }

  body.direct-site[data-auth-mode] #megaShell .mega-panel {
    width: min(calc(100% - 48px), 1540px) !important;
    max-width: none !important;
    margin: 0 auto !important;
    padding: 25px 0 30px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
}
