/* ========================================
   Ethernal Memories — Softly Theme
   ======================================== */

/* ---- Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Reenie+Beanie&display=swap');

/* ---- CSS Variables ---- */
:root {
  --bg: #FDFCF8;
  --sage: #E8EFE8;
  --lavender: #EFEDF4;
  --coral: #FFB7B2;
  --dark: #292524;
  --muted: #78716C;
  --stone-50: #F5F5F4;
  --stone-100: #E7E5E4;
  --stone-200: #D6D3D1;
  --stone-300: #A8A29E;
  --stone-400: #78716C;
  --stone-500: #57534E;
  --stone-600: #44403C;
  --stone-700: #292524;
  --stone-800: #1C1917;
  --white: #FFFFFF;
  --radius-sm: 16px;
  --radius-md: 24px;
  --radius-lg: 32px;
  --radius-xl: 48px;
  --radius-full: 9999px;
  --shadow-soft: 0 4px 20px -2px rgba(0,0,0,0.05);
  --shadow-coral: 0 4px 20px -2px rgba(255, 183, 178, 0.3);
  --font-primary: 'Outfit', sans-serif;
  --font-accent: 'Reenie Beanie', cursive;
  --transition-slow: 0.5s ease;
  --transition-normal: 0.3s ease;
  --transition-fast: 0.15s ease;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg);
  color: var(--dark);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: inherit;
}

input, button, textarea, select {
  font: inherit;
}

/* ---- Skip Link ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 12px 24px;
  background: var(--dark);
  color: white;
  z-index: 100;
  border-radius: 8px;
}

/* ---- Floating Nav ---- */
.floating-nav {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-full);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-soft);
  max-width: 1200px;
  margin: 0 auto;
}

.floating-nav .logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.floating-nav .logo-icon {
  width: 32px;
  height: 32px;
}

.floating-nav .logo-text {
  font-weight: 600;
  font-size: 16px;
  color: var(--dark);
  letter-spacing: -0.025em;
}

.floating-nav .nav-links {
  display: none;
  align-items: center;
  gap: 24px;
  list-style: none;
}

.floating-nav .nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--stone-600);
  transition: color var(--transition-fast);
}

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

.floating-nav .nav-cta {
  background: var(--dark);
  color: white;
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.floating-nav .nav-cta:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-soft);
}

@media (min-width: 768px) {
  .floating-nav {
    padding: 12px 32px;
    top: 24px;
    left: 24px;
    right: 24px;
  }

  .floating-nav .nav-links {
    display: flex;
  }
}

/* ---- Hero Section ---- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  overflow: hidden;
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  z-index: 0;
  pointer-events: none;
}

.hero-blob-1 {
  width: 400px;
  height: 400px;
  background: #FFE4E1;
  top: -100px;
  right: -100px;
  animation: float 6s ease-in-out infinite;
}

.hero-blob-2 {
  width: 350px;
  height: 350px;
  background: #E6E6FA;
  bottom: -100px;
  left: -100px;
  animation: float 6s ease-in-out infinite 2s;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero h1 {
  font-size: clamp(48px, 10vw, 96px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--dark);
  margin-bottom: 16px;
}

.hero h1 .accent-cursive {
  font-family: var(--font-accent);
  font-weight: 400;
  font-size: 1.15em;
  color: var(--stone-500);
  letter-spacing: 0;
}

.hero p {
  font-size: 18px;
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto 40px;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.hero-actions .btn {
  padding: 16px 32px;
  border-radius: var(--radius-full);
  font-size: 16px;
  font-weight: 500;
  border: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
  justify-content: center;
}

.hero-actions .btn-primary {
  background: var(--coral);
  color: var(--dark);
  box-shadow: var(--shadow-coral);
}

.hero-actions .btn-primary:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 24px -2px rgba(255, 183, 178, 0.4);
}

.hero-actions .btn-secondary {
  background: var(--white);
  color: var(--dark);
  border: 1px solid var(--stone-200);
}

.hero-actions .btn-secondary:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-soft);
}

@media (min-width: 768px) {
  .hero {
    padding: 140px 32px 100px;
  }

  .hero-actions {
    flex-direction: row;
    justify-content: center;
  }

  .hero-blob-1 {
    width: 500px;
    height: 500px;
  }

  .hero-blob-2 {
    width: 450px;
    height: 450px;
  }
}

/* ---- Search Section ---- */
.search-section {
  padding: 80px 24px;
  text-align: center;
}

