/* Wedding Website - Elegant & Romantic Theme */

/* ============================================
   FONTS
   ============================================ */
@import url("https://fonts.googleapis.com/css2?family=Great+Vibes&family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600&family=Montserrat:wght@300;400;500;600&display=swap");

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */
:root {
  /* Wedding Color Palette - Soft Romantic */
  --color-gold: #d4aaae;
  --color-gold-light: #e4c3c6;
  --color-gold-dark: #a5717b;
  --color-cream: #faf7f7;
  --color-cream-dark: #f5f0f0;
  --color-blush: #e8d5d0;
  --color-rose: #d4a5a5;
  --color-sage: #9caa97;
  --color-sage-dark: #7a8f74;
  --color-charcoal: #3a3a3a;
  --color-warm-gray: #6b6358;
  --color-light-gray: #a09890;

  /* Semantic Colors */
  --color-primary: var(--color-gold);
  --color-primary-dark: var(--color-gold-dark);
  --color-bg: var(--color-cream);
  --color-bg-card: #ffffff;
  --color-text: var(--color-charcoal);
  --color-text-light: var(--color-warm-gray);
  --color-border: var(--color-gold-light);
  --color-success: var(--color-sage-dark);
  --color-danger: #c97171;
  --color-warning: var(--color-gold);

  /* Admin Colors */
  --color-admin-sidebar: #2c2a27;

  /* Typography */
  --font-display: "Lora", Georgia, serif;
  --font-body: "Montserrat", -apple-system, BlinkMacSystemFont, sans-serif;

  /* Letter/Stationery Colors */
  --color-paper: #fffefb;
  --color-paper-aged: #f9f6f5;
  --color-ink: #4a4a4a;
  --color-ink-light: #6b6b6b;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(60, 50, 40, 0.06);
  --shadow-md: 0 4px 20px rgba(60, 50, 40, 0.1);
  --shadow-lg: 0 8px 40px rgba(60, 50, 40, 0.12);
  --shadow-gold: 0 4px 20px rgba(212, 170, 174, 0.3);
  --shadow-letter:
    0 1px 1px rgba(0, 0, 0, 0.03), 0 2px 4px rgba(0, 0, 0, 0.04),
    0 8px 16px rgba(0, 0, 0, 0.06), 0 16px 32px rgba(0, 0, 0, 0.04);

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   CSS RESET & BASE
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.3;
  color: var(--color-charcoal);
}

h1 {
  font-size: 2.75rem;
  letter-spacing: 0.02em;
}
h2 {
  font-size: 2rem;
  letter-spacing: 0.01em;
}
h3 {
  font-size: 1.5rem;
}

p {
  margin-bottom: 1rem;
}

/* ============================================
   LINKS & BUTTONS
   ============================================ */
a {
  color: var(--color-gold-dark);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-gold);
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all var(--transition-smooth);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--color-gold) 0%,
    var(--color-gold-dark) 100%
  );
  color: white;
  box-shadow: var(--shadow-gold);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(212, 170, 174, 0.35);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-gold-dark);
  border-color: var(--color-gold);
}

.btn-secondary:hover {
  background-color: var(--color-gold);
  color: white;
}

.btn-danger {
  background-color: var(--color-danger);
  color: white;
}

.btn-danger:hover {
  background-color: #b55e5e;
}

.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.75rem;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--color-text);
  letter-spacing: 0.02em;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
  background-color: white;
  transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(212, 170, 174, 0.15);
}

.form-group textarea {
  min-height: 160px;
  resize: vertical;
}

.form-group small {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--color-light-gray);
}

/* File Input */
.file-input {
  display: none;
}

/* Image Upload */
.image-upload-container {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.image-preview {
  width: 200px;
  height: 150px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-cream-dark);
  border: 2px dashed var(--color-border);
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-light-gray);
  font-size: 0.875rem;
}

.image-upload-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.upload-status {
  font-size: 0.8125rem;
  font-weight: 500;
}

.upload-status.uploading {
  color: var(--color-gold);
}
.upload-status.success {
  color: var(--color-success);
}
.upload-status.error {
  color: var(--color-danger);
}

/* Small image upload for gifts */
.image-preview-small {
  width: 80px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-cream-dark);
  border: 2px dashed var(--color-border);
}

.image-preview-small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-placeholder-small {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-light-gray);
  font-size: 1.5rem;
}

.upload-status-small {
  font-size: 0.75rem;
  font-weight: 500;
}

.upload-status-small.uploading {
  color: var(--color-gold);
}
.upload-status-small.success {
  color: var(--color-success);
}
.upload-status-small.error {
  color: var(--color-danger);
}

/* Gift form styles */
.gift-form-grid {
  display: flex;
  gap: 1.5rem;
  align-items: flex-end;
}

.gift-form-image {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.gift-form-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gift-form-fields input {
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
}

.gift-form-row {
  display: flex;
  gap: 0.75rem;
}

.gift-form-row input {
  flex: 1;
}

/* ============================================
   ERROR MESSAGES
   ============================================ */
.error-message {
  background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
  color: var(--color-danger);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--color-danger);
  font-size: 0.9375rem;
}

/* ============================================
   PUBLIC NAVIGATION
   ============================================ */
.public-nav {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(212, 170, 174, 0.18);
  padding: 0.7rem clamp(1rem, 4vw, 2rem);
  position: sticky;
  top: 0;
  z-index: 100;
}

.public-nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 56px;
}

.public-nav-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  flex-shrink: 0;
  transition: transform var(--transition-smooth);
}

.public-nav-brand:hover {
  transform: scale(1.04) rotate(-2deg);
}

.public-nav-logo {
  width: 44px;
  height: 44px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(60, 50, 40, 0.12));
}

.public-nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
}

.public-nav-links a {
  color: var(--color-text);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  position: relative;
  padding: 0.35rem 0;
  white-space: nowrap;
}

.public-nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background: var(--color-gold);
  transition:
    width var(--transition-smooth),
    left var(--transition-smooth);
}

.public-nav-links a:hover::after {
  width: 100%;
  left: 0;
}

.public-nav-links a:hover {
  color: var(--color-gold-dark);
}

.nav-admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  opacity: 0.35;
  color: var(--color-warm-gray);
  transition: opacity var(--transition-fast);
}

.nav-admin-link::after {
  display: none !important;
}

.nav-admin-link:hover {
  opacity: 1;
}

@media (max-width: 640px) {
  .public-nav {
    padding: 0.5rem 0.9rem;
  }

  .public-nav-container {
    min-height: 48px;
  }

  .public-nav-logo {
    width: 36px;
    height: 36px;
  }

  .public-nav-links {
    gap: 1.15rem;
  }

  .public-nav-links a {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
  }

  .nav-admin-link {
    width: 28px;
    height: 28px;
  }

  .nav-admin-link svg {
    width: 16px;
    height: 16px;
  }
}

/* ============================================
   MEDIA UPLOAD (PUBLIC)
   ============================================ */
.media-upload-page {
  width: 100%;
  overflow-x: hidden;
  min-height: calc(100vh - 88px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 6vw, 4rem) clamp(1rem, 4vw, 2rem);
  background:
    linear-gradient(rgba(250, 247, 247, 0.88), rgba(250, 247, 247, 0.94)),
    url("/static/img/invitation-preview.png") center/cover;
}

.media-upload-shell {
  width: 100%;
  max-width: 620px;
  min-width: 0;
  margin: 0 auto;
  box-sizing: border-box;
  background: var(--color-paper);
  border: 1px solid rgba(212, 170, 174, 0.32);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-letter);
  padding: clamp(2rem, 6vw, 3.5rem);
}

.media-upload-header {
  text-align: center;
  margin-bottom: 2rem;
}

.media-upload-seal {
  display: block;
  width: clamp(64px, 18vw, 86px);
  height: clamp(64px, 18vw, 86px);
  object-fit: contain;
  margin: 0 auto 1.15rem;
  filter: drop-shadow(0 4px 12px rgba(60, 50, 40, 0.12));
}

.media-upload-kicker {
  margin: 0 0 0.55rem;
  color: var(--color-gold-dark);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.media-upload-header h1 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 3.35rem);
  font-style: italic;
  line-height: 1.08;
}

.media-upload-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.media-upload-form input,
.media-upload-form textarea,
.media-upload-form select {
  font-size: 17px;
}

.media-upload-form .form-group {
  min-width: 0;
}

.media-upload-form #guest_name {
  min-height: 52px;
  font-size: 17px;
  line-height: 1.35;
}

.media-file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 176px;
  padding: 1.65rem 1.25rem;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(245, 240, 240, 0.6)),
    rgba(245, 240, 240, 0.54);
  color: var(--color-text);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-smooth);
}

.media-file-drop:hover,
.media-file-drop:focus-within {
  border-color: var(--color-gold-dark);
  background: rgba(232, 213, 208, 0.28);
}

.media-file-icon {
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.1rem;
  border-radius: 999px;
  color: var(--color-gold-dark);
  background: white;
  box-shadow: var(--shadow-sm);
}

.media-file-icon svg {
  width: 30px;
  height: 30px;
}

.media-file-title {
  display: block;
  width: 100%;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
}

.media-file-subtitle,
.media-file-list {
  color: var(--color-text-light);
  font-size: 0.875rem;
}

.media-file-subtitle {
  display: block;
  width: 100%;
  line-height: 1.35;
  text-align: center;
}

.media-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.media-file-list {
  min-height: 1.5rem;
  margin-top: 0.6rem;
  text-align: center;
}

.media-file-summary {
  margin: 0 0 0.65rem;
  color: var(--color-text-light);
  font-size: 0.875rem;
}

