/* ============================================================
   Nexsora Studio — Order flow
   Reuses tokens from style.css (midnight precision instrument)
   ============================================================ */

.ord-shell {
  position: relative;
  padding-top: 132px;
  padding-bottom: 80px;
  overflow: hidden;
}
.ord-bg-grid {
  position: absolute;
  inset: 0 0 auto 0;
  height: 620px;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 20%, transparent 78%);
  pointer-events: none;
}
.ord-bg-glow {
  position: absolute;
  top: -220px; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 500px;
  background: radial-gradient(ellipse at center, var(--glow-accent), transparent 62%);
  filter: blur(20px);
  pointer-events: none;
}
.ord-narrow { position: relative; max-width: 880px; }

/* ---------- Screens ---------- */
.ord-screen { display: none; }
.ord-screen.active { display: block; animation: ordIn .34s cubic-bezier(.2,.7,.3,1) both; }
@keyframes ordIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Start screen ---------- */
.ord-title {
  font-size: clamp(34px, 5.6vw, 56px);
  font-weight: 510;
  line-height: 1.02;
  letter-spacing: -0.022em;
  color: var(--color-paper);
}
.ord-title .accent { color: var(--color-acid-lime); }
.ord-sub {
  margin-top: 22px;
  max-width: 520px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--color-fog);
}

/* Type choice cards */
.ord-types {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.ord-type {
  position: relative;
  overflow: hidden;
  text-align: left;
  display: flex;
  flex-direction: column;
  background: var(--color-carbon);
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-subtle);
  padding: 28px;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: box-shadow .2s ease, transform .2s ease;
}
.ord-type::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 0%), var(--glow-accent-soft), transparent 42%);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.ord-type:hover { transform: translateY(-2px); box-shadow: var(--color-acid-lime) 0 0 0 1px inset, var(--shadow-sm); }
.ord-type:hover::after { opacity: 1; }
.ord-type:focus-visible { outline: 2px solid var(--color-acid-lime); outline-offset: 3px; }
.ord-type-ic {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-obsidian);
  border: 1px solid var(--color-graphite);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-acid-lime);
  margin-bottom: 22px;
}
.ord-type h3 {
  font-size: 20px;
  font-weight: 510;
  letter-spacing: -0.012em;
  color: var(--color-paper);
  margin-bottom: 10px;
}
.ord-type p {
  flex: 1;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-fog);
  margin-bottom: 22px;
}
.ord-type .go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--color-acid-lime);
}
.ord-type .go svg { transition: transform .18s ease; }
.ord-type:hover .go svg { transform: translateX(4px); }

/* Trust row */
.ord-trust {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--color-graphite);
  border: 1px solid var(--color-graphite);
  border-radius: var(--radius-xl);
  overflow: hidden;
}
.ord-trust div {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-void);
  padding: 18px 20px;
  font-size: 13.5px;
  color: var(--color-fog);
}
.ord-trust svg { color: var(--color-acid-lime); flex: none; }

/* ---------- Progress ---------- */
.ord-progress { margin-bottom: 26px; }
.ord-progress-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--color-ash);
  margin-bottom: 12px;
}
.ord-progress-top b { color: var(--color-mist); font-weight: 400; }
.ord-progress-top .cur { color: var(--color-acid-lime); }
.ord-segs { display: flex; gap: 6px; }
.ord-seg { flex: 1; min-width: 0; }
.ord-seg i {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: var(--color-graphite);
  transition: background .3s ease;
}
.ord-seg span {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  color: var(--color-ash);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .3s ease;
}
.ord-seg.done i { background: var(--color-acid-lime); opacity: .45; }
.ord-seg.cur i { background: var(--color-acid-lime); }
.ord-seg.cur span { color: var(--color-mist); }

/* ---------- Panel ---------- */
.ord-panel {
  position: relative;
  background: var(--color-carbon);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-subtle);
  padding: 32px;
}
.ord-step { display: none; }
.ord-step.active { display: block; animation: stepFwd .3s cubic-bezier(.2,.7,.3,1) both; }
.ord-step.active.back { animation-name: stepBack; }
@keyframes stepFwd { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@keyframes stepBack { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }

.ord-step-title {
  font-size: clamp(21px, 3vw, 26px);
  font-weight: 510;
  letter-spacing: -0.018em;
  color: var(--color-paper);
  margin-bottom: 8px;
}
.ord-step-hint {
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-fog);
  margin-bottom: 26px;
}
.ord-label {
  display: block;
  font-size: 13px;
  font-weight: 510;
  color: var(--color-mist);
  margin-bottom: 10px;
}
.ord-label span { color: var(--color-ash); font-weight: 400; }
.ord-block + .ord-block { margin-top: 22px; }

