/* Kitchen - Recipe Web App Styles
   Design tokens: paper/cream/sage/rust/gold
   Typography: Fraunces (display) + Plus Jakarta Sans (body)
*/

/* ========================================
   CSS Custom Properties (Design Tokens)
   ======================================== */

:root {
  /* Colors - Warm Kitchen Palette */
  --color-paper: #F5F1EB;
  --color-paper-dark: #E8E4DD;
  --color-cream: #FDF9F3;
  --color-cream-dark: #F0EBE3;
  
  --color-sage: #7D9A78;
  --color-sage-light: #A8C4A3;
  --color-sage-dark: #5C7A57;
  
  --color-rust: #C4755A;
  --color-rust-light: #D99B84;
  --color-rust-dark: #A55D45;
  
  --color-gold: #D4A84B;
  --color-gold-light: #E5C77A;
  --color-gold-dark: #B88E3A;
  
  --color-ink: #2D2A26;
  --color-ink-light: #5C5752;
  --color-ink-lighter: #8A857E;
  --color-ink-muted: #B8B3AB;
  
  --color-white: #FFFFFF;
  --color-black: #1A1815;
  
  /* Cuisine accent colors */
  --accent-italian: #C4755A;
  --accent-mexican: #D4A84B;
  --accent-japanese: #C4755A;
  --accent-indian: #D4A84B;
  --accent-thai: #7D9A78;
  --accent-french: #C4755A;
  --accent-greek: #4A90A4;
  --accent-korean: #C4755A;
  --accent-american: #D4A84B;
  --accent-middle-eastern: #D4A84B;
  --accent-default: #7D9A78;
  
  /* Typography */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  --text-5xl: 3rem;
  
  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.7;
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  
  /* Borders */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(45, 42, 38, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(45, 42, 38, 0.08), 0 2px 4px -1px rgba(45, 42, 38, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(45, 42, 38, 0.1), 0 4px 6px -2px rgba(45, 42, 38, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(45, 42, 38, 0.1), 0 10px 10px -5px rgba(45, 42, 38, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(45, 42, 38, 0.25);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
  
  /* Z-index */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fab: 300;
  --z-sheet: 400;
  --z-dialog: 500;
  --z-toast: 600;
  
  /* Layout */
  --topbar-height: 64px;
  --container-max: 1200px;
  --container-padding: var(--space-4);
}

@media (min-width: 640px) {
  :root {
    --container-padding: var(--space-6);
  }
}

@media (min-width: 1024px) {
  :root {
    --container-padding: var(--space-8);
  }
}

/* ========================================
   Reset & Base Styles
   ======================================== */

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

* {
  margin: 0;
  padding: 0;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-ink);
  background-color: var(--color-paper);
  min-height: 100vh;
  overflow-x: hidden;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

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

button {
  cursor: pointer;
  background: none;
  border: none;
}

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

ul, ol {
  list-style: none;
}

/* 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;
}

/* ========================================
   Typography
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--color-ink);
}

/* ========================================
   Toast Notifications
   ======================================== */

#toast-container {
  position: fixed;
  bottom: calc(var(--space-4) + 72px);
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
  width: calc(100% - var(--space-8));
  max-width: 400px;
}

.toast {
  background: var(--color-ink);
  color: var(--color-white);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toast-enter var(--transition-normal) ease-out;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.toast.toast-success {
  background: var(--color-sage-dark);
}

.toast.toast-error {
  background: var(--color-rust-dark);
}

.toast.toast-exit {
  animation: toast-exit var(--transition-fast) ease-in forwards;
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-exit {
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
  }
}

/* ========================================
   Top Bar
   ======================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: rgba(245, 241, 235, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-paper-dark);
  height: var(--topbar-height);
}

.topbar-content {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-ink);
  transition: opacity var(--transition-fast);
}

.logo:hover {
  opacity: 0.8;
}

.logo-icon {
  font-size: 1.5em;
}

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

.user-email {
  font-size: var(--text-sm);
  color: var(--color-ink-light);
  margin-right: var(--space-2);
  display: none;
}

@media (min-width: 640px) {
  .user-email {
    display: block;
  }
}

/* Language Toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-ink-light);
  background: transparent;
  transition: all var(--transition-fast);
  position: relative;
}

.lang-toggle:hover {
  background: var(--color-paper-dark);
  color: var(--color-ink);
}

.lang-toggle .lang-en,
.lang-toggle .lang-te {
  position: absolute;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.lang-toggle .lang-te {
  opacity: 0;
  transform: scale(0.8);
}

.lang-toggle.active .lang-en {
  opacity: 0;
  transform: scale(0.8);
}

.lang-toggle.active .lang-te {
  opacity: 1;
  transform: scale(1);
}

.lang-toggle.active {
  color: var(--color-sage);
  background: rgba(125, 154, 120, 0.1);
}

/* ========================================
   Buttons
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  min-height: 44px;
  min-width: 44px;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--color-sage);
  outline-offset: 2px;
}

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  min-height: 36px;
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  min-height: 52px;
}

.btn-full {
  width: 100%;
}

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

.btn-primary:hover {
  background: var(--color-sage-dark);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-ghost {
  color: var(--color-ink);
  background: transparent;
}

.btn-ghost:hover {
  background: var(--color-paper-dark);
}

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

.btn-danger:hover {
  background: rgba(196, 117, 90, 0.1);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========================================
   Hero Section
   ======================================== */

.hero {
  padding: var(--space-12) var(--container-padding) var(--space-8);
  text-align: center;
  background: linear-gradient(180deg, var(--color-cream) 0%, var(--color-paper) 100%);
}

.hero-content {
  max-width: 600px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-sage);
  margin-bottom: var(--space-3);
}

.hero-title {
  font-size: var(--text-4xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
  color: var(--color-ink);
}

@media (min-width: 640px) {
  .hero-title {
    font-size: var(--text-5xl);
  }
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--color-ink-light);
  line-height: var(--leading-relaxed);
}

/* ========================================
   Search & Filters
   ======================================== */

.search-section {
  position: sticky;
  top: var(--topbar-height);
  z-index: var(--z-base);
  background: var(--color-paper);
  padding: var(--space-4) var(--container-padding);
  border-bottom: 1px solid var(--color-paper-dark);
}

.search-container {
  max-width: var(--container-max);
  margin: 0 auto;
}

.search-wrapper {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
}

.search-icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-ink-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: var(--space-3) var(--space-12) var(--space-3) var(--space-12);
  font-size: var(--text-base);
  background: var(--color-cream);
  border: 2px solid transparent;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  min-height: 48px;
}

.search-input::placeholder {
  color: var(--color-ink-muted);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-sage);
  background: var(--color-white);
}

.search-clear {
  position: absolute;
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  padding: var(--space-2);
  color: var(--color-ink-muted);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-clear:hover {
  color: var(--color-ink);
  background: var(--color-paper-dark);
}

/* Filter Chips */
.filters-container {
  max-width: var(--container-max);
  margin: var(--space-4) auto 0;
  overflow: hidden;
}

.filters-scroll {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding: var(--space-1) 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.filters-scroll::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex-shrink: 0;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-ink-light);
  background: var(--color-cream);
  border: 1px solid var(--color-paper-dark);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  min-height: 44px;
}

.filter-chip:hover {
  background: var(--color-cream-dark);
  border-color: var(--color-ink-muted);
}

.filter-chip.active {
  background: var(--color-ink);
  color: var(--color-white);
  border-color: var(--color-ink);
}

/* ========================================
   Recipe Grid
   ======================================== */

.recipes-section {
  padding: var(--space-6) var(--container-padding) var(--space-20);
  max-width: var(--container-max);
  margin: 0 auto;
}

.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-6);
}