.media-file-summary-error {
  color: var(--color-danger);
  font-weight: 600;
}

.media-selected-files {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.media-selected-file {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 0.75rem;
  min-height: 54px;
  padding: 0.45rem;
  border: 1px solid rgba(212, 170, 174, 0.22);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.76);
  text-align: left;
}

.media-selected-preview {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--color-cream-dark);
  color: var(--color-light-gray);
  font-size: 0.625rem;
  font-weight: 600;
}

.media-selected-preview img,
.media-selected-preview video,
.media-selected-preview canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.media-selected-preview-video::before {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
}

.media-selected-preview-video::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 7px;
  width: 6px;
  height: 7px;
  background: white;
  clip-path: polygon(0 0, 0 100%, 100% 50%);
}

.media-selected-details {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.media-selected-kind {
  color: var(--color-charcoal);
  font-size: 0.875rem;
  font-weight: 600;
}

.media-selected-size {
  color: var(--color-text-light);
  font-size: 0.75rem;
}

.media-selected-remove {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-danger);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
}

.media-selected-remove:hover {
  background: rgba(201, 113, 113, 0.12);
}

.media-submit {
  width: 100%;
  min-height: 52px;
  margin-top: 0.35rem;
}

.media-upload-secondary-link {
  display: inline-flex;
  justify-content: center;
  margin-top: 0.35rem;
  color: var(--color-gold-dark);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.media-upload-secondary-link:hover {
  color: var(--color-gold);
}

.media-thanks-page .media-upload-shell {
  padding-block: clamp(3rem, 8vw, 4.5rem);
}

.media-thanks-text {
  max-width: 32ch;
  margin: 0.75rem auto 0;
  color: var(--color-text-light);
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 3vw, 1.25rem);
  font-style: italic;
}

.media-gallery-link {
  margin-top: 1rem;
}

@media (max-width: 640px) {
  .media-upload-page {
    align-items: flex-start;
    min-height: calc(100vh - 72px);
    padding: 1.25rem 1rem 2.25rem;
  }

  .media-upload-shell {
    max-width: 430px;
    padding: 1.5rem 1rem;
  }

  .media-file-drop {
    min-height: 160px;
    padding: 1.35rem 1rem;
  }

  .media-file-icon {
    width: 54px;
    height: 54px;
  }

  .media-upload-form input,
  .media-upload-form textarea,
  .media-upload-form select,
  .media-upload-form #guest_name {
    font-size: 17px;
  }
}

/* ============================================
   PUBLIC MEDIA GALLERY
   ============================================ */
.public-gallery-page {
  min-height: 100vh;
  background: #fbfaf9;
  padding-bottom: 4rem;
}

.public-gallery-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem clamp(0.85rem, 4vw, 1.5rem);
  background: rgba(251, 250, 249, 0.9);
  border-bottom: 1px solid rgba(212, 170, 174, 0.18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.public-gallery-seal {
  width: 46px;
  height: 46px;
  object-fit: contain;
  flex-shrink: 0;
}

.public-gallery-header p {
  margin: 0;
  color: var(--color-gold-dark);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.public-gallery-header h1 {
  margin: 0;
  color: var(--color-charcoal);
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 4vw, 1.45rem);
  font-weight: 600;
  line-height: 1.2;
}

.public-gallery-groups {
  width: min(100%, 1160px);
  margin: 0 auto;
  padding: 1.1rem clamp(0.45rem, 3vw, 1.5rem) 0;
}

.public-gallery-group {
  margin-bottom: 1.6rem;
}

.public-gallery-group-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0.35rem 0.65rem;
}

.public-gallery-group-header h2 {
  margin: 0;
  color: var(--color-charcoal);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
}

.public-gallery-group-header span {
  color: var(--color-light-gray);
  font-size: 0.75rem;
  font-weight: 600;
}

.public-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
}

.public-gallery-tile {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  background: #ece8e6;
  overflow: hidden;
}

.public-gallery-media {
  position: absolute;
  inset: 0;
  display: block;
  color: var(--color-light-gray);
}

.public-gallery-media img,
.public-gallery-media video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.public-gallery-file-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.public-gallery-video-badge {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.46);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.public-gallery-video-badge svg {
  width: 15px;
  height: 15px;
  transform: translateX(1px);
}

.public-gallery-tile-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 1.35rem 0.45rem 0.45rem;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.52));
  color: white;
  pointer-events: none;
}

.public-gallery-tile-footer span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.68rem;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.public-gallery-tile-footer a {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-charcoal);
  flex: 0 0 auto;
  pointer-events: auto;
}

.public-gallery-tile-footer a svg {
  width: 16px;
  height: 16px;
}

.public-gallery-empty {
  max-width: 420px;
  margin: 4rem auto;
  padding: 0 1rem;
  text-align: center;
}

.public-gallery-empty h2 {
  margin-bottom: 0.65rem;
  font-family: var(--font-body);
  font-size: 1.25rem;
  font-weight: 700;
}

.public-gallery-empty p {
  margin: 0;
  color: var(--color-text-light);
}

@media (min-width: 760px) {
  .public-gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .public-gallery-tile {
    border-radius: var(--radius-sm);
  }

  .public-gallery-tile-footer span {
    font-size: 0.75rem;
  }
}

@media (min-width: 1100px) {
  .public-gallery-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* ============================================
   NOSSA HISTÓRIA (PUBLIC HOME)
   ============================================ */
.story-page {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1rem, 4vw, 2rem) 6rem;
  color: var(--color-ink);
}

.story-hero {
  text-align: center;
  margin-bottom: clamp(3rem, 7vw, 5rem);
}

.story-eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--color-gold-dark);
  margin-bottom: 1.25rem;
  padding-left: 0.4em;
}

.story-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.02em;
  color: var(--color-charcoal);
  line-height: 1.1;
  margin: 0;
}

.story-divider,
.story-flourish {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin: 1.5rem auto 1.25rem;
}

.story-divider-line,
.story-flourish-line {
  display: block;
  width: clamp(44px, 12vw, 88px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-gold));
}

.story-divider-line:last-child,
.story-flourish-line:last-child {
  background: linear-gradient(90deg, var(--color-gold), transparent);
}

.story-divider-mark,
.story-flourish-mark {
  color: var(--color-gold);
  font-size: 0.95rem;
  opacity: 0.85;
  line-height: 1;
}

.story-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  color: var(--color-warm-gray);
  max-width: 40ch;
  margin: 0 auto;
}

.story-paper {
  position: relative;
  background-color: var(--color-paper);
  border: 1px solid rgba(212, 170, 174, 0.3);
  border-radius: 2px;
  padding: clamp(2.25rem, 5vw, 4rem) clamp(1.5rem, 6vw, 4.5rem);
}

.story-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--color-gold);
  opacity: 0.55;
  pointer-events: none;
}

.story-corner-tl {
  top: 14px;
  left: 14px;
  border-right: none;
  border-bottom: none;
}
.story-corner-tr {
  top: 14px;
  right: 14px;
  border-left: none;
  border-bottom: none;
}
.story-corner-bl {
  bottom: 14px;
  left: 14px;
  border-right: none;
  border-top: none;
}
.story-corner-br {
  bottom: 14px;
  right: 14px;
  border-left: none;
  border-top: none;
}

.story-content {
  font-family: var(--font-display);
  color: var(--color-ink);
  font-size: clamp(1rem, 2.2vw, 1.0625rem);
  line-height: 1.9;
}

.story-content > *:first-child {
  margin-top: 0;
}
.story-content > *:last-child {
  margin-bottom: 0;
}

.story-content p {
  margin: 0 0 1.5rem;
  color: var(--color-ink);
  text-align: justify;
  hyphens: auto;
}

.story-content > p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-weight: 600;
  float: left;
  font-size: 4.5rem;
  line-height: 0.9;
  margin: 0.25rem 0.65rem -0.4rem 0;
  color: var(--color-gold-dark);
}

.story-content h1,
.story-content h2,
.story-content h3 {
  font-family: var(--font-display);
  color: var(--color-gold-dark);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.01em;
  margin: 2.25rem 0 1rem;
  text-align: center;
}

.story-content h1 {
  font-size: 1.9rem;
}
.story-content h2 {
  font-size: 1.55rem;
}
.story-content h3 {
  font-size: 1.25rem;
}

.story-content h1::after,
.story-content h2::after,
.story-content h3::after {
  content: "";
  display: block;
  width: 48px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-gold),
    transparent
  );
  margin: 0.55rem auto 0;
}

.story-content blockquote {
  margin: 1.75rem 0;
  padding: 0.25rem 1.5rem;
  border-left: 2px solid var(--color-gold);
  font-style: italic;
  color: var(--color-warm-gray);
}

.story-content em {
  color: var(--color-gold-dark);
}

.story-content strong {
  color: var(--color-charcoal);
  font-weight: 600;
}

.story-content ul,
.story-content ol {
  margin: 0 0 1.5rem 1.5rem;
}

.story-content li {
  margin-bottom: 0.5rem;
}

.story-content a {
  color: var(--color-gold-dark);
  text-decoration: underline;
  text-decoration-color: rgba(165, 113, 123, 0.35);
  text-underline-offset: 3px;
}

.story-content a:hover {
  color: var(--color-gold);
  text-decoration-color: var(--color-gold);
}

.story-content hr {
  border: none;
  text-align: center;
  margin: 2.25rem 0;
  overflow: visible;
}

.story-content hr::before {
  content: "\2726  \2726  \2726";
  display: inline-block;
  letter-spacing: 0.75em;
  color: var(--color-gold);
  opacity: 0.6;
  font-size: 0.75rem;
}

