:root {
  color-scheme: light;
  --page-bg: #f7f7f8;
  --surface: #ffffff;
  --surface-secondary: #f0f2f5;
  --surface-elevated: #ffffff;
  --text-primary: #101114;
  --text-secondary: #626873;
  --text-muted: #626873;
  --border: rgba(16, 17, 20, 0.11);
  --border-strong: rgba(16, 17, 20, 0.2);
  --button-primary-bg: #101114;
  --button-primary-text: #ffffff;
  --button-primary-hover: #000000;
  --button-disabled-bg: #2b2d31;
  --button-disabled-text: rgba(255, 255, 255, 0.78);
  --button-secondary-bg: rgba(255, 255, 255, 0.72);
  --button-secondary-text: #101114;
  --accent: #8b611f;
  --error: #b42318;
  --input-bg: #ffffff;
  --input-placeholder: #69707a;
  --focus-ring: #7a541b;
  --shadow-soft: 0 13px 28px rgba(16, 17, 20, 0.16);
  --shadow-panel: 18px 0 60px rgba(0, 0, 0, 0.12);
  --auth-hero-overlay:
    linear-gradient(90deg, rgba(5, 7, 10, 0.78) 0%, rgba(5, 7, 10, 0.42) 54%, rgba(5, 7, 10, 0.48) 100%),
    linear-gradient(180deg, rgba(5, 7, 10, 0.38) 0%, rgba(5, 7, 10, 0.1) 42%, rgba(5, 7, 10, 0.9) 100%);
  --auth-ink: var(--text-primary);
  --auth-muted: var(--text-secondary);
  --auth-paper: var(--page-bg);
  --auth-white: #ffffff;
  --auth-charcoal: #080a0d;
  --auth-line: var(--border);
  --auth-gold: var(--accent);
  --auth-gold-light: #f2bd5e;
  --auth-focus: var(--focus-ring);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page-bg: #0b0d10;
    --surface: #15181d;
    --surface-secondary: #111318;
    --surface-elevated: #1a1d22;
    --text-primary: #ffffff;
    --text-secondary: #b8bec7;
    --text-muted: #929aa5;
    --border: #2e333a;
    --border-strong: #474e58;
    --button-primary-bg: #ffffff;
    --button-primary-text: #111111;
    --button-primary-hover: #f1f3f5;
    --button-disabled-bg: #30343a;
    --button-disabled-text: #9ca3ad;
    --button-secondary-bg: #1a1d22;
    --button-secondary-text: #ffffff;
    --accent: #e1b464;
    --error: #ff8b82;
    --input-bg: #111315;
    --input-placeholder: #858e99;
    --focus-ring: #f2bd5e;
    --shadow-soft: 0 13px 30px rgba(0, 0, 0, 0.42);
    --shadow-panel: 18px 0 64px rgba(0, 0, 0, 0.42);
    --auth-hero-overlay:
      linear-gradient(90deg, rgba(5, 7, 10, 0.92) 0%, rgba(5, 7, 10, 0.62) 54%, rgba(5, 7, 10, 0.64) 100%),
      linear-gradient(180deg, rgba(5, 7, 10, 0.54) 0%, rgba(5, 7, 10, 0.2) 42%, rgba(5, 7, 10, 0.98) 100%);
  }
}

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

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

body {
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  color: var(--auth-ink);
  background: var(--page-bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  letter-spacing: 0;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

input,
textarea,
select {
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  background: var(--input-bg);
  font: inherit;
}

input::placeholder,
textarea::placeholder {
  color: var(--input-placeholder);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  border-color: var(--focus-ring);
  outline: 3px solid color-mix(in srgb, var(--focus-ring) 42%, transparent);
  outline-offset: 2px;
}

input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--error);
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(410px, 40%) minmax(0, 60%);
  min-height: 100vh;
  min-height: 100svh;
}

.auth-panel {
  position: relative;
  z-index: 2;
  display: flex;
  min-width: 0;
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}