@media (min-width: 640px) {
  .recipes-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

/* Recipe Card */
.recipe-card {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
}

.recipe-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-accent, var(--accent-default));
}

.recipe-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

@media (prefers-reduced-motion: reduce) {
  .recipe-card:hover {
    transform: none;
  }
}

.recipe-card:focus-visible {
  outline: 2px solid var(--color-sage);
  outline-offset: 2px;
}

.recipe-card-content {
  padding: var(--space-5);
}

.recipe-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.recipe-card-title {
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--color-ink);
}

.recipe-card-cuisine {
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--card-accent, var(--accent-default));
  background: rgba(125, 154, 120, 0.1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

.recipe-card-description {
  font-size: var(--text-sm);
  color: var(--color-ink-light);
  line-height: var(--leading-relaxed);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: var(--space-4);
}

.recipe-card-meta {
  display: flex;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-ink-lighter);
}

.recipe-card-meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.recipe-card-meta-item svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}


/* Video Badge on Cards */
.recipe-card-video-badge {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 28px;
  height: 28px;
  background: var(--color-rust);
  color: var(--color-white);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 1;
}

.recipe-card-video-badge svg {
  width: 12px;
  height: 12px;
  margin-left: 2px;
}

/* Skeleton Loading */
.recipe-card.skeleton {
  pointer-events: none;
}