.search-section h2 {
  font-size: 28px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--dark);
  letter-spacing: -0.02em;
}

.search-section > p {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 24px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

.memory-search-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 440px;
  margin: 0 auto;
}

.memory-search-form input {
  padding: 16px 24px;
  border-radius: var(--radius-full);
  border: 1px solid var(--stone-200);
  background: var(--stone-50);
  font-size: 16px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.memory-search-form input:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(255, 183, 178, 0.2);
}

.memory-search-form button {
  padding: 16px 24px;
  border-radius: var(--radius-full);
  background: var(--dark);
  color: white;
  font-weight: 500;
  border: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.memory-search-form button:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-soft);
}

@media (min-width: 768px) {
  .memory-search-form {
    flex-direction: row;
    max-width: 480px;
  }

  .memory-search-form input {
    flex: 1;
  }
}

/* ---- Recent Memories ---- */
.recent-memories-section {
  padding: 0 24px 80px;
  max-width: 600px;
  margin: 0 auto;
}

.recent-memories-section h2 {
  font-size: 22px;
  font-weight: 500;
  color: var(--stone-600);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.recent-memories-section article {
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.recent-memories-section article:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px -4px rgba(0,0,0,0.08);
}

.recent-memories-section article a {
  display: flex;
  gap: 16px;
  padding: 20px;
  align-items: flex-start;
}

.recent-memories-section article img {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.recent-memories-section article h3 {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--dark);
}

.recent-memories-section article time {
  font-size: 13px;
  color: var(--stone-400);
  display: block;
}

.recent-memories-section article p {
  font-size: 13px;
  color: var(--stone-500);
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Horizontal Scroll Section ---- */
.scenario-section {
  padding: 80px 0;
}

.scenario-section .section-header {
  padding: 0 24px;
  margin-bottom: 24px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.scenario-section .section-header h2 {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.scenario-section .section-header p {
  color: var(--muted);
  font-size: 16px;
}

.scenario-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 0 24px 16px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--stone-200) transparent;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.scenario-scroll::-webkit-scrollbar {
  height: 6px;
}

.scenario-scroll::-webkit-scrollbar-thumb {
  background: var(--stone-200);
  border-radius: 3px;
}

.scenario-card {
  flex: 0 0 288px;
  height: 160px;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-soft);
  scroll-snap-align: start;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  cursor: pointer;
}

.scenario-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px -4px rgba(0,0,0,0.08);
}

.scenario-card .card-time {
  font-size: 14px;
  color: var(--stone-400);
}

.scenario-card .card-text {
  font-size: 20px;
  font-weight: 500;
  color: var(--stone-700);
  transition: color var(--transition-normal);
}

.scenario-card .card-text .card-accent {
  display: block;
  font-family: var(--font-accent);
  font-size: 1.2em;
  font-weight: 400;
  color: var(--stone-400);
}

.scenario-card:hover .card-text {
  color: var(--coral);
}

/* ---- How It Works Steps ---- */
.steps-section {
  padding: 80px 0;
  text-align: center;
}

.steps-section h2 {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 48px;
}

.steps-section > p {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 48px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.steps-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 640px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .steps-grid {
    flex-direction: row;
    gap: 24px;
    max-width: 960px;
  }
}

.step-card {
  flex: 1;
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 40px 28px;
  box-shadow: var(--shadow-soft);
  text-align: center;
  transition: box-shadow var(--transition-normal), scale var(--transition-normal);
  scale: 1;
}

.step-card:hover {
  scale: 1.03;
  box-shadow: 0 8px 30px -4px rgba(0,0,0,0.08);
}

.step-number {
  width: 48px;
  height: 48px;
  background: var(--coral);
  color: var(--dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  margin: 0 auto 20px;
}

.step-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--dark);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.step-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}

