#demo-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(5, 8, 15, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: dmo-fadeIn 0.22s ease;
}
#demo-modal-overlay.active {
  display: flex;
}

@keyframes dmo-fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

#demo-modal-card {
  position: relative;
  background: linear-gradient(145deg, #0d1117 0%, #111827 60%, #0d1117 100%);
  border: 1px solid rgba(188, 160, 106, 0.22);
  border-radius: 1.5rem;
  box-shadow:
    0 0 0 1px rgba(188, 160, 106, 0.08),
    0 32px 80px rgba(0, 0, 0, 0.7),
    0 0 60px rgba(188, 160, 106, 0.07) inset;
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  max-height: 90dvh; 
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: dmo-slideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes dmo-slideUp {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#demo-modal-card::before {
  content: "";
  display: block;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(188, 160, 106, 0.7) 30%,
    rgba(188, 160, 106, 1) 50%,
    rgba(188, 160, 106, 0.7) 70%,
    transparent 100%
  );
}

#demo-modal-card::after {
  content: "";
  position: absolute;
  top: -120px;
  right: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(188, 160, 106, 0.14) 0%, transparent 70%);
  pointer-events: none;
}

.dmo-header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 2rem 0;
}

.dmo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.85rem;
  border-radius: 999px;
  background: rgba(188, 160, 106, 0.12);
  border: 1px solid rgba(188, 160, 106, 0.25);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #bca06a;
  margin-bottom: 0.75rem;
}
.dmo-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #bca06a;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.75);
  }
}
.dmo-title {
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f3f4f6;
  line-height: 1.2;
  margin: 0;
}
.dmo-title em {
  font-style: normal;
  background: linear-gradient(90deg, #d4a853, #bca06a, #e8c97a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.dmo-subtitle {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: #9ca3af;
  line-height: 1.55;
}

.dmo-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s;
  margin-top: 0.2rem;
}
.dmo-close:hover {
  background: rgba(188, 160, 106, 0.12);
  border-color: rgba(188, 160, 106, 0.35);
  color: #bca06a;
}
.dmo-close svg {
  pointer-events: none;
}

.dmo-divider {
  flex: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(188, 160, 106, 0.15), transparent);
  margin: 1.5rem 2rem 0;
}

.dmo-body {
  flex: 1 1 auto;
  min-height: 0; 
  padding: 1.5rem 2rem 2rem;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.dmo-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 480px) {
  .dmo-row {
    grid-template-columns: 1fr;
  }

    #demo-modal-card {
    max-height: 95dvh;
    border-radius: 1.1rem;
  }
  .dmo-header {
    padding: 1.25rem 1.25rem 0;
  }
  .dmo-divider {
    margin: 1rem 1.25rem 0;
  }
  .dmo-body {
    padding: 1rem 1.25rem 1.25rem;
  }
  .dmo-features {
    padding: 0.85rem 1.25rem 1.25rem;
    gap: 0.4rem 1rem;
  }
}




.dmo-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.dmo-field:last-child {
  margin-bottom: 0;
}

.dmo-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9ca3af;
}
.dmo-required {
  color: #bca06a;
  margin-left: 2px;
}

.dmo-input,
.dmo-select,
.dmo-textarea {
  padding: 0.65rem 0.9rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0.6rem;
  color: #f3f4f6;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition:
    border-color 0.2s,
    background 0.2s,
    box-shadow 0.2s;
  width: 100%;
  box-sizing: border-box;
}
.dmo-input::placeholder,
.dmo-textarea::placeholder {
  color: #4b5563;
}

.dmo-input:focus,
.dmo-select:focus,
.dmo-textarea:focus {
  background: rgba(188, 160, 106, 0.05);
  border-color: rgba(188, 160, 106, 0.45);
  box-shadow: 0 0 0 3px rgba(188, 160, 106, 0.1);
}

.dmo-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1em;
  padding-right: 2.25rem;
  cursor: pointer;
}
.dmo-select option {
  background: #111827;
  color: #f3f4f6;
}

.dmo-textarea {
  resize: vertical;
  min-height: 82px;
  line-height: 1.5;
}

.dmo-privacy {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 1.1rem;
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.5;
}
.dmo-privacy svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: #bca06a;
}