.recipe-card.skeleton::before {
  background: var(--color-paper-dark);
}

.skeleton-content {
  padding: var(--space-5);
}

.skeleton-content::before {
  content: '';
  display: block;
  height: 24px;
  width: 70%;
  background: linear-gradient(90deg, var(--color-paper-dark) 25%, var(--color-cream) 50%, var(--color-paper-dark) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-3);
}

.skeleton-content::after {
  content: '';
  display: block;
  height: 48px;
  background: linear-gradient(90deg, var(--color-paper-dark) 25%, var(--color-cream) 50%, var(--color-paper-dark) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite 0.1s;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ========================================
   Empty States
   ======================================== */

.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-4);
}

.empty-illustration {
  margin: 0 auto var(--space-6);
}

.empty-title {
  font-size: var(--text-2xl);
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--color-ink);
}

.empty-subtitle {
  font-size: var(--text-base);
  color: var(--color-ink-light);
  margin-bottom: var(--space-6);
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* ========================================
   Floating Action Button
   ======================================== */

.fab {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-fab);
  width: 56px;
  height: 56px;
  background: var(--color-sage);
  color: var(--color-white);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.fab:hover {
  background: var(--color-sage-dark);
  transform: scale(1.05);
}

.fab:active {
  transform: scale(0.95);
}

.fab:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .fab:hover, .fab:active {
    transform: none;
  }
}

/* ========================================
   Sheet (Modal)
   ======================================== */

.sheet {
  position: fixed;
  inset: 0;
  z-index: var(--z-sheet);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

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

.sheet[hidden] {
  display: none;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 24, 21, 0.5);
  animation: fade-in var(--transition-normal) ease-out;
}

.sheet-content {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  background: var(--color-white);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  box-shadow: var(--shadow-2xl);
  display: flex;
  flex-direction: column;
  animation: sheet-enter var(--transition-normal) ease-out;
}

@media (min-width: 640px) {
  .sheet-content {
    border-radius: var(--radius-2xl);
    max-height: 85vh;
  }
}

.sheet-content-sm {
  max-width: 420px;
}

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

@keyframes sheet-enter {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-paper-dark);
  flex-shrink: 0;
}

.sheet-close {
  padding: var(--space-2);
  margin: calc(var(--space-2) * -1);
  color: var(--color-ink-light);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-close:hover {
  color: var(--color-ink);
  background: var(--color-paper);
}

.sheet-title {
  font-size: var(--text-lg);
  font-weight: 600;
}

.sheet-actions {
  display: flex;
  gap: var(--space-2);
  margin-left: auto;
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
  overscroll-behavior: contain;
}

/* ========================================
   Recipe Detail
   ======================================== */

.detail-header {
  margin-bottom: var(--space-6);
}

.detail-cuisine {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-sage);
  background: rgba(125, 154, 120, 0.1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-3);
}

.detail-title {
  font-size: var(--text-3xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
  line-height: var(--leading-tight);
}

.detail-description {
  font-size: var(--text-base);
  color: var(--color-ink-light);
  line-height: var(--leading-relaxed);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--color-paper);
  border-radius: var(--radius-lg);
}

.detail-meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.detail-meta-item svg {
  width: 18px;
  height: 18px;
  color: var(--color-ink-lighter);
}

.detail-meta-label {
  color: var(--color-ink-lighter);
}

.detail-meta-value {
  font-weight: 600;
}

/* Section Headers */
.detail-section {
  margin-top: var(--space-8);
}

.detail-section-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.detail-section-progress {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-sage);
  margin-left: auto;
}

/* Checklists */
.checklist {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-paper);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  min-height: 44px;
}

.checklist-item:hover {
  background: var(--color-paper-dark);
}

.checklist-checkbox {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-ink-muted);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  margin-top: 2px;
}