/* ---------- Option tiles ---------- */
.ord-opts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}
.ord-opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  padding: 13px 14px;
  background: var(--surface-faint);
  border: 1px solid var(--color-graphite);
  border-radius: var(--radius-md);
  color: var(--color-mist);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.ord-opt-ic { flex: none; display: flex; color: var(--color-ash); transition: color .15s ease; }
.ord-opt-txt { flex: 1; min-width: 0; }
.ord-opt-check {
  flex: none;
  width: 18px; height: 18px;
  border: 1px solid var(--color-graphite);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: transparent;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.ord-opts.single .ord-opt-check { border-radius: var(--radius-full); }
.ord-opt:hover { border-color: var(--color-smoke); background: var(--surface-hover); }
.ord-opt:focus-visible { outline: 2px solid var(--color-acid-lime); outline-offset: 2px; }
.ord-opt.sel {
  border-color: var(--color-acid-lime);
  background: var(--glow-accent-soft);
  color: var(--color-paper);
}
.ord-opt.sel .ord-opt-ic { color: var(--color-acid-lime); }
.ord-opt.sel .ord-opt-check {
  background: var(--color-acid-lime);
  border-color: var(--color-acid-lime);
  color: var(--color-on-accent);
}

/* ---------- Pills ---------- */
.ord-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ord-pill {
  background: var(--surface-soft);
  border: 1px solid var(--color-graphite);
  border-radius: var(--radius-full);
  color: var(--color-fog);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 7px 14px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.ord-pill:hover { border-color: var(--color-smoke); color: var(--color-mist); }
.ord-pill:focus-visible { outline: 2px solid var(--color-acid-lime); outline-offset: 2px; }
.ord-pill.sel {
  background: var(--color-acid-lime);
  border-color: var(--color-acid-lime);
  color: var(--color-on-accent);
}

/* ---------- Spec rows ---------- */
.ord-spec { padding: 18px 0; border-top: 1px solid var(--color-graphite); }
.ord-spec:first-child { border-top: none; padding-top: 0; }
.ord-spec:last-child { padding-bottom: 0; }
.ord-spec-name {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-ash);
  margin-bottom: 12px;
}
.ord-spec-name svg { color: var(--color-acid-lime); }

/* ---------- Budget ---------- */
.ord-budget {
  background: var(--surface-faint);
  border: 1px solid var(--color-graphite);
  border-radius: var(--radius-xl);
  padding: 22px;
  margin-bottom: 16px;
  transition: opacity .2s ease;
}
.ord-budget.off { opacity: .4; pointer-events: none; }
.ord-budget-cap {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-ash);
  margin-bottom: 10px;
}
.ord-budget-val {
  font-size: clamp(28px, 5vw, 36px);
  font-weight: 510;
  letter-spacing: -0.022em;
  line-height: 1.1;
  color: var(--color-paper);
}
.ord-budget-note { font-size: 13px; color: var(--color-fog); margin: 6px 0 20px; }

.ord-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(to right,
    var(--color-acid-lime) 0%, var(--color-acid-lime) var(--p, 50%),
    var(--color-graphite) var(--p, 50%), var(--color-graphite) 100%);
  outline: none;
  cursor: pointer;
}
.ord-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  border-radius: var(--radius-full);
  background: var(--color-acid-lime);
  border: 3px solid var(--color-carbon);
  box-shadow: 0 0 0 1px var(--color-acid-lime), var(--shadow-sm);
  transition: transform .15s ease;
}
.ord-range::-webkit-slider-thumb:hover { transform: scale(1.12); }
.ord-range::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: var(--radius-full);
  background: var(--color-acid-lime);
  border: 3px solid var(--color-carbon);
  box-shadow: 0 0 0 1px var(--color-acid-lime);
  cursor: pointer;
}
.ord-range::-moz-range-track { height: 3px; border-radius: 2px; background: transparent; }
.ord-range:focus-visible { outline: 2px solid var(--color-acid-lime); outline-offset: 6px; }
.ord-range-ends {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-ash);
  margin-top: 10px;
}

/* ---------- Inputs ---------- */
.ord-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--color-void);
  border: 1px solid var(--color-graphite);
  border-radius: var(--radius-md);
  color: var(--color-mist);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ord-input::placeholder { color: var(--color-ash); }
.ord-input:hover { border-color: var(--color-smoke); }
.ord-input:focus {
  outline: none;
  border-color: var(--color-acid-lime);
  box-shadow: 0 0 0 3px var(--glow-accent);
}
.ord-input.bad { border-color: var(--color-coral-red); box-shadow: 0 0 0 3px rgba(235,87,87,.12); }
textarea.ord-input { min-height: 148px; resize: vertical; display: block; }

