/* =========================================================================
   Evden Memory · Custom Order (Dark / Neon Hi-End)
   Palette: charcoal + cyan neon + metallic gold
   Type:    Space Grotesk (display/mono-label) + Pretendard (body KR)
   Layout:  left=product (locked) / right=form (2 fields only)
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

* { box-sizing: border-box; }

:root {
  --bg-0: #07070A;
  --bg-1: #0E0E14;
  --bg-2: #14141C;
  --bg-3: #1B1B24;
  --line: #25252F;
  --line-strong: #34343F;
  --fg-0: #F5F5F7;
  --fg-1: #C8C8D0;
  --fg-2: #8E8E98;
  --fg-3: #5A5A66;
  --neon: #00E5FF;
  --neon-soft: rgba(0, 229, 255, 0.45);
  --neon-faint: rgba(0, 229, 255, 0.12);
  --gold: #B89557;
  --danger: #FF4D6D;

  --sans-en: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --sans-kr: 'Pretendard', 'Space Grotesk', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

html, body { margin: 0; padding: 0; }
html { color-scheme: dark; }
body {
  background: var(--bg-0);
  color: var(--fg-0);
  font-family: var(--sans-kr);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(900px 600px at 85% -10%, rgba(0,229,255,0.06), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(0,229,255,0.04), transparent 60%);
}

::selection { background: var(--neon); color: var(--bg-0); }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4 { font-family: var(--sans-en); font-weight: 600; letter-spacing: -0.01em; margin: 0; }

.mono {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Layout ---------- */
.shell {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
}
@media (min-width: 768px) { .shell { padding: 0 48px; } }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--sans-en);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.01em;
}
.brand .dot {
  width: 8px; height: 8px;
  background: var(--neon);
  box-shadow: 0 0 12px var(--neon);
  display: inline-block;
}
.brand .name-2 { color: var(--fg-2); font-weight: 400; }
.topbar .session-id {
  font-family: var(--mono);
  font-size: 11px; color: var(--fg-3);
  letter-spacing: 0.1em;
}

/* ---------- Page grid: product (left) + form (right) ---------- */
.order-page {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  min-height: calc(100vh - 64px - 56px);
}
@media (min-width: 980px) {
  .order-page {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
  }
}

/* === Left: product pane === */
.product-pane {
  background: var(--bg-1);
  border-right: 1px solid var(--line);
  padding: 40px 28px;
  display: flex; flex-direction: column; gap: 24px;
}
@media (min-width: 980px) {
  .product-pane {
    padding: 56px 48px;
    position: sticky; top: 0;
    height: calc(100vh - 64px);
  }
}