.story-content img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 1.5rem auto;
  box-shadow: var(--shadow-md);
}

.story-flourish {
  margin-top: 2.5rem;
  margin-bottom: 0;
  opacity: 0.8;
}

.story-flourish-line {
  width: clamp(36px, 10vw, 72px);
}

@media (max-width: 640px) {
  .story-content p {
    text-align: left;
  }
  .story-content > p:first-of-type::first-letter {
    font-size: 3.5rem;
    margin-right: 0.5rem;
  }
  .story-corner {
    width: 16px;
    height: 16px;
  }
  .story-corner-tl {
    top: 10px;
    left: 10px;
  }
  .story-corner-tr {
    top: 10px;
    right: 10px;
  }
  .story-corner-bl {
    bottom: 10px;
    left: 10px;
  }
  .story-corner-br {
    bottom: 10px;
    right: 10px;
  }
}

/* ============================================
   ENVELOPE ANIMATION
   ============================================ */
.envelope-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    var(--color-cream) 0%,
    var(--color-cream-dark) 100%
  );
  z-index: 1000;
  transition: opacity 0.8s ease-out;
}

.envelope-wrapper.opened {
  opacity: 0;
  pointer-events: none;
}

.envelope {
  position: relative;
  width: min(400px, 85vw);
  height: min(280px, 60vw);
}

/* Envelope back (the main body) */
.envelope-back {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #f8f8f8 0%, #ffffff 100%);
  border-radius: 8px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.15),
    0 8px 25px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Envelope flap (the triangle - closed) */
.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 55%;
  z-index: 3;
}

.envelope-flap-inner {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #ffffff 0%, #f5f5f5 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-radius: 8px 8px 0 0;
}

/* Envelope front (bottom fold) */
.envelope-front {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 65%;
  background: linear-gradient(0deg, #ffffff 0%, #fafafa 100%);
  clip-path: polygon(0 35%, 50% 0, 100% 35%, 100% 100%, 0 100%);
  border-radius: 0 0 8px 8px;
  z-index: 2;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* Paper texture overlay */
.envelope-back::before,
.envelope-front::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  border-radius: inherit;
}

/* Seal container */
.seal-container {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
}

/* Wax seal on envelope */
.monogram-seal {
  width: min(110px, 26vw);
  height: min(110px, 26vw);
  object-fit: contain;
}

/* Initial state for invitation content */
#invitation-content {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.8s ease-out,
    transform 0.8s ease-out;
}

#invitation-content.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Subtle envelope entrance animation */
@keyframes envelope-entrance {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.envelope {
  animation: envelope-entrance 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   INVITATION PAGE (PUBLIC) - LETTER STYLE
   ============================================ */

/* Letter Container - Outer wrapper */
.letter-container {
  max-width: 720px;
  margin: 2rem auto 4rem;
  padding: 0 1rem;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.8s ease-out,
    transform 0.8s ease-out;
}

.letter-container.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Letter Paper - Main stationery */
.letter-paper {
  background-color: var(--color-paper);
  padding: 3.5rem 4rem 4.5rem;
  position: relative;
  box-shadow: var(--shadow-letter);
  border: 1px solid rgba(212, 170, 174, 0.2);
  font-family: var(--font-display);
  background-image:
    /* Fine cotton fiber grain */
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='5' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)' opacity='0.08'/%3E%3C/svg%3E"),
    /* Soft pulp variation */
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.04' numOctaves='3' seed='5' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)' opacity='0.07'/%3E%3C/svg%3E"),
    /* Warm aged gradient */
    linear-gradient(
        180deg,
        var(--color-paper) 0%,
        var(--color-paper-aged) 50%,
        var(--color-paper) 100%
      );
}

/* Border rectangle with corner accents */
.letter-border {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  right: 1.25rem;
  bottom: 1.25rem;
  border: 1px solid var(--color-gold-light);
  pointer-events: none;
  opacity: 0.6;
}

/* Decorative corner marks */
.letter-border::before,
.letter-border::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--color-gold);
  border-style: solid;
}

.letter-border::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}

.letter-border::after {
  top: -1px;
  right: -1px;
  border-width: 2px 2px 0 0;
}

.letter-paper::before,
.letter-paper::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--color-gold);
  border-style: solid;
  opacity: 0.6;
  z-index: 1;
}

.letter-paper::before {
  bottom: 1.25rem;
  left: 1.25rem;
  border-width: 0 0 2px 2px;
}

.letter-paper::after {
  bottom: 1.25rem;
  right: 1.25rem;
  border-width: 0 2px 2px 0;
}

/* Letter inner content wrapper */
.letter-inner {
  position: relative;
}

/* Staggered section reveal animation */
.letter-section {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
  transition-delay: calc(var(--delay, 0) * 0.08s);
}

.letter-container.revealed .letter-section {
  opacity: 1;
  transform: translateY(0);
}

/* Rings ornament at top */
.rings-ornament {
  display: block;
  width: 60px;
  height: 30px;
  margin: 0 auto 1.5rem;
}

/* Recipient title at top */
.letter-recipient {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-ink-light);
  text-align: center;
  margin-bottom: 2.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Blessing text */
.letter-blessing {
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-ink);
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Parents section */
.letter-parents {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: nowrap;
}

.letter-parents-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.875rem;
  color: var(--color-ink-light);
  white-space: nowrap;
}

/* Ornamental divider (line + diamond + line) */
.letter-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.letter-ornament-line {
  display: block;
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-gold));
  opacity: 0.5;
}

.letter-ornament-line:last-child {
  background: linear-gradient(90deg, var(--color-gold), transparent);
}

.letter-ornament-diamond {
  display: block;
  width: 6px;
  height: 6px;
  background: var(--color-gold);
  transform: rotate(45deg);
  opacity: 0.6;
  flex-shrink: 0;
}

/* Couple names section */
.letter-couple {
  padding: 0.5rem 0;
}

.letter-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-ink);
  text-align: center;
  letter-spacing: 0.03em;
  margin-bottom: 0;
  line-height: 1.2;
}

/* Ampersand */
.letter-ampersand {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--color-gold);
  text-align: center;
  margin: 0.5rem 0;
}

/* Invitation text */
.letter-invitation-text {
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-ink-light);
  text-align: center;
  line-height: 1.8;
  margin: 1.5rem 0 0.5rem;
}

/* Quote */
.letter-quote {
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-ink-light);
  text-align: center;
  line-height: 1.7;
  margin: 0.5rem 0 0;
}

/* Location Section */
.letter-location {
  margin: 2rem 0;
  text-align: center;
  padding: 1rem;
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.location-compass,
.gift-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 1rem;
  opacity: 0.85;
  transition: opacity var(--transition-smooth);
}

.location-link:hover .location-compass,
.location-link:hover .gift-icon {
  opacity: 1;
}

.location-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  font-size: 1rem;
  color: var(--color-gold-dark);
  text-decoration: none;
  padding: 0.5rem 1rem;
  transition: color var(--transition-smooth);
}

.location-link-text {
  position: relative;
}

.location-link-text::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-gold);
  opacity: 0.5;
  transition: opacity var(--transition-smooth);
}

.location-link:hover {
  color: var(--color-gold-dark);
}

.location-link:hover .location-link-text::after {
  opacity: 1;
}

/* RSVP Section */
.letter-rsvp {
  margin-top: 2rem;
}

.letter-rsvp-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-ink);
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Guest row styling */
.letter-rsvp-guest {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  margin-bottom: 0.5rem;
}

.letter-guest-name {
  font-size: 1rem;
  color: var(--color-ink);
}

/* RSVP Buttons */
.rsvp-buttons {
  display: flex;
  gap: 0.75rem;
}

.rsvp-btn {
  font-size: 0.875rem;
  font-weight: 400;
  padding: 0.5rem 1.25rem;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-smooth);
}

/* Confirm button */
.rsvp-btn-confirm {
  color: #5d8a72;
  border-color: #5d8a72;
}

.rsvp-btn-confirm::before {
  content: "\2713\00a0";
  font-style: normal;
}

.rsvp-btn-confirm:hover,
.rsvp-btn-confirm.active {
  background: #5d8a72;
  color: white;
  box-shadow: 0 2px 8px rgba(93, 138, 114, 0.35);
}

/* Decline button */
.rsvp-btn-decline {
  color: #8a7278;
  border-color: #8a7278;
}

.rsvp-btn-decline::before {
  content: "\00d7\00a0";
  font-style: normal;
}

.rsvp-btn-decline:hover,
.rsvp-btn-decline.active {
  background: #8a7278;
  color: white;
  box-shadow: 0 2px 8px rgba(138, 114, 120, 0.35);
}

/* Instructions Section */
.letter-instructions {
  margin-top: 2.5rem;
}

.letter-instructions-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-ink);
  text-align: center;
  margin-bottom: 1.5rem;
}

.letter-instructions p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-ink-light);
  margin-bottom: 1rem;
}

.letter-instructions ul,
.letter-instructions ol {
  color: var(--color-ink-light);
  font-size: 1rem;
  line-height: 1.8;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.letter-instructions strong {
  color: var(--color-ink);
  font-weight: 600;
}

/* ============================================
   INVITATION DECORATIONS
   ============================================ */

/* Full-page paper texture background */
.invitation-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background-color: #f3eeee;
  background-image:
    /* Fine fiber grain — visible micro-texture */
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='6' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)' opacity='0.12'/%3E%3C/svg%3E"),
    /* Medium pulp clumps */
    url("data:image/svg+xml,%3Csvg viewBox='0 0 300 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='b'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.35' numOctaves='4' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23b)' opacity='0.09'/%3E%3C/svg%3E"),
    /* Large tonal variation — aged parchment wash */
    url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='c'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012' numOctaves='2' seed='12' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23c)' opacity='0.14'/%3E%3C/svg%3E"),
    /* Warm pink light pools */
    radial-gradient(
        ellipse at 20% 25%,
        rgba(212, 170, 174, 0.1) 0%,
        transparent 50%
      ),
    radial-gradient(
      ellipse at 80% 75%,
      rgba(212, 170, 174, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 50% 50%,
      rgba(212, 170, 174, 0.06) 0%,
      transparent 40%
    );
}