.ord-tg { position: relative; }
.ord-tg .at {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--color-ash);
  pointer-events: none;
}
.ord-tg .ord-input { padding-left: 30px; }

.ord-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.ord-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-ash);
  text-align: right;
  margin-top: 8px;
}

.ord-err {
  display: none;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--color-coral-red);
}
.ord-err.show { display: flex; }
.ord-err svg { flex: none; }

/* ---------- Review ---------- */
.ord-review {
  border: 1px solid var(--color-graphite);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 16px;
}
.ord-review-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--surface-faint);
  border-bottom: 1px solid var(--color-graphite);
}
.ord-review-head .ic {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  background: var(--color-obsidian);
  border: 1px solid var(--color-graphite);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-acid-lime);
  flex: none;
}
.ord-review-head h3 { font-size: 16px; font-weight: 510; color: var(--color-paper); }
.ord-review-head p { font-size: 13px; color: var(--color-fog); margin-top: 2px; }

.ord-row {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 16px;
  padding: 14px 20px;
  border-top: 1px solid var(--color-graphite);
}
.ord-row:first-of-type { border-top: none; }
.ord-row .k {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-ash);
  padding-top: 3px;
}
.ord-row .v { font-size: 14px; color: var(--color-mist); overflow-wrap: anywhere; }
.ord-row .v.txt { color: var(--color-fog); white-space: pre-wrap; line-height: 1.65; }
.ord-row .v .muted { color: var(--color-ash); }
.ord-row .v strong { color: var(--color-paper); font-weight: 510; }
.ord-tags { display: flex; flex-wrap: wrap; gap: 7px; }

.ord-note {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface-faint);
  border: 1px solid var(--color-graphite);
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-fog);
}
.ord-note svg { flex: none; color: var(--color-acid-lime); margin-top: 2px; }

/* ---------- Nav buttons ---------- */
.ord-nav {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--color-graphite);
}
.ord-nav .btn-primary { flex: 1; padding: 12px 20px; font-size: 14px; }
.ord-nav .btn[disabled] { opacity: .55; pointer-events: none; }
.ord-spinner {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  animation: ordSpin .7s linear infinite;
}
@keyframes ordSpin { to { transform: rotate(360deg); } }

/* ---------- Success ---------- */
.ord-success { text-align: center; padding: 56px 32px; }
.ord-check {
  width: 64px; height: 64px;
  margin: 0 auto 28px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-acid-lime);
  background: var(--glow-accent);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-acid-lime);
  position: relative;
}
.ord-check::after {
  content: "";
  position: absolute; inset: -8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-acid-lime);
  opacity: .3;
  animation: ordPing 2.4s ease-out infinite;
}
@keyframes ordPing { 0% { transform: scale(.94); opacity: .35; } 70% { transform: scale(1.22); opacity: 0; } 100% { opacity: 0; } }
.ord-check path { stroke-dasharray: 34; stroke-dashoffset: 34; animation: ordDraw .5s ease .2s forwards; }
@keyframes ordDraw { to { stroke-dashoffset: 0; } }
.ord-success h2 {
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 510;
  letter-spacing: -0.022em;
  color: var(--color-paper);
  margin-bottom: 12px;
}
.ord-success p { font-size: 15px; color: var(--color-fog); max-width: 44ch; margin: 0 auto 6px; line-height: 1.65; }
.ord-ticket {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding: 7px 16px;
  border: 1px solid var(--color-graphite);
  border-radius: var(--radius-full);
  background: var(--surface-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-fog);
}
.ord-ticket b { color: var(--color-acid-lime); font-weight: 400; letter-spacing: .06em; }
.ord-success-actions {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .ord-shell { padding-top: 108px; }
  .ord-types { grid-template-columns: 1fr; }
  .ord-trust { grid-template-columns: 1fr; }
  .ord-seg span { display: none; }
}
@media (max-width: 560px) {
  .ord-panel { padding: 22px 18px; }
  .ord-opts { grid-template-columns: 1fr; }
  .ord-grid-2 { grid-template-columns: 1fr; gap: 14px; }
  .ord-row { grid-template-columns: 1fr; gap: 6px; padding: 13px 16px; }
  .ord-review-head { padding: 16px; }
  .ord-nav { flex-direction: column-reverse; }
  .ord-nav .btn { width: 100%; }
  .ord-success { padding: 40px 8px; }
  .ord-success-actions { flex-direction: column; }
  .ord-success-actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .ord-screen.active, .ord-step.active { animation: none; }
  .ord-check::after, .ord-check path { animation: none; stroke-dashoffset: 0; }
}
