/* ===========================================
   Auth Pages — Login & Signup — Violet Theme
   =========================================== */

/* ── Full-page layout ── */
.auth-page {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-deep);
  background-image:
    radial-gradient(circle, rgba(155, 138, 245, .07) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: 12px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 0;
}

/* Ambient violet glow behind card */
.auth-page::before {
  content: '';
  position: absolute;
  top: 30%;
  left: 50%;
  translate: -50% -50%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(155, 138, 245, .08) 0%, transparent 65%);
  pointer-events: none;
}

/* Secondary gold glow */
.auth-page::after {
  content: '';
  position: absolute;
  bottom: 10%;
  right: 15%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(232, 200, 64, .04) 0%, transparent 60%);
  pointer-events: none;
}

/* ── Card ── */
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: auto;
  padding: 32px 36px 28px;
  background: linear-gradient(135deg, rgba(17, 21, 32, .85) 0%, rgba(13, 16, 23, .95) 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow:
    0 0 0 1px rgba(155, 138, 245, .06),
    0 8px 32px rgba(0, 0, 0, .5),
    0 2px 8px rgba(0, 0, 0, .3);
  animation: auth-card-in .5s cubic-bezier(.22, 1, .36, 1) forwards;
  opacity: 0;
}

@keyframes auth-card-in {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Branding ── */
.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.auth-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 0 20px rgba(155, 138, 245, .15), 0 4px 12px rgba(0, 0, 0, .4);
  border: 1px solid rgba(155, 138, 245, .15);
}

.auth-brand-name {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 24px;
  color: var(--gold);
  letter-spacing: -0.5px;
}

.auth-brand-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: -4px;
}

/* ── Page title ── */
.auth-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 20px;
}

/* ── Form ── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.auth-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.auth-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

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

.auth-input:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
}

.auth-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(155, 138, 245, .12), 0 0 16px rgba(155, 138, 245, .06);
  background: var(--bg-card-hover);
}

/* ── Password field with toggle ── */
.auth-password-wrap {
  position: relative;
}

.auth-password-wrap .auth-input {
  padding-right: 44px;
}

.auth-password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  translate: 0 -50%;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.auth-password-toggle:hover {
  color: var(--text-secondary);
  background: rgba(155, 138, 245, .08);
}

/* ── Row helpers ── */
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.auth-check-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-glow);
  border-radius: 4px;
  background: var(--bg-elevated);
  cursor: pointer;
  position: relative;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  flex-shrink: 0;
}

.auth-check-label input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.auth-check-label input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4.5px;
  top: 1.5px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  rotate: 45deg;
}

.auth-forgot {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.auth-forgot:hover {
  color: #b8a8ff;
}

/* ── Submit button ── */
.auth-submit {
  width: 100%;
  padding: 11px 0;
  margin-top: 2px;
  background: linear-gradient(135deg, var(--accent) 0%, #7b6ad8 100%);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .1s ease, box-shadow var(--transition-fast);
  box-shadow: 0 2px 10px rgba(155, 138, 245, .25), 0 0 24px rgba(155, 138, 245, .08);
}

.auth-submit:hover {
  box-shadow: 0 4px 20px rgba(155, 138, 245, .35), 0 0 40px rgba(155, 138, 245, .12);
}

.auth-submit:active {
  transform: scale(.98);
}

/* Shimmer effect */
.auth-submit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .12) 50%, transparent 60%);
  translate: -100% 0;
  transition: translate .6s ease;
}

.auth-submit:hover::after {
  translate: 100% 0;
}

/* ── Divider ── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 2px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--border) 40%, var(--border) 60%, transparent 100%);
}

.auth-divider span {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  flex-shrink: 0;
}

/* ── Social / OAuth buttons ── */
.auth-social-row {
  display: flex;
  gap: 12px;
}

.auth-social-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-social-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}

.auth-social-btn:active {
  transform: scale(.98);
}

.auth-social-btn svg {
  flex-shrink: 0;
}

/* ── Footer link ── */
.auth-footer {
  text-align: center;
  margin-top: 18px;
  font-size: 14px;
  color: var(--text-muted);
}

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

.auth-footer a:hover {
  color: #b8a8ff;
}

/* ── Error message (for future backend integration) ── */
.auth-error {
  display: none;
  padding: 10px 14px;
  background: var(--red-dim);
  border: 1px solid rgba(245, 82, 82, .2);
  border-radius: 8px;
  color: var(--red);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.auth-error.visible {
  display: block;
}

/* ── Success message (for future backend integration) ── */
.auth-success {
  display: none;
  padding: 10px 14px;
  background: var(--sweet-bg);
  border: 1px solid rgba(34, 197, 94, .2);
  border-radius: 8px;
  color: var(--sweet);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

.auth-success.visible {
  display: block;
}

/* ── Mobile responsive ── */
@media (max-width: 480px) {
  .auth-card {
    margin: 16px;
    padding: 28px 24px 24px;
    border-radius: 16px;
  }

  .auth-social-row {
    flex-direction: column;
  }
}
