/**
 * Hozina Technologies - Interactive Quote Modal Styles
 * Pixel-matched modern design: clean rounded card, soft blurred backdrop,
 * circular header icon badge, crisp form controls with left icons, trust badge and button styling.
 */

:root {
  --qm-primary: #0066f5;
  --qm-primary-hover: #0052cc;
  --qm-navy: #0b1d3a;
  --qm-text-main: #0f172a;
  --qm-text-muted: #556987;
  --qm-text-subtle: #64748b;
  --qm-border: #dce4ee;
  --qm-border-card: rgba(226, 232, 240, 0.85);
  --qm-bg-input: #f8fafc;
  --qm-bg-badge: #e0edff;
  --qm-success: #16a34a;
  --qm-radius-dialog: 20px;
  --qm-radius-input: 12px;
  --qm-radius-btn: 12px;
  --qm-shadow-dialog: 0 25px 60px -15px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(226, 232, 240, 0.8);
  --qm-transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Modal Root Wrapper */
.qm-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.qm-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Backdrop with Smooth Dark Blur */
.qm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1;
  cursor: pointer;
}

/* Dialog Container */
.qm-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 680px;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
}

.qm-dialog {
  position: relative;
  background: #ffffff;
  border-radius: var(--qm-radius-dialog);
  box-shadow: var(--qm-shadow-dialog);
  padding: 36px 38px 32px;
  overflow-y: auto;
  max-height: 92vh;
  transform: scale(0.95) translateY(12px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
  font-family: inherit;
}

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

/* Top Right Close Button */
.qm-close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--qm-text-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: var(--qm-transition);
  padding: 0;
  z-index: 3;
}

.qm-close-btn:hover {
  background: #f1f5f9;
  color: var(--qm-text-main);
  transform: scale(1.08);
}

/* Header Section */
.qm-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
  padding-right: 32px;
}

/* Circular Icon Badge */
.qm-icon-badge {
  width: 58px;
  height: 58px;
  min-width: 58px;
  border-radius: 50%;
  background: var(--qm-bg-badge);
  color: var(--qm-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.qm-header-content {
  flex: 1;
}

.qm-title {
  font-size: 1.52rem;
  font-weight: 800;
  color: var(--qm-navy);
  margin: 0 0 5px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.qm-subtitle {
  color: var(--qm-text-muted);
  font-size: 0.93rem;
  line-height: 1.45;
  margin: 0;
}

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

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

/* Form Field & Labels */
.qm-field {
  display: flex;
  flex-direction: column;
}

.qm-label {
  display: flex;
  align-items: center;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--qm-text-main);
  margin-bottom: 7px;
  line-height: 1.3;
}

.qm-req {
  color: #ef4444;
  font-weight: 700;
  margin-left: 3px;
}

.qm-opt {
  color: var(--qm-text-subtle);
  font-size: 12.5px;
  font-weight: 400;
  margin-left: 4px;
}

.qm-label-tip {
  color: var(--qm-success);
  font-size: 11.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  white-space: nowrap;
}

.qm-label-tip i {
  font-size: 12.5px;
}

/* Input Wrapper & Left Icons */
.qm-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.qm-input-icon {
  position: absolute;
  left: 15px;
  font-size: 16px;
  color: var(--qm-text-subtle);
  pointer-events: none;
  z-index: 2;
  transition: color 0.15s ease;
}

/* Modern Form Controls */
.qm-input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  font-size: 14px;
  font-family: inherit;
  color: var(--qm-text-main);
  background: var(--qm-bg-input);
  border: 1.5px solid var(--qm-border);
  border-radius: var(--qm-radius-input);
  outline: none;
  transition: var(--qm-transition);
  box-sizing: border-box;
}

.qm-input::placeholder {
  color: #94a3b8;
  font-size: 14px;
}

.qm-input:focus {
  background: #ffffff;
  border-color: var(--qm-primary);
  box-shadow: 0 0 0 3.5px rgba(0, 102, 245, 0.12);
}

.qm-input:focus + .qm-input-icon,
.qm-input-wrap:focus-within .qm-input-icon {
  color: var(--qm-primary);
}

/* Custom Select Chevron matching design */
.qm-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 16px) center;
  padding-right: 40px;
}