.checklist-item.checked .checklist-checkbox {
  background: var(--color-sage);
  border-color: var(--color-sage);
  animation: check-pulse var(--transition-normal) ease-out;
}

@keyframes check-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.checklist-checkbox svg {
  width: 14px;
  height: 14px;
  color: var(--color-white);
  opacity: 0;
  transform: scale(0.8);
  transition: all var(--transition-fast);
}

.checklist-item.checked .checklist-checkbox svg {
  opacity: 1;
  transform: scale(1);
}

.checklist-text {
  flex: 1;
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  transition: all var(--transition-fast);
}

.checklist-item.checked .checklist-text {
  color: var(--color-ink-lighter);
  text-decoration: line-through;
}

.step-number {
  font-weight: 600;
  color: var(--color-sage);
  margin-right: var(--space-2);
}

/* Complete Message */
.complete-message {
  display: none;
  text-align: center;
  padding: var(--space-6);
  background: linear-gradient(135deg, rgba(125, 154, 120, 0.1) 0%, rgba(212, 168, 75, 0.1) 100%);
  border-radius: var(--radius-lg);
  margin-top: var(--space-6);
  animation: fade-in var(--transition-normal) ease-out;
}

.complete-message.visible {
  display: block;
}

.complete-emoji {
  font-size: 48px;
  margin-bottom: var(--space-2);
}

.complete-text {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-sage-dark);
}

/* Notes */
.detail-notes {
  padding: var(--space-4);
  background: rgba(212, 168, 75, 0.1);
  border-left: 3px solid var(--color-gold);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: var(--text-sm);
  color: var(--color-ink-light);
  line-height: var(--leading-relaxed);
}

/* Video Link */
.detail-video {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--color-paper);
  border-radius: var(--radius-md);
  color: var(--color-ink);
  font-weight: 500;
  transition: all var(--transition-fast);
  min-height: 44px;
}

.detail-video:hover {
  background: var(--color-paper-dark);
}

.detail-video svg {
  width: 20px;
  height: 20px;
  color: var(--color-rust);
}


/* Primary Video Button (top of detail) */
.detail-video-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: var(--color-rust);
  color: var(--color-white);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-base);
  transition: all var(--transition-fast);
  min-height: 48px;
  margin-top: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.detail-video-primary:hover {
  background: var(--color-rust-dark);
  box-shadow: var(--shadow-md);
}

.detail-video-primary:active {
  transform: scale(0.98);
}

.detail-video-primary svg {
  width: 18px;
  height: 18px;
  margin-left: 2px;
}

/* ========================================
   Forms
   ======================================== */

.recipe-form, .auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-ink);
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--color-ink-lighter);
  margin-left: var(--space-1);
  font-weight: normal;
}

.form-input,
.form-select,
.form-textarea {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  background: var(--color-paper);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  min-height: 48px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-sage);
  background: var(--color-white);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-ink-muted);
}

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

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%235C5752' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 44px;
}

.form-error {
  font-size: var(--text-sm);
  color: var(--color-rust);
  min-height: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.form-row-3 {
  grid-template-columns: repeat(3, 1fr);
}

.form-actions {
  padding-top: var(--space-4);
}

/* Password Toggle */
.password-wrapper {
  position: relative;
}

.password-wrapper .form-input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  padding: var(--space-2);
  color: var(--color-ink-lighter);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: var(--color-ink);
  background: var(--color-paper-dark);
}

/* Auth Header */
.auth-header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.auth-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.auth-subtitle {
  font-size: var(--text-base);
  color: var(--color-ink-light);
}

/* ========================================
   Confirm Dialog
   ======================================== */

.dialog {
  position: fixed;
  inset: 0;
  z-index: var(--z-dialog);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.dialog[hidden] {
  display: none;
}

.dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 24, 21, 0.5);
  animation: fade-in var(--transition-fast) ease-out;
}

.dialog-content {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: var(--color-white);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-2xl);
  animation: dialog-enter var(--transition-fast) ease-out;
}

@keyframes dialog-enter {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.dialog-title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.dialog-message {
  font-size: var(--text-base);
  color: var(--color-ink-light);
  margin-bottom: var(--space-6);
}

.dialog-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

/* ========================================
   Loading States
   ======================================== */

.btn.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn-primary.loading::after {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: var(--color-white);
}

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

/* ========================================
   Utility Classes
   ======================================== */

[hidden] {
  display: none !important;
}