/* Vignette + warm aging at edges */
.invitation-bg::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(
      ellipse at 50% 50%,
      transparent 30%,
      rgba(50, 40, 42, 0.1) 100%
    ),
    linear-gradient(
      180deg,
      rgba(184, 148, 154, 0.06) 0%,
      transparent 15%,
      transparent 85%,
      rgba(184, 148, 154, 0.06) 100%
    );
  pointer-events: none;
}

/* Floating particles */
.invitation-particle {
  position: absolute;
  bottom: -10px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(212, 170, 174, 0.5) 0%,
    rgba(212, 170, 174, 0) 70%
  );
  pointer-events: none;
  animation: particle-float linear infinite;
}

@keyframes particle-float {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  5% {
    opacity: 0.8;
  }
  50% {
    transform: translateY(-50vh) translateX(15px);
    opacity: 0.6;
  }
  95% {
    opacity: 0;
  }
  100% {
    transform: translateY(-105vh) translateX(-10px);
    opacity: 0;
  }
}

/* Botanical corner ornaments */
.floral-corner {
  position: absolute;
  width: 90px;
  height: 90px;
  pointer-events: none;
  z-index: 1;
}

.floral-corner-tl {
  top: 0.25rem;
  left: 0.25rem;
}

.floral-corner-tr {
  top: 0.25rem;
  right: 0.25rem;
  transform: scaleX(-1);
}

.floral-corner-bl {
  bottom: 0.25rem;
  left: 0.25rem;
  transform: scaleY(-1);
}

.floral-corner-br {
  bottom: 0.25rem;
  right: 0.25rem;
  transform: scale(-1);
}

/* Border shimmer animation */
@keyframes border-shimmer {
  0%,
  100% {
    border-color: rgba(212, 170, 174, 0.15);
  }
  50% {
    border-color: rgba(212, 170, 174, 0.4);
  }
}

.letter-border {
  animation: border-shimmer 6s ease-in-out infinite;
}

/* Ornate scrollwork divider */
.ornate-divider-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0;
}

.ornate-divider {
  display: block;
  width: 200px;
  height: 20px;
}

/* Title flourish (calligraphic swirl under couple names) */
.title-flourish {
  display: block;
  width: 100px;
  height: 16px;
  margin: 0.75rem auto 0;
  opacity: 0.7;
}

/* Invitation monogram (wreath with initials) */
.invitation-monogram {
  display: block;
  width: 100px;
  height: 110px;
  margin: 0 auto 1.5rem;
  opacity: 0.85;
}

/* Bottom flourish */
.bottom-flourish {
  display: block;
  width: 160px;
  height: 40px;
  margin: 2rem auto 0;
}

/* Enhanced couple section spacing */
.letter-couple {
  padding: 0.75rem 0;
}

/* Subtle text enhancement for couple names */
.letter-title {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Decorative quotation marks on quote */
.letter-quote {
  position: relative;
  padding: 0.5rem 1.5rem;
}

.letter-quote::before,
.letter-quote::after {
  font-family: "Lora", Georgia, serif;
  font-size: 2rem;
  color: var(--color-gold-light);
  position: absolute;
  opacity: 0.4;
}

.letter-quote::before {
  content: "\201C";
  top: -0.25rem;
  left: 0;
}

.letter-quote::after {
  content: "\201D";
  bottom: -0.75rem;
  right: 0;
}

/* Legacy class support for template compatibility */
.invitation-container {
  max-width: 720px;
  margin: 2rem auto 4rem;
  padding: 0 1rem;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.8s ease-out,
    transform 0.8s ease-out;
}

.invitation-container.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Letter Page Responsive Styles */
@media (max-width: 768px) {
  .letter-container,
  .invitation-container {
    margin: 1rem auto 2rem;
  }

  .letter-paper {
    padding: 2.5rem 2rem 3rem;
  }

  .letter-border {
    top: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .letter-paper::before {
    bottom: 0.75rem;
    left: 0.75rem;
  }

  .letter-paper::after {
    bottom: 0.75rem;
    right: 0.75rem;
  }

  .letter-parents-side {
    font-size: 0.8rem;
  }

  .letter-title {
    font-size: 1.75rem;
  }

  .letter-ampersand {
    font-size: 2rem;
  }

  .letter-rsvp-guest {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 0;
  }

  .rsvp-buttons {
    width: 100%;
    justify-content: space-between;
  }

  .rsvp-btn {
    flex: 1;
    text-align: center;
    padding: 0.625rem 1rem;
  }

  .floral-corner {
    width: 65px;
    height: 65px;
  }

  .ornate-divider {
    width: 160px;
    height: 16px;
  }

  .invitation-monogram {
    width: 85px;
    height: 94px;
  }

  .title-flourish {
    width: 80px;
    height: 14px;
  }

  .bottom-flourish {
    width: 130px;
    height: 34px;
  }

  .letter-quote::before,
  .letter-quote::after {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .letter-paper {
    padding: 2rem 1.5rem 2.5rem;
  }

  .letter-border {
    top: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.5rem;
  }

  .letter-paper::before {
    bottom: 0.5rem;
    left: 0.5rem;
  }

  .letter-paper::after {
    bottom: 0.5rem;
    right: 0.5rem;
  }

  .letter-border::before,
  .letter-border::after {
    width: 14px;
    height: 14px;
  }

  .letter-paper::before,
  .letter-paper::after {
    width: 14px;
    height: 14px;
  }

  .letter-title {
    font-size: 1.25rem;
  }

  .letter-ampersand {
    font-size: 1.5rem;
  }

  .floral-corner {
    width: 50px;
    height: 50px;
  }

  .ornate-divider {
    width: 130px;
    height: 14px;
  }

  .invitation-monogram {
    width: 70px;
    height: 77px;
    margin-bottom: 1rem;
  }

  .title-flourish {
    width: 65px;
    height: 12px;
  }

  .bottom-flourish {
    width: 110px;
    height: 28px;
  }

  .letter-quote {
    padding: 0.5rem 0.75rem;
  }

  .letter-quote::before,
  .letter-quote::after {
    display: none;
  }

  .letter-location {
    gap: 1.25rem;
    padding: 0.5rem 0;
    flex-wrap: nowrap;
  }

  .location-compass,
  .gift-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 0.7rem;
  }

  .location-link {
    font-size: 0.9rem;
    padding: 0.3rem 0.5rem;
  }

  .invitation-particle:nth-child(n + 5) {
    display: none;
  }

  .letter-parents {
    gap: 1rem;
  }

  .letter-parents-side {
    font-size: 0.65rem;
  }

  .rsvp-btn {
    font-size: 0.8rem;
  }
}

/* ============================================
   LISTA DE PRESENTES (PUBLIC)
   ============================================ */
.gifts-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1rem, 4vw, 2rem) 6rem;
}

.gifts-hero {
  text-align: center;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.gifts-eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--color-gold-dark);
  margin-bottom: 1.25rem;
  padding-left: 0.4em;
}

.gifts-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6.5vw, 3.75rem);
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.02em;
  color: var(--color-charcoal);
  line-height: 1.1;
  margin: 0;
}

.gifts-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin: 1.25rem auto 1.25rem;
}

.gifts-divider-line {
  display: block;
  width: clamp(44px, 12vw, 88px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-gold));
}

.gifts-divider-line:last-child {
  background: linear-gradient(90deg, var(--color-gold), transparent);
}

.gifts-divider-mark {
  color: var(--color-gold);
  font-size: 0.9rem;
  opacity: 0.85;
  line-height: 1;
}

.gifts-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 2.3vw, 1.125rem);
  color: var(--color-warm-gray);
  max-width: 46ch;
  margin: 0 auto;
}

.gifts-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.gifts-count {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-warm-gray);
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.gifts-count strong {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: normal;
  text-transform: none;
  color: var(--color-gold-dark);
}

.gifts-sort-control {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.gifts-sort-control label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-warm-gray);
}

.gifts-sort-control select {
  appearance: none;
  -webkit-appearance: none;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a5717b' d='M6 8 2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
  padding: 0.35rem 1.9rem 0.35rem 0.9rem;
  border: 1px solid rgba(212, 170, 174, 0.4);
  border-radius: 999px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--color-gold-dark);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.gifts-sort-control select:hover {
  border-color: var(--color-gold);
}

.gifts-sort-control select:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(212, 170, 174, 0.2);
}

.gifts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: clamp(1rem, 2.5vw, 1.75rem);
}

.gifts-empty {
  padding: 3.5rem 1.5rem;
  text-align: center;
  background: var(--color-paper);
  border: 1px dashed rgba(212, 170, 174, 0.5);
  border-radius: var(--radius-lg);
  color: var(--color-warm-gray);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.0625rem;
}

/* ---- Gift card ---- */
.gift-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid rgba(212, 170, 174, 0.2);
  border-radius: 2px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition:
    transform var(--transition-smooth),
    border-color var(--transition-smooth);
  isolation: isolate;
}

.gift-card::before,
.gift-card::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 1px solid var(--color-gold);
  opacity: 0;
  transform: translate(4px, 4px);
  transition:
    opacity var(--transition-smooth),
    transform var(--transition-smooth);
  pointer-events: none;
  z-index: 2;
}