/* Textarea Layout */
.qm-textarea-wrap {
  align-items: flex-start;
}

.qm-textarea-wrap .qm-input-icon {
  top: 15px;
}

.qm-textarea {
  min-height: 110px;
  height: auto;
  padding-top: 14px;
  padding-bottom: 14px;
  resize: vertical;
  line-height: 1.5;
}

/* Alert Notification Box */
.qm-alert {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.4;
  margin-bottom: 0.25rem;
}

.qm-alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.qm-alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

/* Footer Section: Trust Note on Left, Actions on Right */
.qm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 6px;
  padding-top: 6px;
}

.qm-trust-note {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #475569;
  font-size: 12px;
  line-height: 1.4;
  max-width: 320px;
  text-align: left;
}

.qm-trust-note i {
  color: var(--qm-success);
  font-size: 19px;
  flex-shrink: 0;
}

.qm-footer-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Button Styling */
.qm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 14px;
  border-radius: var(--qm-radius-btn);
  border: none;
  cursor: pointer;
  transition: var(--qm-transition);
  text-decoration: none;
  line-height: 1.25;
  font-family: inherit;
  box-sizing: border-box;
}

.qm-btn-cancel {
  background: #edf2f7;
  color: #334155;
  font-weight: 650;
}

.qm-btn-cancel:hover {
  background: #e2e8f0;
  color: var(--qm-text-main);
}

.qm-btn-submit {
  background: var(--qm-primary);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 102, 245, 0.28);
}

.qm-btn-submit:hover:not(:disabled) {
  background: var(--qm-primary-hover);
  box-shadow: 0 6px 18px rgba(0, 102, 245, 0.38);
  transform: translateY(-1px);
}

.qm-btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

.qm-btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.qm-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: qmSpin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes qmSpin {
  to { transform: rotate(360deg); }
}

/* Success Confirmation View */
.qm-success {
  text-align: center;
  padding: 1rem 0.5rem 0.5rem;
  animation: qmFadeIn 0.35s ease;
}

@keyframes qmFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.qm-success-icon {
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  box-shadow: 0 10px 25px -5px rgba(22, 163, 74, 0.25);
}

.qm-success-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--qm-navy);
  margin: 0 0 0.5rem;
}

.qm-success-lead {
  font-size: 0.98rem;
  color: #475569;
  margin: 0 0 1.25rem;
}

.qm-success-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.qm-success-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px dashed #cbd5e1;
  font-size: 0.88rem;
}

.qm-meta-label {
  color: #64748b;
  margin-right: 0.3rem;
}

.qm-meta-val {
  color: var(--qm-navy);
  font-weight: 700;
}

.qm-success-text {
  color: #334155;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

.qm-success-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.qm-btn-whatsapp {
  background: #25d366;
  color: #ffffff;
  padding: 0.85rem 1.5rem;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.35);
  font-size: 0.95rem;
  font-weight: 700;
}

.qm-btn-whatsapp:hover {
  background: #1ebc59;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(37, 211, 102, 0.45);
}

.qm-btn-outline {
  background: #edf2f7;
  color: #334155;
  font-weight: 650;
}

.qm-btn-outline:hover {
  background: #e2e8f0;
  color: var(--qm-text-main);
}

/* Responsive Breakpoints */
@media (max-width: 680px) {
  .qm-dialog {
    padding: 26px 20px 22px;
    border-radius: 16px;
  }

  .qm-header {
    gap: 14px;
    padding-right: 24px;
    margin-bottom: 20px;
  }

  .qm-icon-badge {
    width: 48px;
    height: 48px;
    min-width: 48px;
    font-size: 22px;
  }

  .qm-title {
    font-size: 1.25rem;
  }

  .qm-subtitle {
    font-size: 0.88rem;
  }

  .qm-label {
    white-space: normal;
    flex-wrap: wrap;
  }

  .qm-grid-2 {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .qm-footer {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 14px;
  }

  .qm-footer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .qm-trust-note {
    max-width: 100%;
    justify-content: center;
    text-align: center;
  }
}
