/* =====================================================
   DEMO MODAL — 预约演示 / BD 联系表单
   MothPay Precision Finance Design System v3
   ===================================================== */

/* ── Overlay ── */
.demo-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(5, 12, 26, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.demo-modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* ── Modal Panel ── */
.demo-modal {
  position: relative;
  width: 100%;
  max-width: 580px;
  background: var(--bg-surface, #0A1628);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-md, 6px);
  overflow: hidden;
  transform: translateY(18px) scale(0.98);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow:
    0 0 0 1px rgba(0, 102, 255, 0.18),
    0 24px 64px rgba(0, 0, 0, 0.55);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.demo-modal-overlay.is-open .demo-modal {
  transform: translateY(0) scale(1);
}

/* Top accent line */
.demo-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-electric, #0066FF), var(--neon-cyan, #00E5FF));
}

/* ── Header ── */
.demo-modal-header {
  padding: 28px 28px 0;
  flex-shrink: 0;
}

.demo-modal-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--neon-cyan, #00E5FF);
  margin-bottom: 12px;
}

.demo-modal-tag::before {
  content: '//';
  opacity: 0.7;
}

.demo-modal-title {
  font-family: var(--font-heading, 'Space Grotesk', sans-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--white, #fff);
  line-height: 1.3;
  margin: 0 0 6px;
}

.demo-modal-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  margin: 0;
  line-height: 1.6;
}

/* ── Close Button ── */
.demo-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-sm, 4px);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}

.demo-modal-close:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--white, #fff);
  border-color: rgba(255, 255, 255, 0.20);
}

/* ── Body / Scrollable ── */
.demo-modal-body {
  padding: 24px 28px 28px;
  overflow-y: auto;
  flex: 1;
}

/* ── Form Layout ── */
.demo-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.demo-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .demo-form-row {
    grid-template-columns: 1fr;
  }
}

/* ── Field ── */
.demo-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.demo-field label {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.45);
}

.demo-field label .req {
  color: var(--brand-electric, #0066FF);
  margin-left: 2px;
}

.demo-field input,
.demo-field select,
.demo-field textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-sm, 4px);
  color: var(--white, #fff);
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 14px;
  padding: 10px 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}

.demo-field input::placeholder,
.demo-field textarea::placeholder {
  color: rgba(255, 255, 255, 0.22);
}

.demo-field input:focus,
.demo-field select:focus,
.demo-field textarea:focus {
  border-color: var(--brand-electric, #0066FF);
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.14);
}

.demo-field select {
  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='rgba(255,255,255,0.4)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.demo-field select option {
  background: #0A1628;
  color: #fff;
}

.demo-field textarea {
  resize: vertical;
  min-height: 80px;
}

/* ── Submit ── */
.demo-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.demo-form-note {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.28);
  line-height: 1.5;
  flex: 1;
  min-width: 160px;
}

.demo-submit-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-electric, #0066FF);
  color: #fff;
  font-family: var(--font-heading, 'Space Grotesk', sans-serif);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 24px;
  border: none;
  border-radius: var(--radius-sm, 4px);
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s ease;
  white-space: nowrap;
}

.demo-submit-btn:hover {
  background: var(--brand-electric-lt, #3385FF);
}

.demo-submit-btn:active {
  transform: scale(0.98);
}

.demo-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ── Success State ── */
.demo-success {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 28px 52px;
  gap: 16px;
}

.demo-success.is-visible {
  display: flex;
}

.demo-success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0, 200, 83, 0.12);
  border: 1px solid rgba(0, 200, 83, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-success-icon svg {
  width: 26px;
  height: 26px;
  stroke: var(--status-green, #00C853);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.demo-success-title {
  font-family: var(--font-heading, 'Space Grotesk', sans-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--white, #fff);
  margin: 0;
}

.demo-success-desc {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.6;
  max-width: 340px;
  margin: 0;
}

/* ── Loading spinner ── */
.demo-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: demo-spin 0.7s linear infinite;
  display: none;
}

.demo-submit-btn.is-loading .demo-spinner {
  display: inline-block;
}

.demo-submit-btn.is-loading .demo-btn-text {
  opacity: 0.6;
}

@keyframes demo-spin {
  to { transform: rotate(360deg); }
}

/* ── Mobile ── */
@media (max-width: 600px) {
  .demo-modal {
    max-width: 100%;
    margin: 0;
    border-radius: var(--radius-sm, 4px);
  }

  .demo-modal-header {
    padding: 22px 20px 0;
  }

  .demo-modal-body {
    padding: 20px 20px 24px;
  }

  .demo-form-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .demo-submit-btn {
    justify-content: center;
    width: 100%;
  }
}
