/* JARS Santa — Clean, warm stationery design system */

:root {
  --bg-page: #FAF7F2;
  --bg-card: #FFFFFF;
  --bg-muted: #F3EFEA;
  --bg-input: #FFFFFF;
  --border: #E8E2D8;
  --border-focus: #2F4A3A;
  
  --ink-primary: #1C1917;
  --ink-secondary: #66615B;
  --ink-tertiary: #99938B;
  
  /* Accent: Pine Green */
  --pine: #2F4A3A;
  --pine-hover: #243B2E;
  --pine-light: #EBF1ED;
  --pine-border: #C8D8CE;
  
  /* Status / Accents */
  --berry: #9E2A2B;
  --berry-light: #FBEAEA;
  --gold: #B8860B;
  --gold-light: #FEF9E7;
  
  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.04);
  --shadow-md: 0 4px 12px rgba(28, 25, 23, 0.06), 0 1px 3px rgba(28, 25, 23, 0.04);
  --shadow-lg: 0 12px 32px rgba(28, 25, 23, 0.08), 0 2px 6px rgba(28, 25, 23, 0.04);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --font-serif: 'Fraunces', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition: 180ms ease-out;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-page: #151311;
    --bg-card: #1E1A17;
    --bg-muted: #282420;
    --bg-input: #1A1715;
    --border: #332D28;
    --border-focus: #528065;
    
    --ink-primary: #F5F2EB;
    --ink-secondary: #ADA69C;
    --ink-tertiary: #736C63;
    
    --pine: #3E664F;
    --pine-hover: #4B7A5F;
    --pine-light: #1D2D23;
    --pine-border: #2C4837;
    
    --berry: #D45B5D;
    --berry-light: #331A1B;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.35);
  }
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--ink-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, .font-serif {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--ink-primary);
  letter-spacing: -0.015em;
}

h1 { font-size: 2rem; line-height: 1.25; }
h2 { font-size: 1.5rem; line-height: 1.3; }
h3 { font-size: 1.2rem; line-height: 1.35; }

p, .text-body {
  color: var(--ink-secondary);
  font-size: 0.95rem;
}

.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--ink-tertiary); }
.text-pine { color: var(--pine); }

/* Layout & Containers */
.container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}
.container-wide {
  max-width: 900px;
}

/* Header */
.app-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 50;
}
.app-header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--pine);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Cards & Surfaces */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}
.card-header {
  margin-bottom: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.925rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  user-select: none;
}
.btn-primary {
  background: var(--pine);
  color: #FFFFFF;
}
.btn-primary:hover {
  background: var(--pine-hover);
}
.btn-secondary {
  background: var(--bg-muted);
  color: var(--ink-primary);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--border);
}
.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--ink-secondary);
}
.btn-outline:hover {
  border-color: var(--pine);
  color: var(--pine);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-secondary);
  padding: 0.4rem 0.75rem;
}
.btn-ghost:hover {
  color: var(--ink-primary);
  background: var(--bg-muted);
}
.btn-danger {
  background: transparent;
  color: var(--berry);
  border-color: var(--border);
}
.btn-danger:hover {
  background: var(--berry-light);
  border-color: var(--berry);
}
.btn-sm {
  font-size: 0.825rem;
  padding: 0.4rem 0.75rem;
}
.btn-lg {
  font-size: 1.05rem;
  padding: 0.85rem 1.6rem;
}
.btn-block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Badges & Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pill-pine {
  background: var(--pine-light);
  color: var(--pine);
  border: 1px solid var(--pine-border);
}
.pill-gold {
  background: var(--gold-light);
  color: var(--gold);
  border: 1px solid #E6D8A8;
}
.pill-muted {
  background: var(--bg-muted);
  color: var(--ink-secondary);
  border: 1px solid var(--border);
}
.pill-berry {
  background: var(--berry-light);
  color: var(--berry);
}

/* Countdown Display */
.countdown-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.countdown-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.65rem;
  min-width: 58px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.countdown-num {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--pine);
  line-height: 1.1;
  display: block;
}
.countdown-lbl {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-tertiary);
  font-weight: 600;
  display: block;
  margin-top: 0.15rem;
}
.countdown-sep {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink-tertiary);
  margin-top: -0.4rem;
}

/* Inputs & Form Elements */
.form-group {
  margin-bottom: 1.15rem;
}
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--ink-primary);
}
.form-hint {
  font-size: 0.8rem;
  color: var(--ink-tertiary);
  margin-top: 0.25rem;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--ink-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
}
.form-textarea {
  min-height: 85px;
  resize: vertical;
}

/* Checklist widget */
.checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  font-size: 0.925rem;
}
.checklist-item.done {
  background: var(--pine-light);
  border-color: var(--pine-border);
  color: var(--pine);
}
.checklist-item.current {
  background: var(--bg-card);
  border-color: var(--border-focus);
  font-weight: 500;
}
.checklist-icon {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  background: var(--border);
  color: var(--ink-secondary);
}
.done .checklist-icon {
  background: var(--pine);
  color: #FFFFFF;
}

/* Wax-seal / Gift Tag Reveal Card */
.wax-tag-card {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: radial-gradient(circle at 50% 30%, var(--bg-card) 0%, var(--bg-muted) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.seal-stamp {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem;
  border-radius: var(--radius-full);
  background: var(--pine);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(47, 74, 58, 0.3);
  cursor: pointer;
  transition: transform 200ms ease;
}
.seal-stamp:hover {
  transform: scale(1.06);
}

/* Tabs */
.tab-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.tab-btn {
  padding: 0.65rem 1rem;
  font-weight: 500;
  font-size: 0.925rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--ink-secondary);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.tab-btn.active {
  color: var(--pine);
  border-bottom-color: var(--pine);
  font-weight: 600;
}
.tab-badge {
  background: var(--berry);
  color: white;
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  font-weight: 700;
}

/* Wishlist Item Card */
.wish-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  margin-bottom: 0.75rem;
  align-items: flex-start;
  transition: border-color var(--transition);
}
.wish-item.claimed {
  opacity: 0.65;
  background: var(--bg-muted);
}
.wish-img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.wish-body {
  flex: 1;
  min-width: 0;
}
.wish-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-primary);
  text-decoration: none;
  display: block;
}
.wish-title:hover {
  color: var(--pine);
}
.wish-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.25rem;
  font-size: 0.85rem;
}
.wish-price {
  font-weight: 600;
  color: var(--pine);
}
.wish-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

/* Chat thread */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 480px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  overflow: hidden;
}
.chat-messages {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.chat-bubble {
  max-width: 75%;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-md);
  font-size: 0.925rem;
  line-height: 1.45;
  word-break: break-word;
}
.chat-bubble.mine {
  align-self: flex-end;
  background: var(--pine);
  color: #FFFFFF;
  border-bottom-right-radius: 2px;
}
.chat-bubble.theirs {
  align-self: flex-start;
  background: var(--bg-muted);
  color: var(--ink-primary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 2px;
}
.chat-meta {
  font-size: 0.7rem;
  margin-top: 0.2rem;
  opacity: 0.75;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.chat-input-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem;
  border-top: 1px solid var(--border);
  background: var(--bg-page);
}
.typing-indicator {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--ink-tertiary);
  padding: 0 1.25rem 0.5rem;
}

/* Modals & Toast */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 23, 0.45);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}
.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
}
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--ink-primary);
  color: #FFFFFF;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  box-shadow: var(--shadow-md);
  z-index: 200;
  opacity: 0;
  transform: translateY(10px);
  transition: all var(--transition);
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Utility classes */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.text-center { text-align: center; }
