/* Auth pages (login, activate) */
.auth-page {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-5);
  overflow: hidden;
  background: #0b1220;
}

.auth-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(23, 75, 204, 0.16), transparent 38%),
    radial-gradient(circle at 85% 80%, rgba(15, 23, 42, 0.6), transparent 45%);
}

.auth-grid-overlay {
  position: absolute;
  inset: 0;
  opacity: 0.25;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

.auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  width: 100%;
  max-width: 860px;
  min-height: 480px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-lg);
}

.auth-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-8) var(--space-6);
  color: #f8fafc;
  background: linear-gradient(180deg, #121b2c 0%, #0f1623 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-brand-badge {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: var(--space-5);
  border-radius: var(--radius-sm);
  color: #dbeafe;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-brand-badge svg {
  width: 22px;
  height: 22px;
}

.auth-brand h1 {
  margin-bottom: var(--space-2);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.auth-brand > p {
  max-width: 300px;
  color: #98a2b3;
  font-size: 0.875rem;
  line-height: 1.55;
}

.auth-features {
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-2);
}

.auth-features li {
  position: relative;
  padding-left: 14px;
  color: #c5ceda;
  font-size: 0.8125rem;
}

.auth-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #5b8def;
}

.auth-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-8) var(--space-8) var(--space-6);
  background: var(--color-surface);
}

.auth-card--standalone {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
}

.auth-card-header {
  margin-bottom: var(--space-5);
  max-width: 340px;
}

.auth-eyebrow {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.auth-card-header h2,
.auth-card-header h1 {
  margin-bottom: 6px;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.auth-card-header p {
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: var(--space-4);
  max-width: 340px;
}

.auth-field {
  display: grid;
  gap: 6px;
}

.auth-field__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.auth-field__required {
  margin-left: 2px;
  color: var(--color-danger-text);
}

.input-group {
  position: relative;
}

.input-group__icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  color: var(--color-text-muted);
  pointer-events: none;
}

.input-group__icon svg {
  width: 16px;
  height: 16px;
}

.input-group__control {
  width: 100%;
  max-width: 100%;
}

.input-group__control--with-icon {
  padding-left: 34px;
}

.auth-error {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--color-danger-soft);
  border: 1px solid var(--color-danger-border);
  color: var(--color-danger-text);
  font-size: 0.8125rem;
}

.auth-error svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.auth-submit {
  width: auto;
  min-width: 120px;
  align-self: flex-start;
  margin-top: var(--space-2);
  padding: 9px 24px;
}

.auth-hint {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
  max-width: 340px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.auth-hint code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--color-surface-muted);
  color: var(--color-text-secondary);
  font-size: 0.6875rem;
}

.auth-state {
  display: grid;
  gap: var(--space-3);
  font-size: 0.875rem;
}

.auth-state--error {
  color: var(--color-danger-text);
}

.auth-state--success {
  color: var(--color-success-text);
}

.auth-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 860px) {
  .auth-shell {
    grid-template-columns: 1fr;
    max-width: 420px;
    min-height: auto;
  }

  .auth-brand {
    display: none;
  }

  .auth-card {
    padding: var(--space-6);
  }

  .auth-form,
  .auth-card-header,
  .auth-hint {
    max-width: 100%;
  }
}