.locked-tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: var(--neon-faint);
  border: 1px solid var(--neon-soft);
  color: var(--neon);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  width: fit-content;
}
.locked-tag .pulse {
  width: 6px; height: 6px; background: var(--neon);
  box-shadow: 0 0 8px var(--neon);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.product-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background:
    linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--line);
  overflow: hidden;
}
.product-thumb::before {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(transparent 95%, var(--neon-faint) 100%),
    linear-gradient(90deg, transparent 95%, var(--neon-faint) 100%);
  background-size: 32px 32px;
  pointer-events: none;
  opacity: 0.6;
}
.product-thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: contain; padding: 32px;
}
.product-thumb .corner {
  position: absolute;
  width: 12px; height: 12px;
  border: 1px solid var(--neon);
}
.product-thumb .corner.tl { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.product-thumb .corner.tr { top: 8px; right: 8px; border-left: 0; border-bottom: 0; }
.product-thumb .corner.bl { bottom: 8px; left: 8px; border-right: 0; border-top: 0; }
.product-thumb .corner.br { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }

.product-meta { display: grid; gap: 14px; }
.product-meta .label-line {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--fg-3);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.product-meta .label-line .val { color: var(--fg-1); }
.product-meta h1 {
  font-family: var(--sans-en);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 600;
  line-height: 1.05;
  color: var(--fg-0);
}
.product-meta .tagline {
  color: var(--fg-2);
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}
.product-meta .spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--line);
  margin-top: 12px;
}
.product-meta .spec-grid .cell {
  padding: 12px 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.product-meta .spec-grid .cell:nth-child(2n) { border-right: 0; }
.product-meta .spec-grid .cell:nth-last-child(-n+2) { border-bottom: 0; }
.product-meta .spec-grid .k {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 4px;
}
.product-meta .spec-grid .v {
  font-size: 13px;
  color: var(--fg-0);
  font-weight: 500;
}

/* === Right: form pane === */
.form-pane {
  padding: 40px 28px 64px;
  display: flex; flex-direction: column; gap: 28px;
}
@media (min-width: 980px) {
  .form-pane { padding: 56px 56px 80px; }
}

.form-head { display: grid; gap: 8px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.form-head .step-line {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--neon);
}
.form-head .step-line .bar {
  flex: 1; height: 1px; background: linear-gradient(90deg, var(--neon-soft), transparent);
}
.form-head h2 {
  font-family: var(--sans-en);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 600;
  color: var(--fg-0);
}
.form-head p { color: var(--fg-2); font-size: 14px; margin: 0; }

.order-form { display: grid; gap: 32px; }

/* Field block */
.field {
  display: grid;
  gap: 10px;
}
.field .field-head {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.field .field-head .idx { color: var(--neon); }
.field .field-head .req { color: var(--fg-3); }
.field label.lbl { font-size: 15px; color: var(--fg-0); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--fg-3); margin: 0; }

.field input.text-input {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-left: 2px solid var(--line-strong);
  color: var(--fg-0);
  padding: 14px 16px;
  font-size: 15px;
  font-family: var(--sans-kr);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.field input.text-input::placeholder { color: var(--fg-3); }
.field input.text-input:focus {
  outline: none;
  border-color: var(--line-strong);
  border-left-color: var(--neon);
  background: var(--bg-2);
  box-shadow: 0 0 0 1px var(--neon-faint), 0 0 24px var(--neon-faint);
}

.field input.text-input.readonly,
.field input.text-input[readonly] {
  background: var(--bg-1);
  color: var(--fg-1);
  border-left-color: var(--neon);
  cursor: not-allowed;
}

/* Dropzone */
.dropzone {
  position: relative;
  background: var(--bg-1);
  border: 1px dashed var(--line-strong);
  padding: 36px 24px;
  aspect-ratio: 4 / 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.dropzone:hover,
.dropzone.dragover {
  border-color: var(--neon);
  background: var(--bg-2);
  box-shadow: inset 0 0 0 1px var(--neon-faint), 0 0 32px var(--neon-faint);
}
.dropzone .icon { width: 36px; height: 36px; color: var(--fg-2); }
.dropzone:hover .icon, .dropzone.dragover .icon { color: var(--neon); }
.dropzone .title { font-size: 14px; color: var(--fg-1); font-weight: 500; }
.dropzone .sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--fg-3);
  text-transform: uppercase;
}
.dropzone input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
}

.preview {
  display: none;
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg-1);
  border: 1px solid var(--neon-soft);
  box-shadow: 0 0 32px var(--neon-faint);
}
.preview.show { display: block; }
.preview img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: contain;
}
.preview .reset {
  position: absolute; top: 12px; right: 12px;
  background: var(--bg-0);
  border: 1px solid var(--line-strong);
  color: var(--fg-0);
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: border-color .2s, color .2s;
}
.preview .reset:hover {
  border-color: var(--neon);
  color: var(--neon);
}
.preview .info {
  position: absolute; bottom: 12px; left: 12px;
  background: var(--bg-0);
  border: 1px solid var(--line);
  color: var(--fg-1);
  padding: 4px 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.uploader-error {
  display: none;
  margin-top: 4px;
  padding: 10px 12px;
  background: rgba(255, 77, 109, 0.06);
  border: 1px solid rgba(255, 77, 109, 0.4);
  color: var(--danger);
  font-size: 13px;
}
.uploader-error.show { display: block; }

/* CTA */
.cta {
  display: grid;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 24px;
}
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--neon);
  color: var(--bg-0);
  border: 0;
  padding: 18px 24px;
  font-family: var(--sans-en);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  width: 100%;
  transition: background .2s, box-shadow .2s, transform .15s;
  box-shadow: 0 0 0 1px var(--neon), 0 0 24px var(--neon-soft);
}
.btn-primary:hover:not(:disabled) {
  background: #5BF2FF;
  box-shadow: 0 0 0 1px var(--neon), 0 0 40px var(--neon-soft);
  transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled {
  background: var(--bg-3);
  color: var(--fg-3);
  box-shadow: 0 0 0 1px var(--line-strong);
  cursor: not-allowed;
}
.cta .note {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--fg-3);
  letter-spacing: 0.1em;
  text-align: center;
}

