/* ══════════════════════════════════════════════════
   Auth-Popup — Globale Guest-Action-Blocker Komponente
   Erscheint wenn ein nicht-eingeloggter User eine
   geschützte Aktion versucht.
   ══════════════════════════════════════════════════ */

.auth-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.auth-popup-overlay.auth-popup-visible {
  opacity: 1;
  visibility: visible;
}

.auth-popup-card {
  background: linear-gradient(145deg, #1a1a2e 0%, #16162a 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 2.5rem 2rem 2rem;
  max-width: 420px;
  width: 92vw;
  text-align: center;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04);
  transform: translateY(20px) scale(0.96);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.auth-popup-visible .auth-popup-card {
  transform: translateY(0) scale(1);
}

.auth-popup-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.auth-popup-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.auth-popup-icon {
  font-size: 2.6rem;
  margin-bottom: 1rem;
  display: block;
}

.auth-popup-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.6rem;
  letter-spacing: -0.01em;
}

.auth-popup-text {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.55;
  margin: 0 0 1.6rem;
}
.auth-popup-text strong {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.auth-popup-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.auth-popup-btn {
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: none;
}
.auth-popup-btn:hover {
  transform: translateY(-1px);
}

.auth-popup-btn-login {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.auth-popup-btn-login:hover {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.auth-popup-btn-register {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  color: #fff;
}
.auth-popup-btn-register:hover {
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}

.auth-popup-dismiss {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 12px;
  transition: color 0.2s;
}
.auth-popup-dismiss:hover {
  color: rgba(255, 255, 255, 0.6);
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .auth-popup-card {
    padding: 2rem 1.4rem 1.6rem;
  }
  .auth-popup-actions {
    flex-direction: column;
  }
  .auth-popup-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ══════════════════════════════════════════════════
   Auth Form Modal — Stripe-style inline auth form
   Uses an iframe to embed the full login/register page
   ══════════════════════════════════════════════════ */

.auth-form-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}
.auth-form-modal-overlay.auth-form-modal-visible {
  opacity: 1;
  visibility: visible;
}

.auth-form-modal-card {
  position: relative;
  width: min(96vw, 580px);
  max-width: 580px;
  height: min(800px, 94vh);
  background: #0a0a12;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  overflow: hidden;
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 60px rgba(99, 102, 241, 0.1);
  transform: translateY(28px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
}
.auth-form-modal-visible .auth-form-modal-card {
  transform: translateY(0) scale(1);
}

.auth-form-modal-header {
  display: flex;
  align-items: stretch;
  background: rgba(10, 10, 18, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.auth-form-modal-tabs {
  display: flex;
  flex: 1;
}

.auth-form-modal-tab {
  flex: 1;
  padding: 15px 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  font-family: inherit;
  letter-spacing: -0.01em;
}
.auth-form-modal-tab:hover {
  color: rgba(255, 255, 255, 0.75);
}
.auth-form-modal-tab.active {
  color: #fff;
  border-bottom-color: var(--primary, #6366f1);
}

.auth-form-modal-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.55);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto 12px auto 8px;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}
.auth-form-modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.auth-form-modal-iframe {
  width: 100%;
  flex: 1;
  min-height: 0;
  border: none;
  display: block;
  background: #0a0a12;
}

/* ── Popup-mode: hide chrome inside the iframe ── */
.popup-mode .back-link,
.popup-mode .theme-toggle,
.popup-mode .auth-lang-switch {
  display: none !important;
}
.popup-mode.auth-page {
  min-height: unset;
}
.popup-mode.auth-page > main {
  padding-top: clamp(12px, 2vw, 20px);
  padding-bottom: clamp(12px, 2vw, 20px);
  min-height: unset;
  justify-content: flex-start;
  overflow-y: auto;
}
.popup-mode .bg-glow {
  opacity: 0.18;
}
/* Compact auth card in popup */
.popup-mode .auth-card {
  padding: 1.5rem 1.75rem;
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
  box-shadow: none;
  border: none;
  background: transparent;
}
.popup-mode .auth-card::before {
  display: none;
}
.popup-mode .auth-header {
  margin-bottom: 1rem;
}
.popup-mode .auth-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.popup-mode .auth-title {
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
}
.popup-mode .auth-subtitle {
  font-size: 0.875rem;
}
.popup-mode .hub-info-banner {
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 0.8rem;
}
.popup-mode .form-group {
  margin-bottom: 0.75rem;
}
.popup-mode .form-input {
  padding: 10px 14px;
}
.popup-mode .btn-primary {
  padding: 11px 20px;
}
.popup-mode .auth-divider {
  margin: 0.75rem 0;
}
.popup-mode .auth-footer {
  margin-top: 0.75rem;
  font-size: 0.875rem;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .auth-form-modal-card {
    height: 96vh;
    border-radius: 20px 20px 0 0;
    align-self: flex-end;
    width: 100vw;
    max-width: 100vw;
  }
  .auth-form-modal-overlay {
    align-items: flex-end;
  }
  .popup-mode .auth-card {
    padding: 1.25rem 1.25rem;
  }
  .popup-mode .form-row {
    flex-direction: column;
    gap: 0;
  }
}