.gift-card::before {
  top: 10px;
  left: 10px;
  border-right: none;
  border-bottom: none;
}

.gift-card::after {
  bottom: 10px;
  right: 10px;
  border-left: none;
  border-top: none;
}

.gift-card:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 170, 174, 0.5);
}

.gift-card:hover::before,
.gift-card:hover::after {
  opacity: 0.9;
  transform: translate(0, 0);
}

.gift-card-media {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--color-cream);
  overflow: hidden;
}

.gift-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gift-card:hover .gift-card-media img {
  transform: scale(1.05);
}

.gift-card-media-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gold);
  opacity: 0.35;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 2rem;
}

.gift-card-body {
  padding: 1.1rem 1.25rem 1.35rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.gift-card-title {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--color-charcoal);
  line-height: 1.35;
  margin: 0;
}

.gift-card-price {
  display: inline-flex;
  align-items: baseline;
  padding: 0.3rem 0.95rem;
  background: rgba(212, 170, 174, 0.14);
  border: 1px solid rgba(212, 170, 174, 0.35);
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-gold-dark);
  letter-spacing: 0.02em;
  transition:
    background-color var(--transition-smooth),
    border-color var(--transition-smooth);
}

.gift-card:hover .gift-card-price {
  background: rgba(212, 170, 174, 0.22);
  border-color: rgba(212, 170, 174, 0.55);
}

@media (max-width: 720px) {
  .gifts-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.9rem;
  }

  .gifts-sort-control label {
    display: none;
  }

  .gift-card-body {
    padding: 0.9rem 0.85rem 1.1rem;
    gap: 0.55rem;
  }

  .gift-card-title {
    font-size: 0.9375rem;
  }

  .gift-card-price {
    font-size: 0.8125rem;
    padding: 0.25rem 0.75rem;
  }
}

/* ============================================
   GIFT DETAIL (PUBLIC)
   ============================================ */
.gift-detail-page {
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem) 6rem;
}

.gift-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-warm-gray);
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
  transition: color var(--transition-fast);
}

.gift-detail-back:hover {
  color: var(--color-gold-dark);
}

.gift-detail {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}

.gift-detail-media {
  position: relative;
  aspect-ratio: 4 / 5;
  width: 100%;
  background: var(--color-cream);
  border: 1px solid rgba(212, 170, 174, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

@media (min-width: 861px) {
  .gift-detail-media {
    position: sticky;
    top: 6rem;
  }
}

.gift-detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gift-detail-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gold);
  opacity: 0.35;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 3rem;
}

.gift-detail-info {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-top: 0.25rem;
}

.gift-detail-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  line-height: 1.15;
  color: var(--color-charcoal);
  margin: 0;
}

.gift-detail-value {
  display: inline-flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.7rem 1.1rem;
  align-self: flex-start;
  background: rgba(212, 170, 174, 0.14);
  border: 1px solid rgba(212, 170, 174, 0.35);
  border-radius: var(--radius-md);
}

.gift-detail-value-label {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-warm-gray);
}

.gift-detail-value-amount {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  color: var(--color-gold-dark);
  letter-spacing: 0.02em;
}

.gift-detail-intro {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-warm-gray);
  max-width: 52ch;
  margin: 0.25rem 0 0.5rem;
}

/* ---- Pix card ---- */
.pix-card {
  margin-top: 0.5rem;
  background: #ffffff;
  border: 1px solid rgba(212, 170, 174, 0.3);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.pix-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.25rem;
  background: rgba(212, 170, 174, 0.1);
  border-bottom: 1px solid rgba(212, 170, 174, 0.25);
}

.pix-card-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-gold-dark);
}

.pix-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
}

.pix-qr {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pix-qr img {
  width: clamp(180px, 26vw, 240px);
  height: clamp(180px, 26vw, 240px);
  padding: 10px;
  background: #ffffff;
  border: 1px solid rgba(212, 170, 174, 0.35);
  border-radius: var(--radius-md);
  image-rendering: pixelated;
}

.pix-code-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
}

.pix-code-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-warm-gray);
}

.pix-code-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.pix-code-input {
  flex: 1;
  min-width: 0;
  padding: 0.7rem 0.9rem;
  font-family: "SF Mono", "Menlo", "Monaco", monospace;
  font-size: 0.8125rem;
  color: var(--color-ink);
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  letter-spacing: 0.02em;
}

.pix-code-input:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(212, 170, 174, 0.18);
}

.pix-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.15rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: white;
  background: linear-gradient(
    135deg,
    var(--color-gold) 0%,
    var(--color-gold-dark) 100%
  );
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-gold);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background var(--transition-fast);
  white-space: nowrap;
}

.pix-copy-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(212, 170, 174, 0.4);
}

.pix-copy-btn:active {
  transform: translateY(0);
}

.pix-copy-btn.is-copied {
  background: linear-gradient(135deg, #7a8f74 0%, #5d8a72 100%);
  box-shadow: 0 4px 18px rgba(93, 138, 114, 0.35);
}

.pix-copy-btn.is-error {
  background: linear-gradient(135deg, #c97171 0%, #a85555 100%);
  box-shadow: 0 4px 18px rgba(201, 113, 113, 0.35);
}

@media (max-width: 860px) {
  .gift-detail {
    grid-template-columns: 1fr;
  }

  .gift-detail-media {
    max-width: 420px;
    margin: 0 auto;
  }
}

@media (max-width: 520px) {
  .pix-code-row {
    flex-direction: column;
  }

  .pix-copy-btn {
    width: 100%;
  }

  .pix-card-header {
    padding: 0.75rem 1rem;
  }
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(
    135deg,
    var(--color-cream) 0%,
    var(--color-cream-dark) 100%
  );
}

.login-card {
  background: white;
  padding: 3rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-card h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--color-gold-dark);
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
}

.login-form .btn {
  width: 100%;
  margin-top: 1rem;
}

/* ============================================
   ADMIN LAYOUT
   ============================================ */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 260px;
  background: linear-gradient(
    180deg,
    var(--color-admin-sidebar) 0%,
    #1f1e1b 100%
  );
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
}

.sidebar-header {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--color-gold-light);
}

.sidebar-nav {
  flex: 1;
  padding: 1.5rem 0;
}

.sidebar-nav .nav-link {
  display: block;
  padding: 0.875rem 1.5rem;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  letter-spacing: 0.03em;
  transition: all var(--transition-fast);
}

.sidebar-nav .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: white;
  padding-left: 1.75rem;
}

.sidebar-nav .nav-link.active {
  background: linear-gradient(90deg, var(--color-gold-dark), transparent);
  color: white;
  border-left: 3px solid var(--color-gold);
}

.sidebar-mode-form {
  padding: 0 1.5rem 1.25rem;
}

.sidebar-mode-toggle {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 0.75rem;
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

.sidebar-mode-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sidebar-mode-track {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.16);
  position: relative;
  transition: all var(--transition-fast);
}

.sidebar-mode-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  position: absolute;
  left: 2px;
  top: 2px;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.sidebar-mode-toggle:hover {
  color: white;
}

.sidebar-mode-toggle-on .sidebar-mode-track {
  background: var(--color-gold-dark);
  border-color: var(--color-gold);
}

.sidebar-mode-toggle-on .sidebar-mode-thumb {
  background: white;
  transform: translateX(16px);
}

.sidebar-footer {
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer .nav-link {
  display: block;
  padding: 0.75rem 1.5rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8125rem;
}

.sidebar-footer .nav-link:hover {
  color: white;
}

.sidebar-footer .logout {
  color: var(--color-danger);
}

.admin-main {
  flex: 1;
  margin-left: 260px;
  padding: 2.5rem;
  background-color: var(--color-bg);
}

.admin-main h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--color-charcoal);
  margin-bottom: 2rem;
  font-weight: 400;
}

.admin-main h2 {
  font-family: var(--font-display);
  margin: 2.5rem 0 1.25rem;
  color: var(--color-charcoal);
  font-size: 1.5rem;
  font-weight: 400;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.admin-header h1 {
  margin-bottom: 0;
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ============================================
   SENT TOGGLE (per-invitation switch)
   ============================================ */
.sent-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 0.75rem 0.375rem 0.5rem;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--color-border);
  cursor: pointer;
  user-select: none;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-warm-gray);
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.sent-toggle:hover {
  border-color: var(--color-gold);
}

.sent-toggle-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sent-toggle-track {
  position: relative;
  display: inline-block;
  width: 2.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: var(--color-cream-dark);
  box-shadow: inset 0 0 0 1px rgba(60, 50, 40, 0.06);
  transition:
    background var(--transition-smooth),
    box-shadow var(--transition-smooth);
  flex-shrink: 0;
}

.sent-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(60, 50, 40, 0.18);
  transition: transform var(--transition-smooth);
}

.sent-toggle-on {
  background: rgba(122, 143, 116, 0.1);
  border-color: rgba(122, 143, 116, 0.4);
  color: var(--color-sage-dark);
}

.sent-toggle-on:hover {
  border-color: var(--color-sage-dark);
}

.sent-toggle-on .sent-toggle-track {
  background: var(--color-sage-dark);
  box-shadow: inset 0 0 0 1px rgba(122, 143, 116, 0.5);
}

.sent-toggle-on .sent-toggle-thumb {
  transform: translateX(1rem);
}

.sent-toggle-input:focus-visible + .sent-toggle-track {
  box-shadow:
    inset 0 0 0 1px rgba(60, 50, 40, 0.06),
    0 0 0 3px rgba(212, 170, 174, 0.35);
}