.dmo-submit {
  margin-top: 1.25rem;
  width: 100%;
  padding: 0.85rem 1.25rem;
  border-radius: 0.7rem;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0d1117;
  background: linear-gradient(135deg, #d4a853 0%, #bca06a 50%, #c9943e 100%);
  box-shadow: 0 0 24px rgba(188, 160, 106, 0.35);
  position: relative;
  overflow: hidden;
  transition:
    box-shadow 0.3s,
    opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.dmo-submit:hover {
  box-shadow: 0 0 40px rgba(188, 160, 106, 0.55);
}
.dmo-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.dmo-submit::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transition: transform 0.6s ease;
}
.dmo-submit:not(:disabled):hover::after {
  transform: translateX(100%);
}

.dmo-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-top-color: #0d1117;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.dmo-success,
.dmo-error {
  display: none;
  text-align: center;
  padding: 2.5rem 2rem;
}
.dmo-success-icon,
.dmo-error-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 1.75rem;
}
.dmo-success-icon {
  background: rgba(188, 160, 106, 0.12);
  color: #bca06a;
}
.dmo-error-icon {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}
.dmo-success h3 {
  color: #f3f4f6;
  font-weight: 100;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
}
.dmo-error h3 {
  color: #f87171;
  font-weight: 600;
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}
.dmo-success p,
.dmo-error p {
  color: #9ca3af;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}
.dmo-error-retry {
  margin-top: 1.25rem;
  padding: 0.6rem 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(188, 160, 106, 0.3);
  background: transparent;
  color: #bca06a;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s;
}
.dmo-error-retry:hover {
  background: rgba(188, 160, 106, 0.08);
  border-color: rgba(188, 160, 106, 0.5);
}

.dmo-features {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  padding: 1rem 2rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.dmo-feature {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #6b7280;
  letter-spacing: 0.04em;
}
.dmo-feature svg {
  color: #bca06a;
  flex-shrink: 0;
}


:root.light #demo-modal-overlay {
  background: rgba(255, 255, 255, 0.75);
}

:root.light #demo-modal-card {
  background: linear-gradient(145deg, #ffffff 0%, #f9fafb 60%, #ffffff 100%);
  border: 1px solid rgba(188, 160, 106, 0.4);
  box-shadow:
    0 0 0 1px rgba(188, 160, 106, 0.15),
    0 32px 80px rgba(0, 0, 0, 0.15),
    0 0 60px rgba(188, 160, 106, 0.05) inset;
}

:root.light .dmo-title {
  color: #111827;
}

:root.light .dmo-subtitle {
  color: #4b5563;
}

:root.light .dmo-close {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #6b7280;
}

:root.light .dmo-close:hover {
  background: rgba(188, 160, 106, 0.12);
  border-color: rgba(188, 160, 106, 0.35);
  color: #bca06a;
}

:root.light .dmo-label {
  color: #4b5563;
}

:root.light .dmo-input,
:root.light .dmo-select,
:root.light .dmo-textarea {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid #d1d5db;
  color: #111827;
}

:root.light .dmo-input::placeholder,
:root.light .dmo-textarea::placeholder {
  color: #9ca3af;
}

:root.light .dmo-input:focus,
:root.light .dmo-select:focus,
:root.light .dmo-textarea:focus {
  background: rgba(188, 160, 106, 0.05);
  border-color: #bca06a;
  box-shadow: 0 0 0 3px rgba(188, 160, 106, 0.15);
}

:root.light .dmo-select option {
  background: #ffffff;
  color: #111827;
}

:root.light .dmo-privacy {
  color: #4b5563;
}

:root.light .dmo-features {
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

:root.light .dmo-feature {
  color: #4b5563;
}

:root.light .dmo-success h3 {
  color: #111827;
}

:root.light .dmo-success p,
:root.light .dmo-error p {
  color: #4b5563;
}

:root.light .dmo-error h3 {
  color: #dc2626;
}

.dmo-input.dmo-input-error,
.dmo-select.dmo-input-error,
.dmo-textarea.dmo-input-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
  background: rgba(239, 68, 68, 0.04) !important;
}

.dmo-error-msg {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #f87171;
  letter-spacing: 0.03em;
  min-height: 1rem;
  animation: dmoErrIn 0.18s ease;
}

@keyframes dmoErrIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

:root.light .dmo-error-msg {
  color: #dc2626;
}

:root.light .dmo-input.dmo-input-error,
:root.light .dmo-select.dmo-input-error,
:root.light .dmo-textarea.dmo-input-error {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12) !important;
  background: rgba(220, 38, 38, 0.03) !important;
}
