/* =============================================================
   MY RECEIPT ASSISTANT – AUTH CSS
   Sign-in / Register pages
   ============================================================= */

/* ── Auth Page Layout ──────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
}

/* Background decorative blobs */
.auth-page::before {
  content: '';
  position: absolute;
  top: -180px;
  right: -180px;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(232, 119, 34, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.auth-page::after {
  content: '';
  position: absolute;
  bottom: -200px;
  left: -150px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(13, 71, 161, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* ── Auth Card Wrapper ─────────────────────────────────────── */
.auth-wrapper {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  position: relative;
  z-index: 1;
}

/* ── Auth Card ─────────────────────────────────────────────── */
.auth-card {
  width: 100%;
  background: var(--color-card);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl) var(--space-xl);
  box-shadow: var(--shadow-xl);
  position: relative;
  animation: authCardFadeIn 0.5s ease forwards;
}

@keyframes authCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Auth Back Button (Outside Card) ────────────────────────── */
.auth-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.auth-back-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateX(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.auth-back-btn svg {
  width: 15px;
  height: 15px;
  transition: transform 0.2s ease;
}

.auth-back-btn:hover svg {
  transform: translateX(-3px);
}

/* ── Auth Brand Header ─────────────────────────────────────── */
.auth-brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.auth-brand-logo {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(232, 119, 34, 0.25);
}

.auth-brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.auth-brand-name {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text-dark);
  line-height: 1.2;
  white-space: nowrap;
}

.auth-brand-subtitle {
  font-size: var(--font-size-xs, 12px);
  color: var(--color-text-muted, #64748b);
  margin-top: 3px;
  font-weight: 500;
}

/* ── Auth Tab Switcher ─────────────────────────────────────── */
.auth-tabs {
  display: flex;
  background: var(--color-card-inner);
  border-radius: var(--radius-full);
  padding: 4px;
  margin-bottom: var(--space-xl);
  border: 1px solid var(--color-border);
}

.auth-tab-btn {
  flex: 1;
  padding: 9px var(--space-md);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  transition: background var(--transition-base), color var(--transition-base), box-shadow var(--transition-base);
  text-align: center;
}

.auth-tab-btn.active {
  background: var(--color-card);
  color: var(--color-text-dark);
  box-shadow: var(--shadow-sm);
}

.auth-tab-btn:hover:not(.active) {
  color: var(--color-text-body);
  background: rgba(0, 0, 0, 0.03);
}

/* ── Auth Form ─────────────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.auth-form-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.auth-forgot {
  text-align: right;
}

.auth-forgot-link {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-dark);
  transition: color var(--transition-fast);
}

.auth-forgot-link:hover {
  color: var(--color-primary);
}

/* ── Tab Panels ────────────────────────────────────────────── */
.auth-panel {
  display: none;
}

.auth-panel.active {
  display: block;
}

/* ── Forgot Password Overlay ───────────────────────────────── */
.auth-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.auth-overlay.open {
  display: flex;
}

.auth-overlay-card {
  width: 100%;
  max-width: 400px;
  background: var(--color-card);
  border-radius: var(--radius-xl);
  padding: var(--space-xl) var(--space-xl);
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.3s ease forwards;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.auth-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xs);
}

.auth-overlay-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-text-dark);
}

.auth-overlay-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.auth-overlay-close:hover {
  background: var(--color-surface);
  color: var(--color-text-dark);
}

.auth-overlay-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-xl);
  line-height: 1.5;
}

/* ── Toast Notification ────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  background: var(--color-text-dark);
  color: white;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background: var(--color-success);
}

.toast.error {
  background: var(--color-danger);
}