/* ---- Testimonials Section ---- */
.testimonials {
  padding: 80px 24px;
}

.testimonials h2 {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 40px;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.testimonial-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-soft);
  transform: rotate(var(--rot, 0deg));
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.testimonial-card:hover {
  transform: rotate(var(--rot, 0deg)) translateY(-4px);
  box-shadow: 0 8px 30px -4px rgba(0,0,0,0.08);
}

.testimonial-card:nth-child(odd) {
  --rot: 1deg;
}

.testimonial-card:nth-child(even) {
  --rot: -1deg;
}

.testimonial-card .quote {
  font-size: 16px;
  color: var(--stone-600);
  line-height: 1.7;
  margin-bottom: 20px;
}

.testimonial-card .signature-line {
  width: 32px;
  height: 2px;
  background: var(--stone-300);
  margin-bottom: 12px;
}

.testimonial-card .signature-name {
  font-family: var(--font-accent);
  font-size: 24px;
  color: var(--stone-500);
}

@media (min-width: 768px) {
  .testimonials-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---- Community Section ---- */
.community {
  padding: 100px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.community-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.community-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.4;
}

.community-blob-1 {
  width: 500px;
  height: 500px;
  background: var(--coral);
  top: -200px;
  right: -100px;
  animation: float 8s ease-in-out infinite;
}

.community-blob-2 {
  width: 400px;
  height: 400px;
  background: var(--lavender);
  bottom: -150px;
  left: -100px;
  animation: float 8s ease-in-out infinite 3s;
}

.community-content {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
}

.community-icon {
  width: 64px;
  height: 64px;
  background: var(--dark);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  position: relative;
}

.community-icon::after {
  content: '';
  width: 12px;
  height: 12px;
  background: var(--coral);
  border-radius: 50%;
  position: absolute;
  top: 16px;
  right: 16px;
}

.community h2 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
}

.community p {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 32px;
  line-height: 1.5;
}

/* ---- FAQ Section ---- */
.faq-section {
  padding: 80px 24px;
  max-width: 720px;
  margin: 0 auto;
}

.faq-section h2 {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 40px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--stone-100);
  overflow: hidden;
}

.faq-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 24px;
  background: none;
  border: none;
  font-size: 16px;
  font-weight: 500;
  color: var(--dark);
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast);
  list-style: none;
}

.faq-header::-webkit-details-marker {
  display: none;
}

.faq-header::marker {
  display: none;
}

.faq-header:hover {
  background: var(--stone-50);
}

.faq-icon {
  width: 20px;
  height: 20px;
  position: relative;
  flex-shrink: 0;
  margin-left: 16px;
  transition: transform 0.5s ease;
}

.faq-item[open] .faq-icon {
  transform: rotate(45deg);
}

.faq-icon::before,
.faq-icon::after {
  content: '';
  position: absolute;
  background: var(--stone-400);
  border-radius: 1px;
  top: 50%;
  left: 50%;
}

.faq-icon::before {
  width: 100%;
  height: 2px;
  transform: translate(-50%, -50%);
}

.faq-icon::after {
  width: 2px;
  height: 100%;
  transform: translate(-50%, -50%);
}

.faq-content {
  padding: 0 24px 24px;
  color: var(--stone-500);
  line-height: 1.7;
  font-size: 15px;
}

/* ---- Footer ---- */
.site-footer {
  padding: 40px 24px;
  text-align: center;
  border-top: 1px solid var(--stone-100);
  color: var(--stone-400);
  font-size: 14px;
}

.site-footer nav {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.site-footer nav a {
  font-size: 14px;
  color: var(--stone-500);
  transition: color var(--transition-fast);
}

.site-footer nav a:hover {
  color: var(--dark);
}

/* ---- Reveal on Scroll Animation ---- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Float Animation ---- */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ---- Screen Reader Only ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Creator Page Layout ---- */
.creator-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 100px 24px 60px;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
  margin-bottom: 24px;
}

.breadcrumb a {
  font-size: 14px;
  font-weight: 500;
  color: var(--stone-500);
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--dark);
}