.auth-panel-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 620px;
  min-height: 100%;
  margin: 0 auto;
  padding: max(34px, env(safe-area-inset-top)) clamp(34px, 5vw, 72px) max(28px, env(safe-area-inset-bottom));
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  border-radius: 6px;
  text-decoration: none;
}

.auth-brand-logo {
  width: auto;
  height: 42px;
  max-width: 208px;
  object-fit: contain;
}

.auth-brand-logo-switcher {
  display: block;
}

.auth-back-link {
  color: var(--auth-muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
}

.auth-back-link:hover {
  color: var(--auth-ink);
}

.auth-content {
  width: 100%;
  max-width: 460px;
  margin: auto 0;
  padding: 64px 0;
}

.auth-eyebrow,
.brand-eyebrow {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.auth-eyebrow {
  color: var(--auth-gold);
}

.auth-title {
  max-width: 520px;
  margin: 0 0 18px;
  color: var(--auth-ink);
  font-size: clamp(42px, 4vw, 58px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.auth-description {
  max-width: 42ch;
  margin: 0 0 32px;
  color: var(--auth-muted);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.55;
}

.auth-actions {
  display: grid;
  gap: 12px;
  width: 100%;
}

.auth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 750;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

.auth-button:hover {
  transform: translateY(-1px);
}

.auth-button:active {
  transform: translateY(0);
}

.auth-button-primary {
  color: var(--button-primary-text);
  background: var(--button-primary-bg);
  box-shadow: var(--shadow-soft);
}

.auth-button-primary:hover {
  background: var(--button-primary-hover);
  box-shadow: 0 17px 34px rgba(0, 0, 0, 0.24);
}

.auth-button-primary:disabled {
  color: var(--button-disabled-text);
  background: var(--button-disabled-bg);
  box-shadow: 0 9px 20px rgba(16, 17, 20, 0.12);
  cursor: wait;
}

.auth-button-primary:disabled:hover {
  transform: none;
}

.auth-button-secondary {
  color: var(--button-secondary-text);
  border-color: var(--auth-line);
  background: var(--button-secondary-bg);
  box-shadow: 0 9px 22px rgba(16, 17, 20, 0.04);
}

.auth-button-secondary:hover {
  border-color: var(--border-strong);
  background: var(--surface-elevated);
  box-shadow: 0 13px 27px rgba(16, 17, 20, 0.08);
}

.auth-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 22px;
  margin: 18px 0 0;
  color: var(--auth-muted);
  font-size: 13px;
  font-weight: 600;
}

.auth-status[hidden] {
  display: none;
}

.loading-dots {
  display: inline-flex;
  gap: 5px;
}

.loading-dots span {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.26;
  animation: authPulse 1s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
  animation-delay: 140ms;
}

.loading-dots span:nth-child(3) {
  animation-delay: 280ms;
}

@keyframes authPulse {
  0%,
  100% {
    opacity: 0.24;
    transform: translateY(0);
  }

  50% {
    opacity: 0.9;
    transform: translateY(-2px);
  }
}

.auth-support {
  margin: 22px 0 0;
  color: var(--auth-muted);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}

.auth-support a,
.auth-footer a {
  color: var(--auth-ink);
  font-weight: 650;
  text-decoration-color: rgba(16, 17, 20, 0.32);
  text-underline-offset: 3px;
}

.auth-support a:hover,
.auth-footer a:hover {
  text-decoration-color: currentColor;
}

.auth-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  color: var(--auth-muted);
  font-size: 12px;
  line-height: 1.5;
}

.auth-footer a {
  color: var(--auth-muted);
  font-weight: 600;
  text-decoration: none;
}

.brand-panel {
  position: relative;
  isolation: isolate;
  display: flex;
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  color: var(--auth-white);
  background: var(--auth-charcoal);
}

.brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background: url("/assets/landing/construction-hero.webp") 58% center / cover no-repeat;
  transform: scale(1.02);
}

.brand-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--auth-hero-overlay);
}

