/* ============================================
   밥동무 Design System
   "밥상 위의 정겨움" — Warm Organic Aesthetic
   ============================================ */

/* --- Fonts --- */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.min.css');

/* --- Design Tokens --- */
:root {
  /* Colors */
  --primary: #D4763C;
  --primary-hover: #C0682F;
  --primary-light: rgba(212, 118, 60, 0.10);
  --primary-glow: rgba(212, 118, 60, 0.18);
  --secondary: #5B8C5A;
  --secondary-hover: #4D7A4C;
  --secondary-light: rgba(91, 140, 90, 0.10);
  --bg: #FBF7F2;
  --bg-warm: #F5EDE3;
  --surface: #FFFFFF;
  --surface-warm: #FDF9F5;
  --text: #2C2420;
  --text-soft: #4A3F38;
  --muted: #8C7E73;
  --border: #E8E0D8;
  --border-light: #F0EAE2;
  --success: #5B8C5A;
  --warning: #D4A63C;
  --error: #C94C4C;
  --info: #4C7EC9;

  /* Typography */
  --font-display: 'Pretendard Variable', Pretendard, -apple-system, sans-serif;
  --font-body: 'Pretendard Variable', Pretendard, -apple-system, sans-serif;

  /* Spacing (8px base) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(44, 36, 32, 0.06);
  --shadow-md: 0 4px 16px rgba(44, 36, 32, 0.08);
  --shadow-lg: 0 8px 32px rgba(44, 36, 32, 0.10);
  --shadow-warm: 0 4px 20px rgba(212, 118, 60, 0.12);
  --shadow-lift: 0 8px 28px rgba(44, 36, 32, 0.12);
}

[data-theme="dark"] {
  --primary: #E8935A;
  --primary-hover: #D4763C;
  --primary-light: rgba(232, 147, 90, 0.12);
  --primary-glow: rgba(232, 147, 90, 0.20);
  --secondary: #7DB87C;
  --secondary-light: rgba(125, 184, 124, 0.12);
  --bg: #1A1614;
  --bg-warm: #221E1A;
  --surface: #2C2420;
  --surface-warm: #332D28;
  --text: #F0E8E0;
  --text-soft: #D4C8BC;
  --muted: #9C8E83;
  --border: #3C3430;
  --border-light: #443C36;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-warm: 0 4px 20px rgba(232, 147, 90, 0.15);
  --shadow-lift: 0 8px 28px rgba(0, 0, 0, 0.4);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: var(--font-body); }

/* --- Paper Grain Texture --- */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* --- Layout --- */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-narrow {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* --- Typography --- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 44px; line-height: 1.2; }
h2 { font-size: 24px; line-height: 1.3; }
h3 { font-size: 18px; line-height: 1.4; }

.text-display {
  font-family: var(--font-display);
  font-weight: 700;
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes pulse-warm {
  0%, 100% { box-shadow: 0 0 0 0 var(--primary-glow); }
  50% { box-shadow: 0 0 0 12px transparent; }
}

.fade-in {
  animation: fadeIn 0.6s ease-out both;
}

.slide-up {
  animation: slideUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.slide-down {
  animation: slideDown 0.5s ease-out both;
}

.scale-in {
  animation: scaleIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Staggered delays */
.stagger-1 { animation-delay: 0.08s; }
.stagger-2 { animation-delay: 0.16s; }
.stagger-3 { animation-delay: 0.24s; }
.stagger-4 { animation-delay: 0.32s; }
.stagger-5 { animation-delay: 0.40s; }
.stagger-6 { animation-delay: 0.48s; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 13px 28px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(212, 118, 60, 0.25);
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 16px rgba(212, 118, 60, 0.35);
  transform: translateY(-1px);
}

.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover {
  background: var(--secondary-hover);
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255,255,255,0.6);
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-ghost:hover {
  background: var(--primary);
  color: #fff;
}
/* 회원탈퇴 경고버튼 */
.btn-danger {
  background: rgba(255,255,255,0.6);
  color: var(--error);
  border: 2px solid var(--error);
}
.btn-danger:hover {
  background: var(--error);
  color: #fff;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}

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

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* --- Cards --- */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-body { padding: var(--space-lg); }

.card-accent {
  overflow: hidden;
}
.card-accent::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* --- Icon Container --- */
.icon-circle {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-circle-primary {
  background: var(--primary-light);
  color: var(--primary);
}

.icon-circle-secondary {
  background: var(--secondary-light);
  color: var(--secondary);
}

.icon-circle svg {
  width: 28px;
  height: 28px;
}

.icon-sm { width: 20px; height: 20px; }
.icon-md { width: 24px; height: 24px; }

/* --- Navigation --- */
.nav {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  padding: var(--space-md) 0;
  position: sticky;
  top: 0;
  z-index: 100;
  animation: slideDown 0.5s ease-out both;
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

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

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

.nav-links a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.nav-links a:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-links a.active {
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-light);
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 10px;
  border-radius: var(--radius-md);
  transition: background 0.2s;
  position: relative;
  z-index: 110;
}

.nav-toggle:hover { background: var(--primary-light); }

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  position: absolute;
  left: 11px;
}

.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 28px; }

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg);
  top: 21px;
}
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg);
  top: 21px;
}