/* ---- Generic Button Variants ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 500;
  border: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  transform: scale(1.02);
}

.btn-primary {
  background: var(--coral);
  color: var(--dark);
  box-shadow: var(--shadow-coral);
}

.btn-primary:hover {
  box-shadow: 0 6px 24px -2px rgba(255, 183, 178, 0.4);
}

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

.btn-dark:hover {
  box-shadow: var(--shadow-soft);
}

.btn-danger {
  background: transparent;
  color: #DC2626;
  border: 1px solid #FECACA;
}

.btn-danger:hover {
  background: #FEF2F2;
}

.btn-ghost {
  background: transparent;
  color: var(--stone-500);
  border: 1px solid var(--stone-200);
}

.btn-ghost:hover {
  background: var(--stone-50);
  box-shadow: var(--shadow-soft);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

/* ---- Login Card ---- */
.login-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 48px 32px;
  box-shadow: var(--shadow-soft);
  max-width: 420px;
  margin: 0 auto;
}

.login-card h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 32px;
  text-align: center;
}

.login-card .form-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

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

/* ---- Dashboard ---- */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 40px;
}

.dashboard-header h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.dashboard-header .header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.dashboard-memories {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-memories .memory-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.dashboard-memories .memory-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px -4px rgba(0,0,0,0.08);
}

.dashboard-memories .memory-card a {
  display: flex;
  gap: 16px;
  padding: 20px;
  align-items: flex-start;
}

.dashboard-memories .memory-card img {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.dashboard-memories .memory-card h3 {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--dark);
}

.dashboard-memories .memory-card time {
  font-size: 13px;
  color: var(--stone-400);
  display: block;
}

.dashboard-memories .memory-card p {
  font-size: 13px;
  color: var(--stone-500);
  margin-top: 6px;
}

/* ---- Creator Form ---- */
.creator-form {
  max-width: 600px;
}

.creator-form h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 32px;
}

.creator-form .form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* ---- Form Fields ---- */
.form-field {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--stone-600);
  margin-bottom: 6px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--stone-200);
  background: var(--stone-50);
  font-size: 15px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  font-family: var(--font-primary);
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(255, 183, 178, 0.2);
}

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

/* ---- Template Fieldset ---- */
.template-fieldset {
  border: 1px solid var(--stone-100);
  border-radius: var(--radius-sm);
  padding: 24px;
  margin-bottom: 20px;
}

.template-fieldset legend {
  font-size: 14px;
  font-weight: 600;
  color: var(--stone-600);
  padding: 0 8px;
}

.template-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.template-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--stone-100);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.template-option:hover {
  border-color: var(--coral);
  background: rgba(255, 183, 178, 0.05);
}

.template-option img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.template-option input[type="checkbox"] {
  accent-color: var(--coral);
  width: 18px;
  height: 18px;
}

.template-option label {
  font-size: 14px;
  font-weight: 500;
  color: var(--dark);
  cursor: pointer;
  flex: 1;
}

.template-option span {
  display: block;
  font-size: 12px;
  color: var(--stone-400);
  font-weight: 400;
}

/* ---- Image Upload ---- */
.image-upload-area {
  margin-bottom: 20px;
}

.image-upload-area .file-input-wrapper {
  position: relative;
  border: 2px dashed var(--stone-200);
  border-radius: var(--radius-sm);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.image-upload-area .file-input-wrapper:hover {
  border-color: var(--coral);
  background: rgba(255, 183, 178, 0.03);
}

.image-upload-area .file-input-wrapper input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.image-upload-area .file-input-text {
  font-size: 14px;
  color: var(--stone-400);
}

.image-upload-area .file-input-text strong {
  color: var(--stone-600);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.image-preview {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--stone-50);
}

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

.image-preview .delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.image-preview .delete-btn::before {
  content: '\00D7';
}

.delete-checkbox:checked + .delete-btn::before {
  content: '\21BA';
}

.image-preview:hover .delete-btn {
  opacity: 1;
}

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

.delete-checkbox:checked ~ img {
  opacity: 0.3;
  filter: grayscale(1);
}

.delete-checkbox:checked ~ .delete-btn {
  opacity: 1;
  z-index: 2;
}

.image-preview:has(.delete-checkbox:checked)::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  border-radius: 12px;
  z-index: 1;
}

