/* Auth pages — login & register */

.auth-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.auth-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--nav-bg));
  backdrop-filter: blur(12px);
}

.auth-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4rem;
  gap: 1rem;
}

.auth-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: stretch;
}

.auth-shell {
  display: grid;
  width: 100%;
  min-height: calc(100dvh - 4rem);
}

.auth-visual {
  display: none;
  position: relative;
  padding: clamp(2rem, 5vw, 3.5rem);
  background:
    radial-gradient(ellipse 80% 60% at 20% 20%, hsl(var(--accent) / 0.1) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 80% 80%, hsl(var(--accent) / 0.06) 0%, transparent 50%),
    linear-gradient(180deg, hsl(var(--muted) / 0.55) 0%, hsl(var(--muted) / 0.2) 100%);
  border-right: 1px solid hsl(var(--border));
  overflow: hidden;
}

.auth-visual-grid {
  pointer-events: none;
  position: absolute;
  inset: 0;
  opacity: 0.3;
  background-image:
    linear-gradient(hsl(var(--border) / 0.45) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--border) / 0.45) 1px, transparent 1px);
  background-size: 2rem 2rem;
  mask-image: radial-gradient(ellipse 70% 70% at 40% 50%, black 0%, transparent 75%);
}

.auth-visual-inner {
  position: relative;
  z-index: 1;
  max-width: 28rem;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2rem;
}

.auth-visual-copy h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

.auth-visual-copy h1 em {
  font-style: normal;
  background: linear-gradient(135deg, hsl(var(--accent)) 0%, hsl(222 28% 48%) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

[data-theme="dark"] .auth-visual-copy h1 em {
  background: linear-gradient(135deg, hsl(var(--accent)) 0%, hsl(222 30% 72%) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-visual-copy p {
  font-size: 1.0625rem;
  font-weight: 500;
  color: hsl(var(--muted-fg));
  line-height: 1.65;
}

.auth-visual-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  box-shadow: 0 16px 40px -16px hsl(var(--shadow) / 0.18);
  transition: transform 350ms var(--ease);
}

.auth-frame-bar {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  background: hsl(var(--muted) / 0.55);
  border-bottom: 1px solid hsl(var(--border));
}

.auth-frame-bar span:nth-child(1) { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #f87171; }
.auth-frame-bar span:nth-child(2) { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #fbbf24; }
.auth-frame-bar span:nth-child(3) { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #4ade80; }

.auth-frame-title {
  margin-left: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: hsl(var(--muted-fg));
}

.auth-frame-svg {
  width: 100%;
  display: block;
  padding: 0.5rem;
}

.auth-float-pill {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4375rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  box-shadow: 0 6px 16px -6px hsl(var(--shadow) / 0.15);
  white-space: nowrap;
  z-index: 2;
}

.auth-float-pill-1 { top: 1rem; right: -0.5rem; color: hsl(152 38% 40%); border-color: hsl(152 38% 40% / 0.25); }
.auth-float-pill-2 { bottom: 1.25rem; left: -0.5rem; color: hsl(var(--accent)); }

.auth-perks {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.auth-perks li {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: hsl(var(--muted-fg));
}

.auth-perks li svg {
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  color: hsl(var(--accent));
}

.auth-form-col {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 6vw, 3.5rem) clamp(1.25rem, 4vw, 2rem);
  background: hsl(var(--background));
}

.auth-form-wrap {
  width: 100%;
  max-width: 26rem;
}

.auth-form-header {
  margin-bottom: 2rem;
}

.auth-form-header .badge {
  margin-bottom: 1rem;
}

.auth-form-header h2 {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.auth-form-header p {
  font-size: 1.0625rem;
  font-weight: 500;
  color: hsl(var(--muted-fg));
  line-height: 1.6;
}

.auth-notice {
  margin-bottom: 1.25rem;
  padding: 0.875rem 1rem;
  border-radius: 0.5rem;
  background: hsl(152 38% 40% / 0.1);
  border: 1px solid hsl(152 38% 40% / 0.25);
  color: hsl(152 38% 32%);
  font-size: 0.875rem;
  line-height: 1.5;
}

.auth-code-input {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  font-family: ui-monospace, Consolas, monospace;
}

.auth-errors {
  margin-bottom: 1.25rem;
  padding: 0.875rem 1rem;
  border-radius: 0.5rem;
  background: hsl(0 72% 51% / 0.1);
  border: 1px solid hsl(0 72% 51% / 0.25);
  color: hsl(0 72% 40%);
}

.auth-errors ul {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.auth-input.is-invalid {
  border-color: hsl(0 72% 51% / 0.55);
}

.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.auth-dashboard-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

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

.auth-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 480px) {
  .auth-field-row {
    grid-template-columns: 1fr;
  }
}

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

.auth-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.auth-input {
  width: 100%;
  min-height: 2.875rem;
  padding: 0.625rem 0.875rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  transition:
    border-color var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease),
    background var(--duration) var(--ease);
}

.auth-input::placeholder {
  color: hsl(var(--muted-fg) / 0.65);
  font-weight: 400;
}

.auth-input:hover {
  border-color: hsl(var(--accent) / 0.25);
}

.auth-input:focus {
  outline: none;
  border-color: hsl(var(--accent) / 0.45);
  box-shadow: 0 0 0 3px hsl(var(--accent) / 0.12);
}

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

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-fg));
  cursor: pointer;
}

.auth-check input {
  width: 1rem;
  height: 1rem;
  accent-color: hsl(var(--accent));
  cursor: pointer;
}

.auth-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--accent));
  transition: opacity var(--duration) var(--ease);
}

.auth-link:hover {
  opacity: 0.8;
}

.auth-submit {
  width: 100%;
  min-height: 3rem;
  margin-top: 0.25rem;
  font-size: 1.0625rem;
}

a.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  text-decoration: none;
  line-height: 1.2;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-block: 1.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--muted-fg));
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: hsl(var(--border));
}

.auth-oauth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
}

.auth-oauth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0 0.875rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    background var(--duration) var(--ease),
    border-color var(--duration) var(--ease),
    transform 120ms var(--ease);
}

.auth-oauth-btn:hover {
  background: hsl(var(--muted));
  border-color: hsl(var(--accent) / 0.2);
}

.auth-oauth-btn:active {
  transform: scale(0.98);
}

.auth-oauth-btn svg {
  width: 1.125rem;
  height: 1.125rem;
}

.auth-switch {
  margin-top: 1.75rem;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 500;
  color: hsl(var(--muted-fg));
}

.auth-switch a {
  font-weight: 700;
  color: hsl(var(--accent));
}

.auth-switch--split {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
}

.auth-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid hsl(var(--border));
}

.auth-trust span {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--muted-fg));
  padding: 0.375rem 0.625rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.35);
}

.auth-trust span svg {
  width: 0.875rem;
  height: 0.875rem;
  color: hsl(var(--accent));
}

.auth-progress-bar {
  transform-origin: left center;
  animation: auth-progress 2.5s ease-in-out infinite;
}

@keyframes auth-progress {
  0%, 100% { transform: scaleX(0.4); }
  50% { transform: scaleX(1); }
}

@media (min-width: 960px) {
  .auth-shell {
    grid-template-columns: 1fr 1fr;
  }

  .auth-visual {
    display: flex;
    align-items: center;
  }
}

@media (max-width: 959px) {
  .auth-form-col {
    min-height: calc(100dvh - 4rem);
  }
}
