/* Auth pages — sign in / sign up */

.auth-page {
  overflow-x: hidden;
}

.auth-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.auth-layout {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 1.25rem 1.5rem;
  max-width: 80rem;
  margin: 0 auto;
  width: 100%;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}

.auth-logo__picture {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

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

.auth-logo__name {
  max-width: 260px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

@media (max-width: 520px) {
  .auth-header { padding-inline: 1rem; }
  .auth-logo { gap: 0.55rem; }
  .auth-logo .brand-logo { height: 34px; max-width: 105px; }
  .auth-logo__name { max-width: 150px; font-size: 0.82rem; }
}

.auth-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem 3rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 2.5rem 2rem;
  border-radius: 1.25rem;
  border: 1px solid var(--border);
  background: var(--ticker-bg);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  transition: background 0.35s ease, border-color 0.35s ease;
}

.auth-card--wide {
  max-width: 46rem;
}

.auth-form__section {
  padding-top: 0.25rem;
}

.auth-form__section-title {
  margin-bottom: 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-overline);
}

[data-theme="light"] .auth-card {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.08);
}

.auth-card__header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-icon {
  width: 3.25rem;
  height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.1rem;
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 1rem;
  color: #a78bfa;
  background: linear-gradient(145deg, rgba(124, 58, 237, 0.2), rgba(59, 130, 246, 0.08));
  box-shadow: 0 12px 32px rgba(76, 29, 149, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .auth-icon {
  color: #6d28d9;
  background: linear-gradient(145deg, rgba(124, 58, 237, 0.12), rgba(59, 130, 246, 0.06));
}

.auth-overline {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-overline);
  margin-bottom: 0.75rem;
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.auth-subtitle {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
}

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

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

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

.auth-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.auth-input-wrap {
  position: relative;
}

.auth-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--btn-secondary-bg);
  border: 1px solid var(--border-strong);
  border-radius: 0.5rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-input-wrap .auth-input {
  padding-right: 2.75rem;
}

.auth-input-wrap--actions .auth-input {
  padding-right: 5.25rem;
}

.auth-input-wrap--leading .auth-input {
  padding-right: 1rem;
  padding-left: 2.75rem;
}

.auth-input-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--text-subtle);
  pointer-events: none;
}

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

.auth-input:focus {
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.auth-input.auth-input--error {
  border-color: #f87171;
}

.auth-input.auth-input--error:focus {
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2);
}

.auth-field-error {
  font-size: 0.75rem;
  color: #f87171;
  margin-top: -0.25rem;
}

.auth-toggle-pw {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.25rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-toggle-pw:hover {
  color: var(--text);
}

.auth-generate-pw {
  position: absolute;
  right: 3rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.25rem 0.65rem 0.25rem 0.25rem;
  border: 0;
  border-right: 1px solid var(--border-strong);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-generate-pw:hover {
  color: var(--text);
}

.auth-generate-pw--success {
  color: #34d399;
}

.auth-password-generated {
  min-height: 1rem;
  font-size: 0.72rem;
  line-height: 1.35;
  color: #34d399;
}

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

.auth-checkbox input {
  margin-top: 0.2rem;
  accent-color: #7c3aed;
  flex-shrink: 0;
}

.auth-checkbox a.auth-link {
  font-weight: 600;
}

.auth-submit {
  width: 100%;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 0.25rem;
}

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  padding: 0.8rem 0.9rem;
  border-radius: 0.65rem;
  font-size: 0.8rem;
  line-height: 1.5;
}

.auth-alert svg { flex: 0 0 auto; margin-top: 0.08rem; }
.auth-alert strong { display: block; font-weight: 600; }
.auth-alert--success { color: #34d399; border: 1px solid rgba(52, 211, 153, 0.25); background: rgba(52, 211, 153, 0.08); }
.auth-alert--warning { color: #fcd34d; border: 1px solid rgba(251, 191, 36, 0.25); background: rgba(251, 191, 36, 0.08); }
.auth-alert--error { color: #f87171; border: 1px solid rgba(248, 113, 113, 0.25); background: rgba(248, 113, 113, 0.08); }

[data-theme="light"] .auth-alert--warning { color: #a16207; }

.auth-password-hint {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: -0.25rem;
  color: var(--text-subtle);
  font-size: 0.72rem;
  line-height: 1.45;
}

.auth-password-hint span {
  width: 0.4rem;
  height: 0.4rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.55);
}

.auth-security-note,
.auth-help-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 1.25rem;
  color: var(--text-subtle);
  font-size: 0.7rem;
  line-height: 1.5;
  text-align: center;
}

.auth-security-note svg { flex: 0 0 auto; }

.auth-account-email {
  margin-top: 0.5rem;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
}

.auth-info-panel {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.035);
}

[data-theme="light"] .auth-info-panel { background: rgba(15, 23, 42, 0.025); }
.auth-info-panel__icon { width: 2.25rem; height: 2.25rem; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; border-radius: 0.55rem; color: #c4b5fd; background: rgba(139, 92, 246, 0.12); }
.auth-info-panel__title { color: var(--text); font-size: 0.875rem; font-weight: 600; }
.auth-info-panel__text { margin-top: 0.25rem; color: var(--text-muted); font-size: 0.75rem; line-height: 1.55; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.75rem 0;
  color: var(--text-subtle);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

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

.auth-social__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  background: var(--btn-secondary-bg);
  border: 1px solid var(--border-strong);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.auth-social__btn:hover {
  background: var(--btn-secondary-bg-hover);
}

.auth-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

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

.auth-link--sm {
  font-size: 0.75rem;
  font-weight: 500;
}

.auth-link--muted {
  color: var(--text-muted);
  font-weight: 500;
}

.auth-switch {
  text-align: center;
  margin-top: 1.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.auth-back {
  margin-top: 1.5rem;
  text-align: center;
}

a.sign-in-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 2rem 1.25rem;
  }

  .auth-title {
    font-size: 1.5rem;
  }
}
