/* Base styles, design tokens and toasts. */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Palette */
  --bg-page: #faf8f5;
  --bg-surface: #ffffff;
  --bg-subtle: #f4efe9;
  --bg-input: #ffffff;

  --border-light: #e8e2d8;
  --border-subtle: #f0ebe3;
  --border-focus: #c4b5fd;

  --text-primary: #2d3748;
  --text-secondary: #5a6578;
  --text-muted: #8c97a8;

  --accent-pastel: #7c3aed;
  --accent-pastel-hover: #6d28d9;
  --accent-soft: rgba(124, 58, 237, 0.08);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  --shadow-subtle: 0 4px 16px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 10px 32px rgba(60, 40, 20, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
  --shadow-elevated: 0 14px 40px rgba(60, 40, 20, 0.08);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(at 15% 15%, rgba(253, 242, 248, 0.8) 0px, transparent 50%),
    radial-gradient(at 85% 85%, rgba(238, 242, 255, 0.8) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(254, 243, 199, 0.3) 0px, transparent 50%);
  background-attachment: fixed;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Recipient view: the card only, centered */
.app-viewer-mode {
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
}

.viewer-standalone-stage {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Landing page and password prompt */
.app-fallback-mode {
  justify-content: center;
  align-items: center;
  padding: 2rem 1.5rem;
}

/* Creator */
.app-creator-mode {
  padding: 0 0 3rem 0;
}

/* Utilities */
.font-mono {
  font-family: var(--font-mono) !important;
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 10000;
  pointer-events: none;
}

.toast-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: #ffffff;
  color: var(--text-primary);
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  font-size: 0.875rem;
  font-weight: 500;
  transform: translateY(15px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.toast-item.visible {
  transform: translateY(0);
  opacity: 1;
}

.toast-item.toast-success {
  border-left: 4px solid #10b981;
}

.toast-item.toast-error {
  border-left: 4px solid #ef4444;
}