/* Success */
.success {
  display: none;
  border: 1px solid var(--neon-soft);
  background: var(--bg-1);
  padding: 48px 32px;
  text-align: center;
  box-shadow: 0 0 48px var(--neon-faint);
  animation: rise .5s ease-out;
}
.success.show { display: block; }
.success .check {
  width: 56px; height: 56px;
  margin: 0 auto 20px;
  border: 1px solid var(--neon);
  background: var(--neon-faint);
  color: var(--neon);
  font-size: 28px;
  display: flex; align-items: center; justify-content: center;
}
.success h3 {
  font-size: 24px;
  margin-bottom: 12px;
  color: var(--fg-0);
}
.success p { color: var(--fg-2); font-size: 14px; margin: 0 0 24px; line-height: 1.6; }
.success .receipt {
  display: inline-block;
  padding: 10px 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--neon);
  letter-spacing: 0.18em;
}

/* Footer */
.foot {
  height: 56px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--fg-3);
  text-transform: uppercase;
}

/* Index (admin/internal) page */
.index-page {
  padding: 80px 0;
}
.index-page h1 {
  font-family: var(--sans-en);
  font-size: clamp(36px, 5vw, 56px);
  margin-bottom: 16px;
}
.index-page .lead { color: var(--fg-2); max-width: 580px; margin-bottom: 48px; }
.index-page .link-table {
  width: 100%;
  border: 1px solid var(--line);
}
.index-page .link-row {
  display: grid;
  grid-template-columns: 56px 1fr 1.2fr auto;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  transition: background .15s;
}
.index-page .link-row:last-child { border-bottom: 0; }
.index-page .link-row:hover { background: var(--bg-1); }
.index-page .link-row .idx { color: var(--fg-3); }
.index-page .link-row .name { color: var(--fg-0); text-transform: none; font-weight: 500; }
.index-page .link-row .url { color: var(--neon); text-transform: none; }
.index-page .link-row .arrow { color: var(--fg-2); }
.index-page .link-row:hover .arrow { color: var(--neon); }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise .45s ease-out both; }

/* Mobile tweaks */
@media (max-width: 979px) {
  /* 폼이 먼저 보이도록 순서 뒤집기 — 고객이 진입 즉시 입력 시작 가능 */
  .order-page { display: flex; flex-direction: column; }
  .form-pane { order: 1; }
  .product-pane {
    order: 2;
    border-right: 0;
    border-bottom: 0;
    border-top: 1px solid var(--line);
  }
  .product-pane .product-thumb { aspect-ratio: 1 / 1; max-width: 360px; margin: 0 auto; width: 100%; }
}
@media (max-width: 600px) {
  .topbar { height: 56px; }
  .product-pane, .form-pane { padding: 28px 20px; }
  .product-meta .spec-grid { grid-template-columns: 1fr; }
  .product-meta .spec-grid .cell { border-right: 0; }
  .product-meta .spec-grid .cell:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .foot { padding: 0 20px; height: 48px; font-size: 9px; }
  .index-page .link-row { grid-template-columns: 32px 1fr auto; font-size: 11px; }
  .index-page .link-row .url { display: none; }
}
