/* ═══ Design Tokens & Reset ═══ */
:root {
  --bg: #050505;
  --bg-raised: #0e0e0e;
  --bg-elevated: #161616;
  --bg-surface: #1e1e1e;
  --bg-hover: #262626;
  --bg-overlay: rgba(0,0,0,.65);
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --text-tertiary: #666;
  --text-faint: #3a3a3a;
  --accent: #e8a849;
  --accent-hover: #f0b85e;
  --accent-muted: rgba(232,168,73,.1);
  --accent-subtle: rgba(232,168,73,.06);
  --red: #ef4444;
  --green: #22c55e;
  --blue: #3b82f6;
  --border: #1a1a1a;
  --border-light: #252525;
  --border-focus: #404040;
  --radius-xs: 6px;
  --radius-s: 10px;
  --radius-m: 14px;
  --radius-l: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 4px 24px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,.5);
  --shadow-glow: 0 0 80px rgba(232,168,73,.04);
  --ease: cubic-bezier(.16,1,.3,1);
  --ease-out: cubic-bezier(.33,1,.68,1);
  --ease-bounce: cubic-bezier(.34,1.56,.64,1);
  --fast: 100ms;
  --normal: 250ms;
  --slow: 400ms;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', monospace;
  --max-w: 640px;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body { font-family: var(--font); line-height: 1.5; background: var(--bg); color: var(--text-primary); min-height: 100vh; min-height: 100dvh; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; font-size: inherit; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; border: none; outline: none; background: none; color: inherit; }
img { display: block; max-width: 100%; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 9px; }
::selection { background: rgba(232,168,73,.2); }
#root { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* Page transitions */
.page { flex: 1; display: flex; flex-direction: column; opacity: 0; transform: translateY(12px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.page.mounted { opacity: 1; transform: translateY(0); }

/* Toast — enhanced */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-light); padding: 10px 22px; border-radius: var(--radius-full); font-size: .8125rem; font-weight: 500; box-shadow: var(--shadow-md); opacity: 0; transform: translateY(14px) scale(.92); transition: all .4s var(--ease-bounce); display: flex; align-items: center; gap: 8px; backdrop-filter: blur(12px); }
.toast.on { opacity: 1; transform: translateY(0) scale(1); }
.toast.ok { border-color: rgba(34,197,94,.25); color: var(--green); }
.toast.err { border-color: rgba(239,68,68,.25); color: var(--red); }
.toast-icon { width: 14px; height: 14px; flex-shrink: 0; }
.toast-icon svg { width: 14px; height: 14px; }

/* Spinner */
.spinner { width: 28px; height: 28px; border: 2.5px solid var(--bg-surface); border-top-color: var(--text-secondary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Shared Form */
.form-field { display: flex; flex-direction: column; gap: 7px; }
.form-label { font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text-tertiary); }
.form-input { padding: 12px 14px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius-s); font-size: .9375rem; transition: border-color .2s ease, box-shadow .2s ease; width: 100%; }
.form-input:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px rgba(255,255,255,.03); }
.form-input::placeholder { color: var(--text-faint); }

/* Shared Buttons */
.btn-primary { padding: 14px; background: var(--text-primary); color: var(--bg); font-weight: 600; font-size: .9375rem; border-radius: var(--radius-m); transition: all .18s ease; letter-spacing: -.01em; width: 100%; text-align: center; display: inline-block; position: relative; overflow: hidden; }
.btn-primary::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,.1) 50%, transparent 60%); transform: translateX(-100%); transition: transform .5s ease; }
.btn-primary:hover { opacity: .88; transform: translateY(-2px); box-shadow: 0 4px 20px rgba(255,255,255,.1); }
.btn-primary:hover::after { transform: translateX(100%); }
.btn-primary:active { transform: translateY(0); opacity: .75; box-shadow: none; }
.btn-primary:disabled { opacity: .3; cursor: not-allowed; transform: none; }
.btn-secondary { padding: 12px 20px; background: var(--bg-raised); color: var(--text-secondary); border: 1px solid var(--border); font-weight: 600; font-size: .875rem; border-radius: var(--radius-m); transition: all .15s ease; text-align: center; display: inline-block; }
.btn-secondary:hover { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--border-focus); }
.btn-row { display: flex; gap: 10px; margin-top: 4px; }
.btn-row .btn-primary { flex: 1; }
.btn-row .btn-secondary { flex: 0 0 auto; padding: 14px 20px; }
.btn-sm { padding: 6px 14px; font-size: .75rem; border-radius: var(--radius-s); background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-secondary); cursor: pointer; transition: all var(--fast) ease; }
.btn-sm:hover { background: var(--bg-surface); color: var(--text-primary); }

/* Toggle */
.visibility-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--bg-raised); border-radius: var(--radius-s); border: 1px solid var(--border); }
.visibility-label { font-size: .875rem; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.visibility-label svg { width: 16px; height: 16px; }
.toggle { width: 44px; height: 24px; border-radius: 12px; background: var(--bg-surface); cursor: pointer; position: relative; transition: background .2s ease; flex-shrink: 0; }
.toggle.on { background: var(--accent); }
.toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease-bounce); box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.toggle.on::after { transform: translateX(20px); }

/* Artwork picker */
.artwork-picker { display: flex; align-items: center; gap: 16px; }
.artwork-preview { width: 84px; height: 84px; border-radius: var(--radius-m); background: var(--bg-elevated); border: 1px dashed var(--border-light); display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; transition: all .2s ease; flex-shrink: 0; position: relative; }
.artwork-preview:hover { border-color: var(--border-focus); transform: scale(1.02); }
.artwork-preview img { width: 100%; height: 100%; object-fit: cover; }
.artwork-preview svg { width: 22px; height: 22px; color: var(--text-faint); }
.artwork-preview input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.artwork-info { font-size: .8125rem; color: var(--text-tertiary); line-height: 1.55; }
.artwork-info strong { color: var(--text-secondary); font-weight: 500; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; transition: opacity var(--normal) var(--ease); }
.modal-overlay.open { opacity: 1; }
.modal { background: var(--bg-raised); border: 1px solid var(--border-light); border-radius: var(--radius-l); width: 100%; max-width: 440px; overflow: hidden; transform: scale(.94) translateY(12px); transition: transform .45s var(--ease-bounce); }
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-header { padding: 20px 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-close { width: 30px; height: 30px; border-radius: var(--radius-xs); display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); transition: all .15s ease; }
.modal-close:hover { background: rgba(255,255,255,.06); color: var(--text-primary); transform: rotate(90deg); }
.modal-close svg { width: 16px; height: 16px; }
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