.image-preview.pending .pending-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 2;
  background: var(--coral);
  color: var(--dark);
  padding: 4px 14px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  pointer-events: none;
}

.image-preview.pending .delete-btn {
  opacity: 1;
  z-index: 2;
}

/* ---- Memory View (Buyer) ---- */
.memory-view {
  max-width: 720px;
  margin: 0 auto;
  padding: 100px 24px 60px;
}

.memory-view h1 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}

.memory-info {
  margin-bottom: 32px;
}

.memory-code {
  font-size: 14px;
  color: var(--stone-500);
  margin-bottom: 8px;
  padding: 8px 16px;
  background: var(--stone-50);
  border-radius: 8px;
  display: inline-block;
}

.memory-description {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
}

.placeholder-text {
  font-size: 15px;
  color: var(--stone-400);
  text-align: center;
  padding: 40px 24px;
}

/* ---- Product Grid (Buyer) ---- */
.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}

.product-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  border: 1px solid transparent;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px -4px rgba(0,0,0,0.08);
}

.product-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 12px;
}

.product-card label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin-bottom: 8px;
}

.product-card input[type="checkbox"] {
  accent-color: var(--coral);
  width: 18px;
  height: 18px;
}

.product-card h3 {
  font-size: 16px;
  font-weight: 500;
  color: var(--dark);
}

.product-card > p {
  font-size: 13px;
  color: var(--stone-400);
  margin-bottom: 8px;
  line-height: 1.4;
}

.product-price {
  font-size: 18px;
  font-weight: 600;
  color: var(--dark);
}

.product-card .checkout-btn {
  margin-top: 16px;
  width: 100%;
}

/* ---- Checkout Page ---- */
.checkout-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 100px 24px 60px;
}

.checkout-page h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 24px;
}

.checkout-memory-info {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 32px;
}

.checkout-memory-info h2 {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 4px;
}

.checkout-memory-info p {
  font-size: 14px;
  color: var(--stone-500);
}

.selected-products {
  margin-bottom: 32px;
}

.selected-products h2 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 16px;
}

.selected-products ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.selected-products li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: var(--shadow-soft);
}

.selected-products li img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.selected-products li span {
  font-size: 14px;
  color: var(--stone-600);
}

.selected-products .order-total {
  margin-top: 16px;
  text-align: right;
  font-size: 18px;
  font-weight: 600;
}

/* ---- Checkout Form ---- */
.checkout-form {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 32px;
  box-shadow: var(--shadow-soft);
}

.checkout-form fieldset {
  border: none;
  padding: 0;
}

.checkout-form legend {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 20px;
}

.checkout-form .form-actions {
  margin-top: 24px;
}

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

/* ---- Checkout Success ---- */
.checkout-success {
  max-width: 640px;
  margin: 0 auto;
  padding: 120px 24px 60px;
  text-align: center;
}

.checkout-success h2 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
  color: var(--dark);
}

.checkout-success > p {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 32px;
}

.checkout-success ul {
  list-style: none;
  max-width: 400px;
  margin: 0 auto 32px;
  text-align: left;
}

.checkout-success li {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  box-shadow: var(--shadow-soft);
  font-size: 14px;
  color: var(--stone-600);
  line-height: 1.8;
}

.checkout-success li strong {
  color: var(--dark);
}

.checkout-success .btn {
  margin-top: 8px;
}

/* ---- Status Messages ---- */
.status-message {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.status-error {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

.status-success {
  background: #F0FDF4;
  color: #166534;
  border: 1px solid #BBF7D0;
}

.status-info {
  background: var(--stone-50);
  color: var(--stone-600);
  border: 1px solid var(--stone-100);
}

/* ---- Spinner / Loading ---- */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--stone-200);
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.htmx-indicator {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  opacity: 1;
}

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--stone-400);
}

.empty-state p {
  font-size: 15px;
  line-height: 1.6;
}
