/* ─── Auth / Login overlay ───────────────────────────────────────────────────── */

#auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary, #f8fafc);
  opacity: 0;
  transition: opacity 0.25s ease;
}

#auth-overlay.auth-visible { opacity: 1; }

#auth-overlay.auth-exit {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

/* Card */
.auth-card {
  width: 100%;
  max-width: 400px;
  margin: 1rem;
  padding: 2.5rem 2rem 2rem;
  background: var(--bg-card, #fff);
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  transform: translateY(12px);
  transition: transform 0.3s ease;
}

#auth-overlay.auth-visible .auth-card {
  transform: translateY(0);
}

/* Logo */
.auth-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--color-primary, #6366F1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.auth-logo svg {
  width: 34px;
  height: 34px;
  stroke: #fff;
}

/* Headings */
.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary, #64748b);
  text-align: center;
  margin: 0 0 1.75rem;
}

/* Form */
#auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.auth-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrap input {
  width: 100%;
  padding: 0.75rem 2.8rem 0.75rem 1rem;
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  font-size: 1rem;
  background: var(--bg-primary, #f8fafc);
  color: var(--text-primary, #1e293b);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.auth-input-wrap input:focus {
  border-color: var(--color-primary, #6366F1);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
  background: var(--bg-card, #fff);
}

.auth-eye {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  color: var(--text-muted, #94a3b8);
  transition: color 0.15s;
}
.auth-eye:hover { color: var(--text-secondary, #64748b); }
.auth-eye svg { width: 18px; height: 18px; }

/* Error */
.auth-error {
  font-size: 0.85rem;
  color: #ef4444;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  text-align: center;
}

@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.auth-shake { animation: authShake 0.35s ease; }

/* Submit button */
.auth-submit {
  width: 100%;
  padding: 0.85rem;
  background: var(--color-primary, #6366F1);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.15s, transform 0.1s;
}
.auth-submit:hover  { background: #4f46e5; }
.auth-submit:active { transform: scale(0.98); }

/* Spinner */
.auth-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: authSpin 0.7s linear infinite;
}
@keyframes authSpin { to { transform: rotate(360deg); } }

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
  color: var(--text-muted, #94a3b8);
  font-size: 0.78rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color, #e2e8f0);
}

/* Import button */
.auth-import-btn {
  width: 100%;
  padding: 0.75rem;
  background: transparent;
  color: var(--text-secondary, #64748b);
  border: 1.5px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.auth-import-btn:hover {
  background: var(--bg-hover, #f1f5f9);
  border-color: var(--color-primary, #6366F1);
  color: var(--color-primary, #6366F1);
}

/* Hint */
.auth-hint {
  font-size: 0.78rem;
  color: var(--text-muted, #94a3b8);
  text-align: center;
  margin-top: 1.25rem;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  #auth-overlay { background: var(--bg-primary, #0f172a); }
  .auth-card    { background: var(--bg-card, #1e293b); box-shadow: 0 8px 40px rgba(0,0,0,.4); }
  .auth-input-wrap input { background: var(--bg-primary, #0f172a); color: var(--text-primary, #f1f5f9); }
  .auth-input-wrap input:focus { background: var(--bg-primary, #0f172a); }
}

/* Phone */
@media (max-width: 480px) {
  .auth-card { padding: 2rem 1.25rem 1.5rem; border-radius: 16px; }
  .auth-logo { width: 52px; height: 52px; }
}
