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

/* === Design Tokens === */
:root {
  --color-primary: #FF7210;
  --color-primary-hover: #e16b2c;
  --color-primary-light: #FFF4EB;
  --color-primary-50: #FFF8F2;
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-700: #374151;
  --color-gray-900: #111827;
  --color-success: #059669;
  --color-success-light: #ecfdf5;
  --color-danger: #dc2626;
  --color-danger-light: #fef2f2;
  --sidebar-bg: #1e293b;
  --sidebar-text: #cbd5e1;
  --sidebar-active: #FF7210;
  --font-sans: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', 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;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-sans); color: var(--color-gray-900); background: var(--color-gray-50); }

/* === Components === */

/* Card */
.card {
  background: #ffffff;
  border: 1px solid var(--color-gray-200);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  padding: 24px;
}

/* Buttons - shared */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--color-primary-hover); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(225,107,44,0.25); }

.btn-secondary { background: transparent; border: 1px solid var(--color-gray-300); color: var(--color-gray-700); }
.btn-secondary:hover:not(:disabled) { background: var(--color-gray-50); }

.btn-danger { background: transparent; border: 1px solid var(--color-danger); color: var(--color-danger); }
.btn-danger:hover:not(:disabled) { background: var(--color-danger); color: #fff; transform: translateY(-1px); box-shadow: 0 2px 8px rgba(220,38,38,0.2); }

.btn-full { width: 100%; }

/* Input */
.input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-gray-300);
  border-radius: 8px;
  font-family: inherit;
  font-size: var(--text-sm);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(225,107,44,0.1); }

.input-code {
  font-size: var(--text-xl);
  text-align: center;
  letter-spacing: 0.5em;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: var(--text-xs);
  font-weight: 600;
}
.badge-success { background: var(--color-success-light); color: var(--color-success); }
.badge-danger { background: var(--color-danger-light); color: var(--color-danger); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Toast */
.toast-container { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); z-index: 100; }
.toast {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  animation: toastIn 0.3s ease forwards;
}
.toast.hiding { animation: toastOut 0.3s ease forwards; }
.toast-success { background: var(--color-success); color: #fff; }
.toast-error { background: var(--color-danger); color: #fff; }

/* Divider */
.divider { border-top: 1px solid var(--color-gray-200); }
.divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-gray-400);
  font-size: var(--text-xs);
}
.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--color-gray-200);
}

/* Alert */
.alert {
  padding: 12px;
  border-radius: 8px;
  font-size: var(--text-sm);
  margin-bottom: 16px;
  display: none;
}
.alert.show { display: block; }
.alert-error { background: var(--color-danger-light); border: 1px solid #fecaca; color: #b91c1c; }
.alert-success { background: var(--color-success-light); border: 1px solid #a7f3d0; color: #065f46; }

/* === Auth Page Layout === */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.auth-container { width: 100%; max-width: 400px; }
.auth-header { text-align: center; margin-bottom: 24px; }
.auth-icon {
  width: 48px;
  height: 48px;
  background: var(--color-primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.auth-icon svg { width: 24px; height: 24px; color: var(--color-primary); }
.auth-title { font-size: var(--text-xl); font-weight: 700; color: var(--color-gray-900); }
.auth-subtitle { font-size: var(--text-sm); color: var(--color-gray-500); margin-top: 4px; }
.auth-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--color-gray-200);
  text-align: center;
}
.auth-footer p { font-size: var(--text-xs); color: var(--color-gray-400); }

/* === Field Row (account page) === */
.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-gray-100);
}
.field-row:last-child { border-bottom: none; }
.field-label { font-size: 13px; font-weight: 500; color: var(--color-gray-500); min-width: 80px; }
.field-value { font-size: var(--text-sm); color: var(--color-gray-900); text-align: right; display: flex; align-items: center; gap: 8px; }
.field-value.muted { color: var(--color-gray-400); }

/* === Animations === */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-8px) scale(0.96); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.animate-fade-up { animation: fadeUp 0.5s cubic-bezier(0.22,1,0.36,1) forwards; opacity: 0; }
.animate-fade-in { animation: fadeIn 0.4s ease forwards; opacity: 0; }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--color-gray-100) 25%, var(--color-gray-50) 50%, var(--color-gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}

/* Utility */
.hidden { display: none !important; }
