/* =============================================
   직박구리 DJANGO v5 — base.css
   공통 스타일 (리셋, 변수, 모달, 토스트)
   HTML 인라인 CSS 완전 분리
   ============================================= */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700;800&family=Noto+Sans+JP:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Reset & Base ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Noto Sans KR', 'Noto Sans JP', 'Segoe UI', sans-serif;
  background: #0B1527;
  color: #E2E8F0;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; font-family: inherit; }
input, select, textarea { font-family: inherit; outline: none; }

/* ── CSS 변수 ── */
:root {
  --navy:       #101E38;
  --navy-deep:  #0B1527;
  --purple:     #7C3AED;
  --purple-l:   #8B5CF6;
  --purple-d:   #6D28D9;
  --grad:       linear-gradient(135deg, #101E38 0%, #7C3AED 100%);
  --grad-h:     linear-gradient(135deg, #7C3AED 0%, #101E38 100%);
  --card-bg:    #1A2744;
  --card-bg-h:  #223052;
  --border:     rgba(124,58,237,.25);
  --text-1:     #F1F5F9;
  --text-2:     #94A3B8;
  --text-3:     #64748B;
  --success:    #10B981;
  --warning:    #F59E0B;
  --danger:     #EF4444;
  --badge-kr:   linear-gradient(135deg, #7C3AED, #EC4899);
  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 4px 24px rgba(0,0,0,.35);
}

/* ─────────────────────────────────────────────
   MODAL / OVERLAY
───────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 1000;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: var(--navy);
  border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 430px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px 20px 32px;
  animation: slideUp .3s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.modal-box h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-1);
}
.modal-box .terms-content {
  font-size: .82rem;
  color: var(--text-2);
  line-height: 1.7;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 18px;
  padding-right: 8px;
}
.modal-box .terms-content h4 { color: var(--warning); margin: 12px 0 6px; font-size: .88rem; }
.modal-box .terms-content ul { padding-left: 18px; margin: 6px 0; }
.modal-box .terms-content li { margin-bottom: 4px; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.checkbox-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--purple); }
.checkbox-row label { font-size: .85rem; color: var(--text-1); font-weight: 600; }

.modal-actions { display: flex; gap: 10px; margin-top: 6px; }
.modal-actions button {
  flex: 1;
  padding: 13px;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 700;
  transition: background .2s;
}
.modal-actions .btn-cancel  { background: var(--card-bg); color: var(--text-2); }
.modal-actions .btn-confirm { background: var(--purple); color: #fff; }
.modal-actions .btn-confirm:disabled { opacity: .4; cursor: not-allowed; }
.modal-actions .btn-confirm:not(:disabled):hover { background: var(--purple-d); }

/* Auth tab */
.auth-tab { transition: color .2s, border-bottom-color .2s; }

/* ─────────────────────────────────────────────
   TOAST
───────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--success);
  color: #fff;
  padding: 10px 24px;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all .3s;
  z-index: 2000;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─────────────────────────────────────────────
   FORM INPUTS (Django 템플릿 공통)
───────────────────────────────────────────── */
.input-field {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid rgba(124,58,237,.3);
  border-radius: 10px;
  background: #0F1B30;
  color: #F1F5F9;
  font-size: .88rem;
}
.input-field:focus { border-color: var(--purple-l); }
.input-field::placeholder { color: var(--text-3); }

.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: .78rem;
  color: var(--text-3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}
.form-group .help-text { font-size: .75rem; color: var(--text-3); margin-top: 4px; }
.form-error { font-size: .8rem; color: var(--danger); margin-top: 6px; }
.form-success { font-size: .8rem; color: var(--success); margin-top: 6px; }

/* ─────────────────────────────────────────────
   BADGE / STATUS 공통
───────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 700;
}
.badge-draft         { background: rgba(100,116,139,.15); color: #94A3B8; }
.badge-cart          { background: rgba(100,116,139,.15); color: #94A3B8; }
.badge-receipt_wait  { background: rgba(245,158,11,.15);  color: #F59E0B; }
.badge-confirmed     { background: rgba(245,158,11,.15);  color: #F59E0B; }
.badge-revision      { background: rgba(249,115,22,.15);  color: #FB923C; }
.badge-quoted        { background: rgba(99,102,241,.15);  color: #818CF8; }
.badge-pay_wait      { background: rgba(234,179,8,.15);   color: #EAB308; }
.badge-paid          { background: rgba(34,197,94,.15);   color: #22C55E; }
.badge-purchasing    { background: rgba(124,58,237,.15);  color: #8B5CF6; }
.badge-inbound_wait  { background: rgba(245,158,11,.15);  color: #FBBF24; }
.badge-inbound_done  { background: rgba(34,197,94,.15);   color: #4ADE80; }
.badge-ship_pay_wait { background: rgba(234,179,8,.15);   color: #EAB308; }
.badge-ship_paid     { background: rgba(34,197,94,.15);   color: #22C55E; }
.badge-outbound_wait { background: rgba(20,184,166,.15);  color: #2DD4BF; }
.badge-outbound_done { background: rgba(59,130,246,.15);  color: #60A5FA; }
.badge-shipping      { background: rgba(59,130,246,.15);  color: #60A5FA; }
.badge-delivered     { background: rgba(16,185,129,.15);  color: #10B981; }
.badge-return_req    { background: rgba(244,63,94,.15);   color: #FB7185; }
.badge-return_pay_wait { background: rgba(244,63,94,.15); color: #FB7185; }
.badge-return_paid   { background: rgba(244,63,94,.15);   color: #FB7185; }
.badge-return_done   { background: rgba(156,163,175,.15); color: #9CA3AF; }
.badge-error         { background: rgba(239,68,68,.15);   color: #EF4444; }
.badge-error_ignore  { background: rgba(239,68,68,.15);   color: #EF4444; }
.badge-hold          { background: rgba(245,158,11,.15);  color: #F59E0B; }
.badge-not_arrived   { background: rgba(239,68,68,.15);   color: #EF4444; }
.badge-cancelled     { background: rgba(156,163,175,.15); color: #9CA3AF; }
.badge-deleted       { background: rgba(107,114,128,.15); color: #6B7280; }
.badge-completed     { background: rgba(16,185,129,.15);  color: #10B981; }
.badge-processing    { background: rgba(124,58,237,.15);  color: #8B5CF6; }

.badge-jp { background: rgba(239,68,68,.15);  color: #F87171; }
.badge-en { background: rgba(59,130,246,.15); color: #60A5FA; }

/* ─────────────────────────────────────────────
   DJANGO MESSAGES (Flash)
───────────────────────────────────────────── */
.messages-bar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 280px;
}
.message-item {
  padding: 12px 20px;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 600;
  animation: fadeIn .3s ease;
}
.message-item.success { background: var(--success); color: #fff; }
.message-item.error   { background: var(--danger);  color: #fff; }
.message-item.warning { background: var(--warning); color: #fff; }
.message-item.info    { background: var(--purple);  color: #fff; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