/* Mobile Nav Drawer */
.nav-drawer {
  display: none;
}

/* --- Forms --- */
.form-group { margin-bottom: var(--space-md); }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--text);
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

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

/* --- Alerts --- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.alert-success { background: #EDF5ED; color: #3A6B39; border: 1px solid #C5DFC4; }
.alert-warning { background: #FDF5E6; color: #8B6914; border: 1px solid #E8D5A8; }
.alert-error { background: #FDEDED; color: #8B2C2C; border: 1px solid #E8C4C4; }
.alert-info { background: #EDF2FD; color: #2C4A8B; border: 1px solid #C4D0E8; }

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-open { background: #EDF5ED; color: #3A6B39; }
.badge-matched { background: #FDF5E6; color: #8B6914; }
.badge-done { background: #F0EBE6; color: #6B5E53; }
.badge-pending { background: #FDF5E6; color: #8B6914; }
.badge-cancelled { background: #FDEDED; color: #8B2C2C; }

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border-light);
  padding: var(--space-2xl) 0 var(--space-xl);
  margin-top: var(--space-4xl);
  color: var(--muted);
  font-size: 13px;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-xl);
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--primary);
  margin-bottom: var(--space-sm);
}

.footer-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 280px;
}

.footer-links {
  display: flex;
  gap: var(--space-2xl);
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: var(--space-sm);
}

.footer-col a {
  display: block;
  font-size: 13px;
  color: var(--muted);
  padding: 3px 0;
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--primary); }

.footer-bottom {
  border-top: 1px solid var(--border-light);
  padding-top: var(--space-md);
  font-size: 12px;
  color: var(--muted);
}

/* --- Grid --- */
.grid { display: grid; gap: var(--space-lg); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* --- Stats Grid --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}
@media (min-width: 640px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 36px;
  color: var(--primary);
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--muted);
  margin-top: var(--space-xs);
}

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-warm);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}

.tab {
  padding: 10px var(--space-lg);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  flex: 1;
  text-align: center;
}

.tab:hover { color: var(--text); }

.tab.active {
  color: var(--primary);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

/* --- Filter Bar --- */
.filter-bar {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input {
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--text);
  transition: all 0.2s;
  cursor: pointer;
}

.filter-bar select:focus,
.filter-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  outline: none;
}

/* --- Hosting Card --- */
.hosting-card {
  cursor: pointer;
  overflow: hidden;
}

.hosting-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: opacity 0.3s;
}

.hosting-card:hover::before { opacity: 1; }

.hosting-card .card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.hosting-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.hosting-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(212, 118, 60, 0.2);
}

.hosting-name { font-weight: 600; font-size: 16px; }
.hosting-district { font-size: 13px; color: var(--muted); }

.hosting-menu {
  font-size: 20px;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--primary);
  padding: var(--space-sm) 0;
}

.hosting-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border-light);
}

/* --- Match Card --- */
.match-card .card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.match-info { flex: 1; }
.match-info h3 { font-size: 16px; margin-bottom: var(--space-xs); }
.match-meta { font-size: 13px; color: var(--muted); }
.match-actions { display: flex; gap: var(--space-sm); }

/* --- Profile Section --- */
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-xl) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
  position: relative;
  overflow: hidden;
}

.profile-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 80px;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
  z-index: 0;
}

.profile-card > * { position: relative; z-index: 1; }

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 28px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(212, 118, 60, 0.25);
  border: 3px solid var(--surface);
}