.sent-toggle.htmx-request {
  opacity: 0.7;
  pointer-events: none;
}

.sent-toggle-label {
  letter-spacing: 0.02em;
}

/* ============================================
   STATS BAR (Compact Dashboard Stats)
   ============================================ */
.dashboard-header {
  margin-bottom: 1.5rem;
}

.dashboard-header h1 {
  margin-bottom: 1rem;
}

.stats-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: white;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(212, 170, 174, 0.1);
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-light-gray);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--color-gold-dark);
}

.stat-item-confirmed .stat-value {
  color: var(--color-success);
}
.stat-item-declined .stat-value {
  color: var(--color-danger);
}
.stat-item-pending .stat-value {
  color: var(--color-gold);
}
.stat-item-sent .stat-value {
  color: var(--color-sage-dark);
}
.stat-item-reminder-sent .stat-value {
  color: var(--color-gold-dark);
}
.stat-item-drinks .stat-value {
  color: var(--color-sage-dark);
}
.stat-item-no-drinks .stat-value {
  color: var(--color-warm-gray);
}

.stat-divider {
  width: 1px;
  height: 2rem;
  background: var(--color-cream-dark);
}

@media (max-width: 768px) {
  .stats-bar {
    gap: 1rem;
    padding: 0.875rem 1rem;
  }

  .stat-item {
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
  }

  .stat-label {
    font-size: 0.625rem;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  .stat-divider {
    display: none;
  }
}

/* ============================================
   AGE BREAKDOWN (Dashboard)
   ============================================ */
.age-breakdown {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-top: 1rem;
  padding: 0.875rem 1.25rem;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(212, 170, 174, 0.1);
  flex-wrap: wrap;
}

.age-breakdown-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-light-gray);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.age-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.age-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 0.375rem;
  padding: 0.3125rem 0.75rem;
  border-radius: 999px;
  background: var(--color-cream);
  border: 1px solid var(--color-cream-dark);
  font-size: 0.8125rem;
  color: var(--color-charcoal);
}

.age-pill-key {
  font-weight: 500;
  color: var(--color-warm-gray);
}

.age-pill-value {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-gold-dark);
}

.age-pill-adult {
  background: rgba(212, 170, 174, 0.12);
  border-color: rgba(212, 170, 174, 0.35);
}

.age-pill-adult .age-pill-value {
  color: var(--color-gold-dark);
}

.age-pill-minor .age-pill-value {
  color: var(--color-charcoal);
}

@media (max-width: 640px) {
  .age-breakdown {
    padding: 0.75rem 1rem;
    gap: 0.625rem;
  }
}

/* ============================================
   STATS GRID (Legacy - kept for other pages)
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background: white;
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(212, 170, 174, 0.1);
}

.stat-card h3 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-light-gray);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.stat-card .stat-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 400;
  color: var(--color-gold-dark);
}

.stat-confirmed .stat-number {
  color: var(--color-success);
}
.stat-declined .stat-number {
  color: var(--color-danger);
}
.stat-pending .stat-number {
  color: var(--color-gold);
}

/* ============================================
   TABLES
   ============================================ */
.table-container {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid rgba(212, 170, 174, 0.1);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--color-cream-dark);
}

th {
  background-color: var(--color-cream);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-warm-gray);
}

tr:last-child td {
  border-bottom: none;
}

/* Compact table variant for dashboard */
.table-compact th,
.table-compact td {
  padding: 0.625rem 1rem;
}

.table-compact td {
  font-size: 0.9375rem;
}

tr:hover {
  background-color: var(--color-cream);
}

/* Clickable table rows */
.table-clickable tbody tr.clickable-row {
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.table-clickable tbody tr.clickable-row:hover {
  background-color: var(--color-cream-dark);
}

/* URL links in tables */
.url-link {
  font-family: "SF Mono", "Monaco", "Menlo", monospace;
  font-size: 0.8125rem;
  color: var(--color-gold-dark);
  padding: 0.25rem 0.5rem;
  background: var(--color-cream);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.url-link:hover {
  background: var(--color-gold);
  color: white;
}

/* Icon buttons */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--color-light-gray);
}

.btn-icon:hover {
  background-color: var(--color-cream-dark);
}

.btn-icon-danger {
  color: var(--color-danger);
}

.btn-icon-danger:hover {
  background-color: rgba(201, 113, 113, 0.15);
  color: #a85555;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(212, 170, 174, 0.1);
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  color: var(--color-charcoal);
}

/* ============================================
   ADMIN MEDIA GALLERY
   ============================================ */
.media-stats-bar {
  margin-bottom: 1.5rem;
}

.media-admin-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 220px;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.5rem;
  background: white;
  border: 1px solid rgba(212, 170, 174, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
}

.media-admin-controls .form-group {
  margin-bottom: 0;
}

.media-guest-group {
  margin-bottom: 1.5rem;
  background: white;
  border: 1px solid rgba(212, 170, 174, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.media-guest-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-cream-dark);
}

.media-guest-header h2 {
  margin: 0 0 0.25rem;
  font-size: 1.45rem;
}

.media-guest-header p {
  margin: 0;
  color: var(--color-text-light);
  font-size: 0.875rem;
}

.media-upload-admin-section {
  padding: 1.25rem 1.5rem 1.5rem;
  border-bottom: 1px solid var(--color-cream-dark);
}

.media-upload-admin-section:last-child {
  border-bottom: none;
}

.media-upload-admin-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  color: var(--color-light-gray);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.media-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}

.media-admin-file {
  background: var(--color-bg-card);
  border: 1px solid var(--color-cream-dark);
  border-radius: var(--radius-md);
  overflow: hidden;
  min-width: 0;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast);
}

.media-admin-file:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(212, 170, 174, 0.35);
}

.media-admin-preview {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--color-cream-dark);
  color: var(--color-light-gray);
  overflow: hidden;
}

.media-admin-preview img,
.media-admin-preview video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.media-admin-preview video {
  background: #111;
}

.media-admin-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.media-admin-file-body {
  padding: 0.875rem;
}

.media-admin-file-title {
  margin-bottom: 0.5rem;
  color: var(--color-charcoal);
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-admin-file-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--color-text-light);
  font-size: 0.75rem;
  line-height: 1.4;
}

.media-admin-file-meta + .media-admin-file-meta {
  margin-top: 0.35rem;
}

.media-admin-download {
  display: inline-flex;
  color: var(--color-gold-dark);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.media-admin-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.media-admin-delete {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-danger);
}

.media-admin-delete:hover {
  background: rgba(201, 113, 113, 0.12);
}

.media-admin-delete svg {
  width: 16px;
  height: 16px;
}

.media-empty-state {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
}

@media (max-width: 900px) {
  .media-admin-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .media-guest-header,
  .media-upload-admin-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .media-admin-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-block;
  padding: 0.3rem 0.875rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-confirmed {
  background-color: rgba(122, 143, 116, 0.15);
  color: var(--color-sage-dark);
}

.badge-declined {
  background-color: rgba(201, 113, 113, 0.15);
  color: var(--color-danger);
}

.badge-pending {
  background-color: rgba(212, 170, 174, 0.15);
  color: var(--color-gold-dark);
}

/* ============================================
   COPY BOX
   ============================================ */
.copy-box {
  background: var(--color-cream);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.copy-box-text {
  flex: 1;
  font-size: 0.875rem;
  color: var(--color-warm-gray);
  line-height: 1.6;
  word-break: normal;
  overflow-wrap: anywhere;
}

/* ============================================
   GUEST LIST
   ============================================ */
.guest-list {
  list-style: none;
}

.guest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-cream-dark);
}

.guest-item:last-child {
  border-bottom: none;
}

.guest-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}

.guest-name {
  font-family: var(--font-display);
  font-size: 1.125rem;
}

.guest-secondary-fields {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.guest-age-input {
  width: 5.5rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 6px);
  font-size: 0.8125rem;
  font-family: inherit;
  color: var(--color-warm-gray);
  background-color: white;
  text-align: center;
  transition: all var(--transition-fast);
  -moz-appearance: textfield;
}

.guest-age-input::-webkit-outer-spin-button,
.guest-age-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.guest-age-input::placeholder {
  color: var(--color-light-gray);
  font-style: italic;
}

.guest-age-input:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(212, 170, 174, 0.15);
  color: var(--color-charcoal);
}

.guest-age-input.htmx-request {
  opacity: 0.7;
}

.drink-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.drink-toggle-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.drink-toggle-track {
  position: relative;
  display: inline-flex;
  width: 2rem;
  height: 1.125rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--color-cream-dark);
  border: 1px solid var(--color-border);
  transition: all var(--transition-fast);
}

.drink-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: white;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.drink-toggle-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-light-gray);
}

.drink-toggle-on .drink-toggle-track {
  background: var(--color-sage);
  border-color: var(--color-sage-dark);
}

.drink-toggle-on .drink-toggle-thumb {
  transform: translateX(0.875rem);
}

.drink-toggle-on .drink-toggle-label {
  color: var(--color-sage-dark);
}

.drink-toggle.htmx-request {
  opacity: 0.7;
}

.guest-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* Guest Input for Create Form */
.guest-input-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.guest-input-row {
  display: flex;
  gap: 1rem;
}

.guest-input-row input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 1rem;
}

.guest-input-row input:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(212, 170, 174, 0.15);
}

/* Guest Add Form (Edit Mode) */
.guest-add-form {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.guest-add-form input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 1rem;
}

