/* WaferPilot Technical Demo Booking Modal
   Engineered for Semiconductor Diagnostics & Verification */

.demo-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.demo-modal-card {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.25),
              0 0 0 1px rgba(15, 23, 42, 0.05);
  padding: 34px 36px 30px;
  transform: scale(0.96) translateY(8px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  color: #1e293b;
}

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

.demo-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.demo-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.demo-modal-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #0071e3;
  margin-bottom: 8px;
}

.demo-modal-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.4px;
  line-height: 1.3;
  color: #0f172a;
}

.demo-modal-lead {
  margin: 0 0 24px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #64748b;
}

.demo-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.demo-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.demo-form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 3px;
}

.demo-form-req {
  color: #e11d48;
}

.demo-form-input,
.demo-form-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  font-size: 14px;
  line-height: 1.5;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  font-family: inherit;
}

.demo-form-input:focus,
.demo-form-textarea:focus {
  background: #ffffff;
  border-color: #0071e3;
  box-shadow: 0 0 0 3.5px rgba(0, 113, 227, 0.15);
}

.demo-form-input.has-error {
  border-color: #e11d48;
  background: #fff1f2;
}

.demo-form-hint {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 2px;
}

.demo-form-error-msg {
  font-size: 11.5px;
  color: #e11d48;
  display: none;
}

.demo-form-error-msg.is-visible {
  display: block;
}

.demo-form-textarea {
  resize: vertical;
  min-height: 72px;
}

.demo-form-footer {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.demo-submit-btn {
  width: 100%;
  padding: 13px 20px;
  font-size: 14.5px;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(180deg, #0077ed, #0062cc);
  border: 1px solid #005bb5;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 113, 227, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.18s ease;
}

.demo-submit-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #0082fb, #006bd6);
  box-shadow: 0 6px 20px rgba(0, 113, 227, 0.45);
  transform: translateY(-1px);
}

.demo-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.demo-security-note {
  font-size: 11px;
  line-height: 1.5;
  color: #64748b;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.demo-security-note svg {
  flex-shrink: 0;
  color: #10b981;
}

/* Success State View */
.demo-success-view {
  display: none;
  text-align: center;
  padding: 24px 8px 12px;
}

.demo-success-view.is-visible {
  display: block;
  animation: demoFadeIn 0.3s ease;
}

.demo-success-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #ecfdf5;
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 8px #f0fdf4;
}

.demo-success-title {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 600;
  color: #0f172a;
}

.demo-success-body {
  font-size: 14px;
  line-height: 1.6;
  color: #475569;
  margin: 0 0 26px;
}

.demo-success-body strong {
  color: #0f172a;
  word-break: break-all;
}

.demo-success-done-btn {
  padding: 11px 32px;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  background: #0f172a;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.demo-success-done-btn:hover {
  background: #334155;
}

.demo-success-email-action {
  margin: 0 0 24px;
  padding: 13px 16px;
  background: #f8fafc;
  border-radius: 11px;
  border: 1px solid #e2e8f0;
  font-size: 13px;
  line-height: 1.55;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.demo-success-email-action svg {
  flex-shrink: 0;
  color: #0071e3;
}

.demo-success-email-action a {
  color: #0071e3;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.demo-success-email-action a:hover {
  color: #005bb5;
}

@keyframes demoFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
  .demo-modal-card {
    padding: 26px 20px 22px;
    border-radius: 16px;
  }
  .demo-modal-title {
    font-size: 19px;
  }
  .demo-modal-lead {
    font-size: 12.5px;
    margin-bottom: 18px;
  }
}
