:root {
  --auth-glow-a: rgba(129, 140, 248, 0.2);
  --auth-glow-b: rgba(56, 189, 248, 0.16);
}

html.dark {
  --auth-glow-a: rgba(99, 102, 241, 0.24);
  --auth-glow-b: rgba(14, 165, 233, 0.18);
}

[hidden] {
  display: none !important;
}

.auth {
  margin-top: calc(-1 * var(--nav-h));
  padding: calc(3.5rem + var(--nav-h)) 0 4.5rem;
  min-height: calc(100vh - 4rem);
  display: flex;
  align-items: center;
  background-image:
    radial-gradient(ellipse 900px 560px at 20% 0%, var(--auth-glow-a) 0%, transparent 65%),
    radial-gradient(ellipse 620px 460px at 92% 85%, var(--auth-glow-b) 0%, transparent 65%);
  background-repeat: no-repeat;
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: 4rem;
  align-items: center;
  width: 100%;
}

.auth-pitch-title {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  max-width: 520px;
}

.auth-pitch-lead {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--fg-muted);
  max-width: 460px;
  margin-bottom: 1.75rem;
}

.auth-benefits {
  margin: 0;
}

.auth-benefits li {
  font-size: 1rem;
}

.auth-card {
  padding: 2.25rem 2rem 1.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow-md), 0 24px 60px rgba(15, 23, 42, 0.08);
}

.auth-card h1 {
  font-size: 1.65rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin-bottom: 0.4rem;
}

.auth-sub {
  color: var(--fg-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 1.6rem;
}

.auth-sub strong,
.auth-text strong {
  color: var(--fg);
  word-break: break-all;
}

.auth-text {
  color: var(--fg-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.auth-field label,
.auth-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
}

.auth-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.8rem 1rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.auth-input::placeholder {
  color: var(--fg-subtle);
}

.auth-input:hover {
  border-color: var(--border-hover);
}

.auth-input:focus {
  border-color: var(--accent);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 4px var(--accent-soft-strong);
}

.auth-input-code {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 600;
}

.auth-input-otp {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.45em;
  padding: 0.75rem 1rem;
}

.auth-input-otp::placeholder {
  letter-spacing: 0.3em;
  opacity: 0.45;
}

.auth-antibot-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.auth-antibot-row img {
  display: block;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: #fff;
}

.auth-icon-btn {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--fg-muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.auth-icon-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.auth-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
}

.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--fg-muted);
  cursor: pointer;
}

.auth-check input {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-top: 0.15rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.auth-check a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-btn {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.85rem 1.35rem;
  font: inherit;
  font-size: 0.975rem;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}

.auth-btn.btn-secondary {
  border: 1px solid var(--border);
}

.auth-btn.is-loading {
  opacity: 0.75;
  cursor: progress;
}

.auth-btn-plain {
  width: 100%;
  padding: 0.6rem;
  background: none;
  border: 0;
  font: inherit;
  font-size: 0.9rem;
  color: var(--fg-muted);
  cursor: pointer;
}

.auth-btn-plain:hover {
  color: var(--fg);
}

.auth-stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.auth-msg {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.8rem 0.95rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.5;
  border: 1px solid;
}

.auth-msg svg {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.auth-msg a {
  color: inherit;
  font-weight: 700;
}

.auth-msg-error {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.28);
}

html.dark .auth-msg-error {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.32);
}

.auth-msg-success {
  color: #15803d;
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.28);
}

html.dark .auth-msg-success {
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.3);
}

.auth-alt {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--fg-muted);
}

.auth-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--fg-muted);
}

.auth-foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
}

.auth-foot a {
  color: inherit;
  text-decoration: none;
}

.auth-foot a:hover {
  color: var(--fg);
}

.auth-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

.auth-lang select {
  padding: 0.4rem 0.6rem;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--fg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.mock {
  position: relative;
  max-width: 500px;
  margin-top: 2rem;
}

.mock-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.1);
}

.mock-card + .mock-card {
  margin-top: 12px;
}

.mock-search {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: var(--radius-pill);
}

.mock-search svg {
  flex-shrink: 0;
  color: var(--accent);
}

.mock-line {
  display: block;
  height: 9px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--border) 25%, color-mix(in srgb, var(--border) 45%, var(--bg-elevated)) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: mock-shimmer 2.4s ease-in-out infinite;
}

.mock-search .mock-line {
  height: 11px;
}

.mock-title {
  height: 12px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 35%, transparent) 25%, color-mix(in srgb, var(--accent) 18%, transparent) 50%, color-mix(in srgb, var(--accent) 35%, transparent) 75%);
  background-size: 200% 100%;
}

.mock-caret {
  width: 2px;
  height: 18px;
  margin-left: -6px;
  background: var(--accent);
  animation: mock-blink 1s steps(1) infinite;
}

.mock-ai {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  background: linear-gradient(135deg, var(--accent-soft), var(--bg-elevated) 70%);
}

.mock-ai .mock-line {
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 16%, var(--border)) 25%, color-mix(in srgb, var(--accent) 8%, var(--bg-elevated)) 50%, color-mix(in srgb, var(--accent) 16%, var(--border)) 75%);
  background-size: 200% 100%;
}

.mock-ai-h {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
}

.mock-res {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.mock-url {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mock-url .mock-line {
  height: 7px;
}

.mock-fav {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 5px;
  background: linear-gradient(135deg, #f97316, #ef4444);
}

.mock-fav.b {
  background: linear-gradient(135deg, #22c55e, #0ea5e9);
}

.mock-sep {
  height: 1px;
  margin: 0.35rem 0;
  background: var(--border);
}

.chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
}

.chip b {
  font-size: 1.05rem;
  color: var(--accent);
}

.chip.c1 {
  top: -18px;
  right: -28px;
}

.chip.c2 {
  top: 50%;
  right: -46px;
}

.chip.c3 {
  bottom: -22px;
  right: 40px;
}

@keyframes mock-shimmer {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

@keyframes mock-blink {
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mock-line,
  .mock-caret {
    animation: none;
  }
}

@media (max-width: 900px) {
  .auth {
    padding-top: calc(2rem + var(--nav-h));
    align-items: flex-start;
  }

  .auth-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    max-width: 480px;
  }

  .auth-pitch {
    display: none;
  }

  .auth-pitch-mock {
    display: block;
    order: 2;
    padding: 0 0.5rem;
  }

  .auth-pitch-mock .overline {
    display: none;
  }

  .auth-pitch-mock .auth-pitch-title {
    font-size: clamp(1.45rem, 6vw, 1.8rem);
    margin-bottom: 0.6rem;
  }

  .auth-pitch-mock .auth-pitch-lead {
    font-size: 0.95rem;
    margin-bottom: 0;
  }

  .mock {
    margin-top: 1.75rem;
  }

  .chip {
    font-size: 0.72rem;
    padding: 6px 10px;
  }

  .chip b {
    font-size: 0.9rem;
  }

  .chip.c1 {
    top: -14px;
    right: 6px;
  }

  .chip.c2 {
    right: -6px;
  }

  .chip.c3 {
    right: auto;
    left: 10px;
    bottom: -16px;
  }
}

@media (max-width: 560px) {
  .auth-card {
    padding: 1.75rem 1.25rem 1.4rem;
  }

  .auth-foot {
    justify-content: center;
    text-align: center;
  }

  .auth-lang-label {
    display: none;
  }
}