.profile-details h2 { font-size: 22px; margin-bottom: var(--space-xs); }
.profile-details p { font-size: 14px; color: var(--muted); }

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  color: var(--muted);
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-lg);
  color: var(--border);
}

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

/* --- Section Header --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.section-header h2 { font-size: 20px; }

/* --- Review Item --- */
.review-card {
  background: var(--surface-warm);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  border: 1px solid var(--border-light);
  transition: all 0.2s;
}

.review-card:hover { box-shadow: var(--shadow-sm); }

.review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.review-author { font-weight: 600; font-size: 14px; }
.review-date { font-size: 12px; color: var(--muted); }

.review-message {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-soft);
}

/* Legacy review-item support */
.review-item {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-light);
}
.review-item:last-child { border-bottom: none; }

/* --- Detail Page --- */
.detail-section {
  margin-bottom: var(--space-xl);
}

.detail-section h3 {
  font-size: 16px;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-light);
}

.detail-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  font-size: 14px;
  gap: var(--space-sm);
}

.detail-row + .detail-row { border-top: 1px solid var(--border-light); }

.detail-label {
  width: 100px;
  color: var(--muted);
  flex-shrink: 0;
  font-size: 13px;
}

.detail-value { flex: 1; }

.detail-icon {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex-shrink: 0;
}

/* --- AI Summary Card --- */
.ai-summary-card {
  background: var(--surface-warm);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  position: relative;
  overflow: hidden;
}

.ai-summary-card::before {
  content: '\201C';
  position: absolute;
  top: 12px;
  left: 20px;
  font-family: Georgia, serif;
  font-size: 72px;
  line-height: 1;
  color: var(--primary);
  opacity: 0.12;
}

.ai-summary-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.ai-summary-text {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-soft);
  position: relative;
  z-index: 1;
}

/* --- Hosting List in Guardian/Admin --- */
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}

.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--surface-warm); }

/* --- Page Header --- */
.page-header {
  padding: var(--space-xl) 0 var(--space-lg);
}

.page-header h1 {
  font-size: 28px;
  margin-bottom: var(--space-xs);
}

.page-header p {
  color: var(--muted);
  font-size: 15px;
}

/* --- Hero Section --- */
.hero {
  text-align: center;
  padding: var(--space-3xl) 0 var(--space-2xl);
  position: relative;
}

.hero-bg {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 800px;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.08;
}

.hero > * { position: relative; z-index: 1; }

.hero h1 {
  margin-bottom: var(--space-md);
  color: var(--text);
}

.hero h1 .highlight {
  color: var(--primary);
  position: relative;
}

.hero-desc {
  font-size: 18px;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto var(--space-xl);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Feature Cards --- */
.feature-card {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
}

.feature-card .icon-circle {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-md);
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.feature-card:hover .icon-circle {
  transform: scale(1.08);
  box-shadow: var(--shadow-warm);
}

.feature-card h3 {
  margin-bottom: var(--space-sm);
  font-size: 17px;
}

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

/* --- Steps Section --- */
.steps {
  display: flex;
  gap: var(--space-lg);
  position: relative;
}

.steps::before {
  content: '';
  position: absolute;
  top: 28px;
  left: 56px;
  right: 56px;
  height: 2px;
  background: var(--border);
}

.step {
  flex: 1;
  text-align: center;
  position: relative;
}

.step-number {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 2px solid var(--primary);
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
  position: relative;
  z-index: 1;
}

.step h3 {
  font-size: 15px;
  margin-bottom: var(--space-xs);
}

.step p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* --- Section Divider (Wave) --- */
.section-wave {
  width: 100%;
  height: 48px;
  color: var(--bg-warm);
  display: block;
  margin: var(--space-xl) 0;
}

/* --- Back Link --- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
  padding: var(--space-sm) 0;
  transition: color 0.2s;
}

.back-link:hover { color: var(--primary); }

.back-link svg { width: 18px; height: 18px; }

/* --- Utilities --- */
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.text-primary { color: var(--primary); }
.text-soft { color: var(--text-soft); }
.text-sm { font-size: 13px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 24px; }
.font-display { font-family: var(--font-display); }
.font-bold { font-weight: 700; }
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.w-full { width: 100%; }
.hidden { display: none; }

/* --- Responsive --- */
@media (max-width: 639px) {
  h1 { font-size: 32px; }

  .nav-links { display: none; }
  .nav-toggle { display: block; }

  .nav-drawer {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(44, 36, 32, 0.4);
    backdrop-filter: blur(4px);
    z-index: 105;
  }

  .nav-drawer.open { display: block; }

  .nav-drawer-content {
    position: absolute;
    top: 0; right: 0;
    width: 280px;
    height: 100%;
    background: var(--surface);
    padding: 72px var(--space-lg) var(--space-lg);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
    animation: slideDrawer 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  }

  @keyframes slideDrawer {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
  }

  .nav-drawer-content a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 14px var(--space-md);
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    border-radius: var(--radius-md);
    transition: all 0.15s;
  }

  .nav-drawer-content a:hover,
  .nav-drawer-content a.active {
    background: var(--primary-light);
    color: var(--primary);
  }

  .nav-drawer-content a + a { margin-top: 4px; }

  .profile-card { flex-direction: column; text-align: center; }
  .match-card .card-body { flex-direction: column; align-items: stretch; }
  .match-actions { justify-content: flex-end; }

  .hero { padding: var(--space-2xl) 0; }

  .steps { flex-direction: column; gap: var(--space-lg); }
  .steps::before { display: none; }

  .footer-top { flex-direction: column; }
  .footer-links { flex-direction: column; gap: var(--space-lg); }
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  width: min(480px, calc(100vw - 32px));
  max-height: 80dvh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  padding: 4px;
}