.brand-vignette {
  position: absolute;
  inset: auto 0 0;
  z-index: -1;
  height: 42%;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(8, 10, 13, 0.7));
}

.brand-panel-inner {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(100%, 940px);
  min-height: 100%;
  margin: 0 auto;
  padding: clamp(48px, 6vh, 76px) clamp(42px, 6vw, 88px) clamp(38px, 6vh, 70px);
}

.brand-copy {
  position: relative;
  z-index: 2;
  max-width: 690px;
}

.brand-eyebrow {
  color: var(--auth-gold-light);
}

.brand-title {
  max-width: 650px;
  margin: 0 0 18px;
  font-size: clamp(40px, 4.3vw, 68px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.brand-description {
  max-width: 62ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(16px, 1.35vw, 20px);
  font-weight: 500;
  line-height: 1.48;
}

.auth-product-preview {
  align-self: end;
  width: min(100%, 720px);
  min-width: 0;
  max-height: min(51vh, 520px);
  margin: clamp(30px, 5vh, 58px) 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: transparent;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.auth-product-preview img {
  display: block;
  width: 100%;
  height: auto;
}

.auth-brand:focus-visible,
.auth-back-link:focus-visible,
.auth-button:focus-visible,
.auth-support a:focus-visible,
.auth-footer a:focus-visible {
  outline: 3px solid var(--auth-focus);
  outline-offset: 4px;
}

@media (max-width: 1100px) {
  .auth-layout {
    grid-template-columns: minmax(380px, 44%) minmax(0, 56%);
  }

  .auth-panel-inner {
    padding-right: 38px;
    padding-left: 38px;
  }

  .auth-back-link {
    display: none;
  }

  .brand-panel-inner {
    padding-right: 42px;
    padding-left: 42px;
  }

  .brand-title {
    font-size: clamp(38px, 5vw, 54px);
  }
}

@media (max-width: 780px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-panel,
  .brand-panel {
    min-height: auto;
  }

  .auth-panel {
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
  }

  .auth-panel-inner {
    min-height: min(720px, 100svh);
    padding: max(26px, env(safe-area-inset-top)) 24px max(26px, env(safe-area-inset-bottom));
  }

  .auth-header {
    gap: 16px;
  }

  .auth-brand-logo {
    height: 37px;
    max-width: 184px;
  }

  .auth-back-link {
    display: inline;
    font-size: 12px;
  }

  .auth-content {
    max-width: 520px;
    margin: auto;
    padding: 52px 0;
  }

  .auth-title {
    font-size: clamp(38px, 10vw, 50px);
  }

  .brand-panel {
    min-height: 620px;
  }

  .brand-panel-inner {
    min-height: 620px;
    padding: 54px 24px 42px;
  }

  .brand-panel::before {
    background-position: 63% center;
  }

  .brand-title {
    font-size: clamp(38px, 9vw, 52px);
  }

  .auth-product-preview {
    max-height: 300px;
    margin-right: auto;
  }
}

@media (max-width: 480px) {
  .auth-panel-inner {
    min-height: 100svh;
    padding-right: 18px;
    padding-left: 18px;
  }

  .auth-header {
    align-items: flex-start;
  }

  .auth-back-link {
    max-width: 94px;
    text-align: right;
    white-space: normal;
  }

  .auth-content {
    padding: 42px 0;
  }

  .auth-title {
    font-size: 38px;
  }

  .auth-description {
    margin-bottom: 28px;
    font-size: 15px;
  }

  .auth-footer {
    gap: 7px 14px;
  }

  .brand-panel,
  .brand-panel-inner {
    min-height: 560px;
  }

  .brand-panel-inner {
    padding-right: 18px;
    padding-left: 18px;
  }

  .brand-title {
    font-size: 38px;
  }

  .brand-description {
    font-size: 15px;
  }

  .auth-product-preview {
    max-height: 250px;
    border-radius: 14px;
  }
}

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

  .brand-panel::before,
  .auth-button:hover {
    transform: none;
  }
}
