/* ============================================================
   XNEXUS — css/demo.css
   Phase 26-A: Demo Request Form + Tracking Page
   ============================================================ */

/* ── Form wrapper ────────────────────────────────────────── */
.demo-form-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 0;
}
.demo-form-title {
  font-size: 1.6rem;
  font-weight: 600;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 8px;
}
.demo-form-subtitle {
  font-size: .92rem;
  opacity: .5;
  margin: 0 0 32px;
}

/* ── Form grid ───────────────────────────────────────────── */
.demo-form-grid {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.demo-fieldset {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius, 12px);
  padding: 20px 22px 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
}
.demo-fieldset legend {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.45);
  padding: 0 8px;
}
.demo-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: .78rem;
  color: rgba(255,255,255,.5);
}
.demo-input {
  width: 100%;
  padding: 9px 12px;
  font-size: .88rem;
  font-family: inherit;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  color: #F5F7FF;
  transition: border-color .2s;
  box-sizing: border-box;
}
.demo-input:focus {
  outline: none;
  border-color: rgba(46,214,255,.4);
}
.demo-input::placeholder {
  color: rgba(255,255,255,.2);
}
select.demo-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
textarea.demo-input {
  resize: vertical;
  min-height: 60px;
}

/* ── Product checkboxes ──────────────────────────────────── */
.demo-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 6px;
}
.demo-product-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  cursor: pointer;
  font-size: .84rem;
  color: rgba(255,255,255,.7);
  transition: border-color .2s, background .2s;
}
.demo-product-check:hover {
  border-color: rgba(46,214,255,.25);
  background: rgba(46,214,255,.04);
}
.demo-product-check input[type="checkbox"] {
  accent-color: #2ED6FF;
  width: 16px;
  height: 16px;
}

/* ── Submit button ───────────────────────────────────────── */
.demo-submit-btn {
  margin-top: 24px;
  width: 100%;
  padding: 14px;
  font-size: 1rem;
}

/* ── Error message ───────────────────────────────────────── */
.demo-form-error {
  color: #FF6B6B;
  font-size: .84rem;
  line-height: 1.5;
  padding: 12px 16px;
  border: 1px solid rgba(255,80,80,.2);
  border-radius: 8px;
  background: rgba(255,80,80,.06);
  margin-top: 16px;
}

/* ── Success state ───────────────────────────────────────── */
.demo-success {
  text-align: center;
  padding: 40px 0;
}
.demo-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(16,185,129,.12);
  color: #10B981;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.demo-success h3 {
  font-size: 1.2rem;
  margin: 0 0 12px;
  color: #F5F7FF;
}
.demo-success p {
  font-size: .9rem;
  opacity: .6;
  margin: 0 0 8px;
}
.demo-success-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem;
  font-weight: 600;
  color: #2ED6FF;
  padding: 12px 20px;
  background: rgba(46,214,255,.08);
  border: 1px solid rgba(46,214,255,.2);
  border-radius: 10px;
  display: inline-block;
  margin: 8px 0 20px;
}
.demo-success-link {
  display: block;
  font-size: .78rem;
  color: #8B5CF6;
  word-break: break-all;
  padding: 10px 16px;
  background: rgba(139,92,246,.06);
  border: 1px solid rgba(139,92,246,.15);
  border-radius: 8px;
  margin: 8px auto 20px;
  max-width: 600px;
}
.demo-success-note {
  font-size: .82rem;
  opacity: .4;
}

/* ── Tracking overlay ────────────────────────────────────── */
.demo-tracking-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.demo-tracking-card {
  background: var(--bg-card, #0B1020);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}
.demo-tracking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.demo-tracking-header h2 {
  font-size: 1.1rem;
  margin: 0;
  color: #F5F7FF;
}
.demo-tracking-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255,255,255,.06);
  border-radius: 8px;
  color: rgba(255,255,255,.5);
  font-size: 1.2rem;
  cursor: pointer;
}

/* ── Tracking content ────────────────────────────────────── */
.dr-track-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 12px;
}
.dr-track-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 600;
  color: #F5F7FF;
}
.dr-track-status {
  padding: 4px 14px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  border: 1px solid;
}
.dr-track-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 24px 16px;
  font-size: .84rem;
  color: rgba(255,255,255,.5);
}
.dr-track-info strong {
  color: #F5F7FF;
}

/* ── Timeline ────────────────────────────────────────────── */
.dr-timeline {
  padding: 0 24px 20px;
}
.dr-timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 10px 0;
  position: relative;
}
.dr-timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 26px;
  bottom: -4px;
  width: 2px;
  background: rgba(255,255,255,.08);
}
.dr-timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
}
.dr-timeline-content {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dr-timeline-label {
  font-size: .84rem;
  font-weight: 600;
}
.dr-timeline-date {
  font-size: .75rem;
  opacity: .4;
}
.dr-timeline-current .dr-timeline-dot {
  box-shadow: 0 0 0 4px rgba(46,214,255,.15);
}
.dr-track-footer {
  padding: 12px 24px 24px;
  font-size: .82rem;
  opacity: .35;
  margin: 0;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .demo-fieldset {
    grid-template-columns: 1fr;
  }
  .demo-form-wrap {
    padding: 24px 0;
  }
  .demo-tracking-card {
    max-height: 95vh;
    border-radius: 12px;
  }
}

/* ── Phase 26-B: Conversation thread in tracking ─────────── */
.dr-convo-section {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.dr-convo-title {
  font-size: .88rem;
  font-weight: 600;
  margin: 0 0 12px;
  color: rgba(255,255,255,.7);
}
.dr-convo-msg {
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 8px;
  max-width: 85%;
}
.dr-convo-msg--admin {
  background: rgba(201,60,255,.06);
  border: 1px solid rgba(201,60,255,.12);
  margin-right: auto;
}
.dr-convo-msg--customer {
  background: rgba(46,214,255,.06);
  border: 1px solid rgba(46,214,255,.12);
  margin-left: auto;
}
.dr-convo-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}
.dr-convo-author {
  font-size: .72rem;
  font-weight: 600;
  opacity: .6;
}
.dr-convo-time {
  font-size: .68rem;
  opacity: .35;
}
.dr-convo-text {
  font-size: .84rem;
  color: rgba(255,255,255,.85);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Phase 26-B: Reply section ───────────────────────────── */
.dr-reply-section {
  padding: 12px 24px 20px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.dr-reply-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  font-size: .86rem;
  font-family: inherit;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  color: #F5F7FF;
  resize: vertical;
}
.dr-reply-input:focus {
  outline: none;
  border-color: rgba(46,214,255,.35);
}
.dr-reply-input::placeholder {
  color: rgba(255,255,255,.2);
}
.dr-reply-btn {
  padding: 8px 20px;
  font-size: .82rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 8px;
  border: 1px solid rgba(46,214,255,.3);
  background: rgba(46,214,255,.1);
  color: #2ED6FF;
  cursor: pointer;
}
.dr-reply-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* Track existing request hint — shown below submit button */
.demo-track-hint {
  text-align: center;
  font-size: .82rem;
  color: rgba(255,255,255,.35);
  margin: 10px 0 0;
}
.demo-track-link {
  color: rgba(46,214,255,.75);
  text-decoration: none;
  transition: color .2s;
}
.demo-track-link:hover {
  color: #2ED6FF;
}