.guest-add-form input:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(212, 170, 174, 0.15);
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-cream-dark);
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */
@media (max-width: 1024px) {
  .admin-sidebar {
    width: 220px;
  }

  .admin-main {
    margin-left: 220px;
    padding: 2rem;
  }

}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 768px) {
  /* Base typography adjustments */
  html {
    font-size: 15px;
  }

  h1 {
    font-size: 2rem;
  }
  h2 {
    font-size: 1.5rem;
  }
  h3 {
    font-size: 1.25rem;
  }

  /* Admin Layout */
  .admin-sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }

  .admin-main {
    margin-left: 0;
    padding: 1.5rem 1rem;
  }

  .admin-layout {
    flex-direction: column;
  }

  .sidebar-header {
    padding: 1rem 1.25rem;
  }

  .sidebar-header h2 {
    font-size: 1.25rem;
  }

  .sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .sidebar-nav .nav-link {
    padding: 0.625rem 1rem;
    border-radius: var(--radius-sm);
  }

  .sidebar-nav .nav-link.active {
    border-left: none;
    background: var(--color-gold-dark);
    border-radius: var(--radius-sm);
  }

  .sidebar-mode-form {
    padding: 0 1.25rem 0.75rem;
  }

  .sidebar-mode-toggle {
    display: inline-grid;
  }

  .sidebar-footer {
    display: flex;
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .sidebar-footer .nav-link {
    padding: 0.625rem 1rem;
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .stat-card {
    padding: 1.25rem;
  }

  .stat-card .stat-number {
    font-size: 2rem;
  }

  /* Invitation Page */
  .invitation-container {
    padding: 2rem 1rem;
  }

  .invitation-header {
    margin-bottom: 2rem;
  }

  .invitation-header h1 {
    font-size: 2rem;
    letter-spacing: 0.05em;
  }

  .invitation-header img {
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
  }

  .invitation-body {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
  }

  .invitation-rsvp {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
  }

  .invitation-rsvp h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }

  .rsvp-guest {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    text-align: center;
  }

  .rsvp-guest-name {
    font-size: 1.125rem;
  }

  .rsvp-buttons {
    width: 100%;
    justify-content: center;
  }

  .rsvp-btn {
    flex: 1;
    padding: 0.75rem 1rem;
  }

  /* Login Page */
  .login-card {
    padding: 2rem 1.5rem;
    margin: 1rem;
  }

  .login-card h1 {
    font-size: 1.75rem;
  }

  /* Cards */
  .card {
    padding: 1.25rem;
    border-radius: var(--radius-md);
  }

  .card h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
  }

  /* Tables */
  .table-container {
    border-radius: var(--radius-md);
    overflow-x: auto;
  }

  table {
    min-width: 500px;
  }

  th,
  td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }

  /* Forms */
  .form-group {
    margin-bottom: 1.25rem;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 0.75rem;
    font-size: 1rem;
  }

  .form-group textarea {
    min-height: 120px;
  }

  .gift-form-grid {
    flex-direction: column;
    gap: 1rem;
  }

  .gift-form-image {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }

  .gift-form-fields {
    gap: 0.5rem;
  }

  .gift-form-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  .image-upload-container {
    flex-direction: column;
    gap: 1rem;
  }

  .image-preview {
    width: 100%;
    height: 180px;
  }

  /* Guest Input */
  .guest-input-row {
    flex-direction: column;
    gap: 0.75rem;
  }

  .guest-add-form {
    flex-direction: column;
    gap: 0.75rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  /* Buttons */
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.8125rem;
  }

  .btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.6875rem;
  }

  /* Copy Box */
  .copy-box {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
  }

  .copy-box .btn {
    width: 100%;
  }

  /* Guest List */
  .guest-item {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
    padding: 1rem 0;
  }

  .guest-info {
    align-items: center;
  }

  .guest-actions {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ============================================
   RESPONSIVE - SMALL MOBILE
   ============================================ */
@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .invitation-header h1 {
    font-size: 1.75rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .rsvp-buttons {
    flex-direction: column;
    gap: 0.5rem;
  }

  .rsvp-btn {
    width: 100%;
  }

  .invitation-body,
  .invitation-rsvp {
    padding: 1.25rem;
  }

  .admin-main h1 {
    font-size: 1.5rem;
  }
}

/* ============================================
   LOADING STATES & SPINNERS
   ============================================ */

/* Spinner animation */
@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner 0.75s linear infinite;
  vertical-align: middle;
}

.spinner-sm {
  width: 0.875em;
  height: 0.875em;
  border-width: 1.5px;
}

.spinner-gold {
  border-color: var(--color-gold);
  border-right-color: transparent;
}

.spinner-white {
  border-color: white;
  border-right-color: transparent;
}

/* HTMX indicators */
.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator {
  display: inline-block;
}

.htmx-request.htmx-indicator {
  display: inline-block;
}

/* Loading overlay for elements */
.htmx-request {
  position: relative;
  pointer-events: none;
}

.htmx-request::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.6);
  border-radius: inherit;
}

/* Button loading state */
.btn.htmx-request,
.btn.loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn.htmx-request::before,
.btn.loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.25em;
  height: 1.25em;
  margin: -0.625em 0 0 -0.625em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner 0.75s linear infinite;
}

.btn-primary.htmx-request::before,
.btn-primary.loading::before {
  border-color: white;
  border-right-color: transparent;
}

.btn-secondary.htmx-request::before,
.btn-secondary.loading::before {
  border-color: var(--color-gold);
  border-right-color: transparent;
}

.btn.htmx-request::after,
.btn.loading::after {
  display: none;
}

/* RSVP button loading */
.rsvp-btn.htmx-request {
  color: transparent !important;
  pointer-events: none;
}

/* Keep the checkmark/X glyph rendered during loading so the button keeps its
   intrinsic width — the inherited transparent color hides it visually without
   shifting the layout. */

/* Use ::after for the spinner since ::before is used for icons */
.rsvp-btn.htmx-request::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1em;
  height: 1em;
  margin: -0.5em 0 0 -0.5em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spinner 0.75s linear infinite;
}

.rsvp-btn-confirm.htmx-request::after {
  border-color: #5d8a72;
  border-right-color: transparent;
}

.rsvp-btn-decline.htmx-request::after {
  border-color: #8a7278;
  border-right-color: transparent;
}

/* Form submission loading */
form.htmx-request input,
form.htmx-request textarea,
form.htmx-request select,
form.htmx-request button {
  opacity: 0.6;
  pointer-events: none;
}

/* Table row loading (for delete) */
tr.htmx-request {
  opacity: 0.5;
}

tr.htmx-request::after {
  display: none;
}

/* Guest item loading */
.guest-item.htmx-request {
  opacity: 0.5;
}

.guest-item.htmx-request::after {
  display: none;
}

/* Pulse animation for subtle loading feedback */
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading-pulse {
  animation: pulse 1.5s ease-in-out infinite;
}

/* ============================================
   DECORATIVE ELEMENTS
   ============================================ */
.ornament {
  text-align: center;
  margin: 2rem 0;
  color: var(--color-gold-light);
  font-size: 1.5rem;
  letter-spacing: 0.5em;
}

.divider {
  width: 80px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--color-gold),
    transparent
  );
  margin: 2rem auto;
}

/* ============================================
   GUEST LIST CONTROLS & GROUPED VIEW
   ============================================ */
.guest-list-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.guest-list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.guest-list-heading h2 {
  margin-bottom: 0;
}

.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.copy-names-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--color-gold-dark);
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast);
}

.copy-names-btn:hover {
  background: var(--color-cream);
  border-color: var(--color-gold);
}

.copy-names-btn:active {
  transform: translateY(1px);
}

.copy-names-btn-confirmed {
  color: var(--color-sage-dark);
  border-color: rgba(122, 143, 116, 0.4);
}

.copy-names-btn-confirmed:hover {
  background: rgba(156, 170, 151, 0.1);
  border-color: var(--color-sage-dark);
}

.copy-names-btn-declined {
  color: #8a7278;
  border-color: rgba(138, 114, 120, 0.4);
}

.copy-names-btn-declined:hover {
  background: rgba(138, 114, 120, 0.08);
  border-color: #8a7278;
}

.copy-names-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.copy-names-icon-success {
  display: none;
}

.copy-names-btn.copied {
  color: var(--color-sage-dark);
  border-color: var(--color-sage);
  background: rgba(156, 170, 151, 0.1);
}

.copy-names-btn.copied .copy-names-icon-default {
  display: none;
}

.copy-names-btn.copied .copy-names-icon-success {
  display: inline-block;
}

.copy-names-btn.copy-error {
  color: var(--color-danger);
  border-color: var(--color-danger);
  background: rgba(201, 113, 113, 0.08);
}

@media (max-width: 640px) {
  .list-toolbar {
    justify-content: stretch;
  }

  .copy-names-btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

.view-toggle {
  display: flex;
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.view-btn {
  padding: 0.625rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-warm-gray);
  background: white;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.view-btn:hover {
  background: var(--color-cream);
}

.view-btn.active {
  background: var(--color-gold);
  color: white;
}

.sort-controls,
.filter-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sort-controls label,
.filter-controls label {
  font-size: 0.875rem;
  color: var(--color-warm-gray);
  font-weight: 500;
}

.sort-controls select,
.filter-controls select {
  padding: 0.625rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-family: inherit;
  background-color: white;
  cursor: pointer;
  transition: all var(--transition-fast);
  min-width: 180px;
}

.sort-controls select:focus,
.filter-controls select:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(212, 170, 174, 0.15);
}

.invitation-title {
  vertical-align: middle;
}

.tag {
  display: inline-flex;
  align-items: center;
  margin-left: 0.5rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  line-height: 1.4;
  border: 1px solid transparent;
}

.tag-sent {
  background-color: rgba(122, 143, 116, 0.12);
  color: var(--color-sage-dark);
  border-color: rgba(122, 143, 116, 0.28);
}

.tag-reminder-sent {
  background-color: rgba(212, 170, 174, 0.16);
  color: var(--color-gold-dark);
  border-color: rgba(212, 170, 174, 0.38);
}

.tag-reminder-pending {
  background-color: rgba(174, 163, 146, 0.1);
  color: var(--color-warm-gray);
  border-color: rgba(174, 163, 146, 0.28);
}

.table-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Invitation Group Cards */
.invitation-group {
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.75rem;
  border: 1px solid rgba(212, 170, 174, 0.1);
  overflow: hidden;
}

.invitation-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  transition: background-color var(--transition-fast);
  background: var(--color-cream);
  border-bottom: 1px solid var(--color-cream-dark);
}

