/* ===== Popup / Modal Component ===== */
/* Used by shared/_popup partial */
/* Uses design tokens from tokens.css */

.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
}

.popup-overlay.popup-hidden {
  display: none !important;
}

@media (min-width: 640px) {
  .popup-overlay {
    align-items: center;
  }
}

.popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: popupFadeIn 0.2s ease;
}

.popup-container {
  position: relative;
  width: 100%;
  max-width: 380px;
  padding: 0 var(--space-4) var(--space-4);
  padding-bottom: calc(var(--space-4) + var(--safe-bottom));
  animation: popupSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  .popup-container {
    padding: var(--space-6);
    animation: popupScaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
}

.popup-card {
  background: var(--paper-card, #fbf6ea);
  border: 1px solid var(--ink-line, #e2d5bd);
  border-radius: 20px;
  padding: 28px var(--space-6) var(--space-6);
  box-shadow: 0 24px 60px -16px rgba(45, 33, 20, 0.5);
  text-align: center;
  overflow: hidden;
}

.popup-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.popup-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(
    135deg,
    var(--brand-amber-50) 0%,
    var(--brand-amber-100) 100%
  );
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 12px rgba(217, 119, 6, 0.2),
    inset 0 -2px 4px rgba(217, 119, 6, 0.1);
  margin-bottom: var(--space-4);
}

.popup-icon img {
  border-radius: 50%;
}

.popup-decoration {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.popup-dot {
  width: 6px;
  height: 6px;
  background: var(--color-primary);
  border-radius: 50%;
}

.popup-line {
  width: 40px;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--color-primary),
    var(--brand-amber-300),
    var(--color-primary)
  );
  border-radius: 1px;
}

.popup-title {
  font-family: var(--font-display, Georgia, serif);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink, #2d2114);
  margin: 0 0 var(--space-3) 0;
}

.popup-message {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
}

.popup-message a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: var(--font-semibold);
  border-bottom: 1px solid var(--brand-amber-200);
  transition: border-color var(--transition-fast);
}

.popup-message a:hover {
  border-color: var(--color-primary);
}

.popup-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-4) var(--space-8);
  background: var(--color-primary);
  color: white;
  font-size: var(--text-md);
  font-weight: var(--font-bold);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    transform 0.1s;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.popup-button:hover {
  background: var(--brand-amber-700);
}

.popup-button:active {
  transform: scale(0.98);
}

.popup-footer {
  margin: var(--space-4) 0 0 0;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  font-style: italic;
  color: var(--text-muted);
}

@keyframes popupFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes popupSlideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popupScaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
