﻿:root {
  --bg-app: #f7f8fa;
  --bg-surface: #ffffff;
  --text-primary: #111111;
  --text-secondary: #8a8d93;
  --text-tertiary: #a0a4ab;
  --accent-black: #111111;
  --accent-white: #ffffff;
  --tag-bg-orange: #fff0e6;
  --tag-text-orange: #e86f4a;
  --line: #eceef2;
  --radius-card: 20px;
  --radius-pill: 999px;
  --radius-button: 50%;
  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.02);
  --shadow-nav: 0 1px 10px rgba(0, 0, 0, 0.03);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --max-width: 1200px;
}

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

body {
  font-family: "Inter", "Pretendard", "Noto Sans KR", -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.app-shell {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-4);
}

.app-header {
  margin-bottom: 14px;
}

.brand {
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.sub-copy {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 13px;
}

.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--space-5);
}

.tab-link {
  text-decoration: none;
  background-color: var(--bg-surface);
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.tab-link:hover {
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.tab-link.is-active {
  background-color: var(--accent-black);
  color: var(--accent-white);
  box-shadow: 0 4px 14px rgba(17, 17, 17, 0.2);
}

.page-header {
  margin-bottom: var(--space-5);
}

.page-header h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
}

.subtitle {
  color: var(--text-secondary);
  font-size: 16px;
}

.controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  gap: var(--space-4);
}

.controls-bar--sub {
  justify-content: flex-start;
}

.search-wrapper {
  position: relative;
  flex: 1;
  max-width: 420px;
}

.search-wrapper svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  stroke: var(--text-tertiary);
}

input,
select {
  width: 100%;
  background-color: var(--bg-surface);
  border: none;
  padding: 14px 20px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  color: var(--text-primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
  outline: none;
  font-family: inherit;
  transition: box-shadow 0.2s;
}

.search-wrapper input {
  padding-left: 44px;
}

input:focus,
select:focus {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

input::placeholder {
  color: var(--text-tertiary);
}

.tabs {
  display: flex;
  gap: var(--space-2);
}

.tab-btn {
  background-color: var(--bg-surface);
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  font-family: inherit;
}

.tab-btn:hover {
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.tab-btn.active {
  background-color: var(--accent-black);
  color: var(--accent-white);
  box-shadow: 0 4px 14px rgba(17, 17, 17, 0.2);
}

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

.card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-card);
  padding: var(--space-3);
  box-shadow: var(--shadow-card);
  position: relative;
}

.explore-card {
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.explore-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06), 0 2px 10px rgba(0, 0, 0, 0.03);
}

.card-visual {
  height: 180px;
  border-radius: 12px;
  margin-bottom: var(--space-3);
  position: relative;
  overflow: hidden;
}

.visual-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.1;
  background-image: radial-gradient(var(--accent-black) 1px, transparent 1px);
  background-size: 16px 16px;
}

.card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: var(--space-1);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.card-tag,
.badge {
  background-color: var(--tag-bg-orange);
  color: var(--tag-text-orange);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.card-desc,
.section-desc,
.trust,
.summary-label,
.notice,
.metric-label {
  color: var(--text-secondary);
}

.card-desc {
  font-size: 13px;
  margin-bottom: var(--space-4);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: var(--space-3);
  border-top: 1px solid rgba(0, 0, 0, 0.03);
}

.metric {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 11px;
  margin-bottom: 2px;
}

.metric-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.add-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-button);
  background-color: var(--accent-black);
  color: var(--accent-white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, background-color 0.2s;
  box-shadow: 0 4px 10px rgba(17, 17, 17, 0.2);
}

.add-btn:hover {
  transform: scale(1.05);
}

.add-btn:active {
  transform: scale(0.95);
}

.add-btn.is-added,
.add-btn:disabled {
  background: #d6d8dd;
  color: #4a4d55;
  box-shadow: none;
}

.add-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.cart-container {
  position: fixed;
  top: 24px;
  right: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  background-color: var(--bg-surface);
  transition: background-color 0.2s;
  text-decoration: none;
  z-index: 100;
  box-shadow: var(--shadow-nav);
}

.cart-container:hover {
  background-color: var(--bg-app);
}

.cart-icon {
  width: 24px;
  height: 24px;
  stroke: var(--text-primary);
  stroke-width: 2;
  fill: none;
}

.cart-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background-color: var(--tag-text-orange);
  color: var(--accent-white);
  font-size: 10px;
  font-weight: 700;
  height: 16px;
  min-width: 16px;
  padding: 0 4px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-surface);
  transform: scale(0);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cart-badge.active {
  transform: scale(1);
}

.cart-badge.bump {
  animation: badgeBump 0.3s ease-out;
}

@keyframes badgeBump {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

.flying-dot {
  position: fixed;
  width: 20px;
  height: 20px;
  background-color: var(--accent-black);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.6s ease-in;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-6) 0;
  color: var(--text-secondary);
}

.cart-layout {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: var(--space-4);
}

.cart-summary-card {
  background: linear-gradient(180deg, #1d2739 0%, #121a2a 100%);
  color: #f8fbff;
}

.wallet-box {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 12px;
}

.xaman-qr-wrap {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.xaman-qr-wrap img {
  width: 100%;
  max-width: 220px;
  border: 1px solid #d3def3;
  border-radius: 10px;
  background: #fff;
}

.section-head {
  margin-bottom: 10px;
}

.section-title {
  margin: 0;
  font-size: 18px;
}

.section-title--sm {
  font-size: 16px;
}

.section-desc {
  margin: 6px 0 0;
  font-size: 13px;
}

.text-white {
  color: #fff;
}

.text-slate-300 {
  color: #cdd6e5;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.field-inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.select-wrapper select {
  min-width: 170px;
  padding: 10px 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

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

.btn-primary {
  background: #111111;
  color: #fff;
  box-shadow: 0 4px 10px rgba(17, 17, 17, 0.2);
}

.btn-secondary {
  background: #fff;
  border-color: #eceef2;
  color: #111111;
}

.btn-ghost {
  background: #f4f5f7;
  border-color: #eceef2;
  color: #6f7380;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.notice {
  margin-top: 10px;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  border: 1px solid #eceef2;
  font-size: 13px;
}

.notice.error {
  background: #fff2f2;
  border-color: #ffc6c6;
  color: #9a2d2d;
}

.preview-box {
  border: 1px dashed #e3e5e8;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  font-size: 14px;
  color: #2b2f36;
}

.preview-box ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.page-grid {
  display: grid;
  gap: var(--space-4);
}

.page-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stack {
  display: flex;
  flex-direction: column;
}

.gap-10 {
  gap: 10px;
}

.gap-12 {
  gap: 12px;
}

.mt-12 {
  margin-top: 12px;
}

.mt-16 {
  margin-top: 16px;
}

.w-full {
  width: 100%;
}

.cart-item,
.timeline-item,
.vote-option,
.result-item,
.summary-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

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

.summary-value {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.table th,
.table td {
  border-bottom: 1px solid #e7ebf3;
  padding: 10px 8px;
  text-align: left;
  font-size: 13px;
}

.table th {
  color: var(--text-secondary);
  font-weight: 700;
}

.text-link {
  color: var(--accent-black);
  text-decoration: none;
  font-weight: 700;
}

.mb-12 {
  margin-bottom: 12px;
}

@media (max-width: 980px) {
  .cart-layout,
  .page-grid--two,
  .status-summary,
  .controls-bar {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .app-shell {
    padding: 18px;
  }

  .page-header h1 {
    font-size: 26px;
  }

  .cart-container {
    top: 16px;
    right: 16px;
  }
}