.invitation-group-header:hover {
  background: var(--color-cream-dark);
}

.invitation-group-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.invitation-group-title {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 400;
  color: var(--color-charcoal);
  margin: 0;
}

.invitation-group-stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.group-toggle-icon {
  margin-left: 0.75rem;
  color: var(--color-light-gray);
  transition: transform var(--transition-fast);
  font-size: 0.75rem;
}

.invitation-group.collapsed .group-toggle-icon {
  transform: rotate(-90deg);
}

.invitation-group-guests {
  padding: 0.25rem 0;
  transition:
    max-height var(--transition-smooth),
    opacity var(--transition-smooth);
}

.invitation-group.collapsed .invitation-group-guests {
  display: none;
}

.guest-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1.25rem;
  border-bottom: 1px solid var(--color-cream-dark);
}

.guest-row:last-child {
  border-bottom: none;
}

.guest-row:hover {
  background: var(--color-cream);
}

.guest-row-name {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  color: var(--color-charcoal);
}

.guest-row-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Table Assignment Cards */
.table-assignment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.table-assignment-card {
  background: white;
  border: 1px solid rgba(212, 170, 174, 0.14);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-assignment-unassigned {
  border-style: dashed;
}

.table-assignment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
  background: var(--color-cream);
  border-bottom: 1px solid var(--color-cream-dark);
}

.table-assignment-header h2 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
}

.table-assignment-header p {
  margin: 0;
  color: var(--color-text-light);
  font-size: 0.875rem;
}

.table-assignment-invitations {
  display: flex;
  flex-direction: column;
}

.table-assignment-invitation {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-cream-dark);
}

.table-assignment-invitation:last-child {
  border-bottom: none;
}

.table-assignment-invitation-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.table-assignment-invitation-header a {
  font-family: var(--font-display);
  font-size: 1.0625rem;
}

.table-assignment-invitation-header span,
.table-assignment-empty {
  color: var(--color-text-light);
  font-size: 0.8125rem;
}

.table-assignment-empty {
  margin: 0;
}

.table-assignment-guests {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.table-assignment-guests li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

/* Empty State */
.empty-state {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 3rem 2rem;
  text-align: center;
  color: var(--color-light-gray);
}

/* Mobile Responsive for Guest List Controls */
@media (max-width: 768px) {
  .guest-list-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .view-toggle {
    width: 100%;
  }

  .view-btn {
    flex: 1;
    text-align: center;
  }

  .sort-controls,
  .filter-controls {
    width: 100%;
    justify-content: space-between;
  }

  .sort-controls select,
  .filter-controls select {
    flex: 1;
    min-width: 0;
  }

  .invitation-group-header {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .invitation-group-stats {
    width: 100%;
    justify-content: flex-start;
  }

  .group-toggle-icon {
    margin-left: auto;
  }

  .guest-row {
    padding: 0.75rem 1rem;
  }

  .guest-row-name {
    font-size: 1rem;
  }
}

/* ============================================
   STATUS SELECT DROPDOWN
   ============================================ */
.status-select {
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b6358' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  padding-right: 1.75rem;
  min-width: 120px;
}

.status-select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 170, 174, 0.2);
}

.status-select-pending {
  background-color: rgba(212, 170, 174, 0.15);
  color: var(--color-gold-dark);
  border-color: rgba(212, 170, 174, 0.3);
}

.status-select-pending:hover,
.status-select-pending:focus {
  border-color: var(--color-gold);
}

.status-select-confirmed {
  background-color: rgba(122, 143, 116, 0.15);
  color: var(--color-sage-dark);
  border-color: rgba(122, 143, 116, 0.3);
}

.status-select-confirmed:hover,
.status-select-confirmed:focus {
  border-color: var(--color-sage-dark);
}

.status-select-declined {
  background-color: rgba(201, 113, 113, 0.15);
  color: var(--color-danger);
  border-color: rgba(201, 113, 113, 0.3);
}

.status-select-declined:hover,
.status-select-declined:focus {
  border-color: var(--color-danger);
}

/* Loading state for status select */
.status-select.htmx-request {
  opacity: 0.6;
  pointer-events: none;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .status-select {
    font-size: 0.6875rem;
    padding: 0.3rem 0.5rem;
    padding-right: 1.5rem;
    min-width: 100px;
  }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  pointer-events: none;
}

.toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  background:
    linear-gradient(180deg, var(--color-paper) 0%, var(--color-paper-aged) 100%);
  padding: 0.875rem 1.375rem 0.875rem 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-gold-light);
  box-shadow:
    0 1px 2px rgba(60, 50, 40, 0.04),
    0 4px 12px rgba(60, 50, 40, 0.06),
    0 16px 40px rgba(165, 113, 123, 0.18);
  max-width: min(90vw, 440px);
  min-width: 280px;
  text-align: left;
  pointer-events: auto;
  overflow: hidden;
  animation: toast-slide-in 0.5s cubic-bezier(0.34, 1.25, 0.64, 1);
}

.toast::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(
    180deg,
    var(--color-gold-light) 0%,
    var(--color-gold) 50%,
    var(--color-gold-light) 100%
  );
}

.toast-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(212, 170, 174, 0.18);
  color: var(--color-gold-dark);
  box-shadow: inset 0 0 0 1px rgba(212, 170, 174, 0.25);
}

.toast-icon-svg {
  width: 1.125rem;
  height: 1.125rem;
}

.toast-message {
  flex: 1 1 auto;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-style: italic;
  color: var(--color-ink);
  line-height: 1.45;
  letter-spacing: 0.005em;
}

.toast-success::before {
  background: linear-gradient(
    180deg,
    rgba(156, 170, 151, 0.4) 0%,
    var(--color-sage-dark) 50%,
    rgba(156, 170, 151, 0.4) 100%
  );
}

.toast-success .toast-icon {
  background: rgba(122, 143, 116, 0.16);
  color: var(--color-sage-dark);
  box-shadow: inset 0 0 0 1px rgba(122, 143, 116, 0.22);
}

.toast-warning::before {
  background: linear-gradient(
    180deg,
    rgba(212, 165, 165, 0.4) 0%,
    var(--color-rose) 50%,
    rgba(212, 165, 165, 0.4) 100%
  );
}

.toast-warning .toast-icon {
  background: rgba(212, 165, 165, 0.2);
  color: var(--color-gold-dark);
  box-shadow: inset 0 0 0 1px rgba(212, 165, 165, 0.3);
}

.toast.toast-hide {
  animation: toast-slide-out 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes toast-slide-in {
  0% {
    opacity: 0;
    transform: translateY(1.25rem) scale(0.96);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-slide-out {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(0.75rem) scale(0.98);
  }
}

@media (max-width: 768px) {
  .toast-container {
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    transform: none;
  }

  .toast {
    min-width: auto;
    width: 100%;
    padding: 0.8125rem 1.125rem 0.8125rem 0.875rem;
    gap: 0.75rem;
  }

  .toast-icon {
    width: 2rem;
    height: 2rem;
  }

  .toast-icon-svg {
    width: 1rem;
    height: 1rem;
  }

  .toast-message {
    font-size: 0.9375rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: toast-fade-in 0.2s ease-out;
  }

  .toast.toast-hide {
    animation: toast-fade-out 0.2s ease-out forwards;
  }

  @keyframes toast-fade-in {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  @keyframes toast-fade-out {
    from {
      opacity: 1;
    }
    to {
      opacity: 0;
    }
  }
}

/* ============================================
   ADMIN TOOLBAR (Search + Sort)
   ============================================ */
.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.admin-toolbar-compact {
  margin: 0 0 1rem;
}

.admin-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 220px;
  max-width: 360px;
}

.admin-search svg {
  position: absolute;
  left: 0.875rem;
  color: var(--color-light-gray);
  pointer-events: none;
}

.admin-search input {
  width: 100%;
  padding: 0.625rem 0.875rem 0.625rem 2.375rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-family: inherit;
  background-color: white;
  transition: all var(--transition-fast);
}

.admin-search input:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(212, 170, 174, 0.15);
}

.admin-search input::-webkit-search-cancel-button {
  cursor: pointer;
}

.empty-filter-msg {
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--color-text-light);
  font-size: 0.9375rem;
}

@media (max-width: 640px) {
  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-search {
    max-width: none;
  }

  .admin-toolbar .sort-controls,
  .admin-toolbar .filter-controls {
    justify-content: space-between;
  }

  .admin-toolbar .sort-controls select,
  .admin-toolbar .filter-controls select {
    flex: 1;
    min-width: 0;
  }
}

/* ============================================
   FOOTER
   ============================================ */
.footer-credit {
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-style: italic;
  letter-spacing: 0.03em;
  color: var(--color-text-light);
  padding: 2rem 1rem 1.5rem;
  margin: 0;
}
