/* Global auth modal styles (shared with Deco Checkout) */
.deco-auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding: 20px;
  overflow-y: auto;
}

/* While redirecting/authenticating, keep action animation bright (no dim/blur) */
.deco-auth-overlay.is-redirecting,
.deco-auth-overlay.is-redirecting.is-login {
  background: rgba(255, 255, 255, 0.10);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.deco-auth-overlay.is-hidden {
  display: none;
}

/* keep notifications above the blur overlay without exposing the page header */
.swal2-container,
.swal2-container.swal2-toast {
  z-index: 2105 !important;
}

.deco-auth-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 420px;
  width: 100%;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  animation: decoAuthSlideIn 0.3s ease;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform: translateY(0);
}

/* Animate card to top when keyboard opens - move up by ~35% of viewport */
@media (max-width: 1024px) {
  .deco-auth-overlay.is-keyboard-open .deco-auth-card {
    transform: translateY(calc(-50vh + 50% + 30px));
  }
}

@keyframes decoAuthSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.deco-auth-card__header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 24px 8px;
}

.deco-auth-card__header i {
  font-size: 40px;
  color: #3b82f6;
}

.deco-auth-card__body {
  padding: 20px 24px 24px;
}

/* Inline auth (login/register) */
.deco-auth {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #e7e7e7;
  border-radius: 6px;
  background: #fff;
}

/* Inside floating card - no inner box needed */
.deco-auth-card .deco-auth {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

/* Logged-in: no extra inner box (we already are inside a card) */
.deco-auth[data-logged="1"] {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.deco-auth__tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.deco-auth__tab {
  border: 1px solid #d1d5db;
  background: #fff;
  padding: 8px 24px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.deco-auth__tab:hover {
  background: #f9fafb;
}

.deco-auth__tab.is-active {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.10);
}

.deco-auth__panel.is-hidden,
.deco-auth__reset.is-hidden {
  display: none;
}

.deco-auth__row {
  margin-bottom: 12px;
}

.deco-auth__label {
  display: block;
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 6px;
}

.deco-auth__forgot {
  margin: -4px 0 8px;
  text-align: right;
}

.deco-auth__forgot-link {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: #3b82f6;
  cursor: pointer;
}

.deco-auth__forgot-link:hover {
  color: #2563eb;
  text-decoration: underline;
}

.deco-auth__reset {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
}

.deco-auth__reset-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.deco-auth__reset-actions .btn {
  flex: 1;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.deco-auth__actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.deco-auth__actions .btn {
  flex: 1;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.deco-auth__actions .btn-primary,
.deco-auth__reset-actions .btn-primary {
  background: linear-gradient(135deg, #d4a574 0%, #c4956a 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(212, 165, 116, 0.3);
}

.deco-auth__actions .btn-primary:hover,
.deco-auth__reset-actions .btn-primary:hover {
  background: linear-gradient(135deg, #c4956a 0%, #b4855a 100%);
  box-shadow: 0 4px 12px rgba(212, 165, 116, 0.4);
  transform: translateY(-1px);
}

.deco-auth__actions .btn-secondary,
.deco-auth__reset-actions .btn-secondary {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}

.deco-auth__actions .btn-secondary:hover,
.deco-auth__reset-actions .btn-secondary:hover {
  background: #e5e7eb;
  color: #374151;
}

.deco-auth__panel.is-reset-open .deco-auth__actions,
.deco-auth__panel.is-reset-open .deco-auth__forgot {
  display: none;
}

/* Loading overlay when redirecting after cancel/login */
.deco-auth-overlay.is-redirecting .deco-auth-card {
  opacity: 0;
  transform: translateY(-20px) scale(0.95);
}