.modal-close:hover {
  color: var(--text);
}

@media (min-width: 640px) and (max-width: 959px) {
  .steps::before {
    left: 40px;
    right: 40px;
  }
}

/* ── login.html ───────────────────────────────── */
.login-wrap {
  min-height: calc(100dvh - 65px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-lg);
}
.login-card {
  width: 100%;
  max-width: 400px;
}
.login-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}
.login-header h1 {
  font-size: 28px;
  margin-bottom: var(--space-xs);
}
.login-header p {
  color: var(--muted);
  font-size: 15px;
}
.login-footer {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: 14px;
  color: var(--muted);
}
.login-footer a {
  color: var(--primary);
  font-weight: 600;
}
.login-footer a:hover { text-decoration: underline; }

.kakao-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  background: #FEE500;
  color: rgba(0, 0, 0, 0.85);
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
.kakao-login-btn:hover {
  background: #F5DC00;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  color: var(--muted);
  font-size: 13px;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── register.html ──────────────────────────────── */
.register-wrap {
  min-height: calc(100dvh - 65px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-lg);
}
.register-card {
  width: 100%;
  max-width: 440px;
}
.register-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}
.register-header h1 {
  font-size: 28px;
  margin-bottom: var(--space-xs);
}
.register-header p {
  color: var(--muted);
  font-size: 15px;
}
.register-footer {
  text-align: center;
  margin-top: var(--space-lg);
  font-size: 14px;
  color: var(--muted);
}
.register-footer a {
  color: var(--primary);
  font-weight: 600;
}
.register-footer a:hover { text-decoration: underline; }

.doc-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-sm);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}
.doc-upload {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-warm);
  cursor: pointer;
  transition: border-color 0.15s ease-out;
}
.doc-upload:hover {
  border-color: var(--primary);
}
.doc-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.doc-upload-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--muted);
}
.doc-upload-text {
  font-size: 14px;
  color: var(--muted);
}
.doc-upload-text strong {
  color: var(--text);
}
.doc-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: var(--space-xs);
}

/* ── 페이지 헤더 좌우 분할 (제목 + 액션 버튼) ───── */
.page-header.with-action {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
}

.page-header.with-action > div {
  flex: 1;
  min-width: 0;
}

@media (max-width: 639px) {
  .page-header.with-action {
    flex-direction: column;
    align-items: stretch;
  }
  .page-header.with-action .btn {
    width: 100%;
  }
}

/* ── 시간 범위 선택 (시작 ~ 종료) ───── */
.time-range {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.time-range > span {
  white-space: nowrap;
  color: var(--text-soft);
}

/* ── 모달 모바일 풀스크린 (기존 .modal 확장) ───── */
@media (max-width: 639px) {
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    padding: var(--space-lg);
  }
}

/* 모달 안내 카드 (어르신 0명 빈 상태 등) */
.modal-notice {
  text-align: center;
  padding: var(--space-lg) 0;
}

.modal-notice p {
  color: var(--text);
  font-size: 15px;
  margin-bottom: var(--space-xs);
}

.modal-notice p.text-sm {
  color: var(--text-soft);
  font-size: 14px;
}
