/* ============================================================
   quick-modal.css — مدال ثبت درخواست سریع
   ============================================================ */

.qr-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  direction: rtl;
  font-family: var(--font, 'Dana', system-ui, sans-serif);
}
.qr-overlay[hidden] { display: none; }

.qr-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 40, .55);
  backdrop-filter: blur(3px);
  animation: qrFade .18s ease-out;
}

.qr-dialog {
  position: relative;
  width: 100%;
  max-width: 430px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius-xl, 20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
  animation: qrPop .22s cubic-bezier(.2, .8, .3, 1);
  outline: none;
}

.qr-close {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--gray-100, #f0f2f8);
  color: var(--gray-500, #5a6282);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.qr-close:hover { background: var(--gray-200, #e2e6f0); }
.qr-close svg { width: 16px; height: 16px; fill: currentColor; }

.qr-body { padding: 26px 24px 22px; }

.qr-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--gray-900, #1a1f36);
  margin: 0 0 6px;
  line-height: 1.5;
}
.qr-sub {
  font-size: 13.5px;
  color: var(--gray-500, #5a6282);
  line-height: 1.9;
  margin: 0 0 18px;
}
.qr-sub a { color: var(--blue, #2563eb); text-decoration: none; font-weight: 700; }

.qr-field { margin-bottom: 14px; }
.qr-field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-700, #2d3152);
  margin-bottom: 6px;
}
.qr-field label span[aria-hidden] { color: var(--red, #dc2626); }
.qr-opt { font-weight: 400; color: var(--gray-400, #8b93b0); }

.qr-field input,
.qr-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-200, #e2e6f0);
  border-radius: var(--radius, 8px);
  background: var(--gray-50, #f8f9fc);
  font-family: inherit;
  font-size: 15px;            /* زیر ۱۶ پیکسل باعث زوم خودکار در iOS می شود */
  color: var(--gray-900, #1a1f36);
  transition: border-color .15s, background .15s;
  resize: vertical;
}
.qr-field input::placeholder,
.qr-field textarea::placeholder { color: var(--gray-400, #8b93b0); font-size: 13.5px; }
.qr-field input:focus,
.qr-field textarea:focus {
  outline: none;
  border-color: var(--blue, #2563eb);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.qr-field.has-error input,
.qr-field.has-error textarea { border-color: var(--red, #dc2626); background: #fff; }

.qr-err {
  display: none;
  font-size: 12px;
  color: var(--red, #dc2626);
  margin-top: 5px;
}
.qr-field.has-error .qr-err { display: block; }

/* تله ربات */
.qr-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.qr-alert {
  background: var(--red-light, #fef2f2);
  color: #b91c1c;
  border-radius: var(--radius, 8px);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 12px;
}
.qr-alert[hidden] { display: none; }

.qr-submit {
  width: 100%;
  padding: 13px 20px;
  border: none;
  border-radius: var(--radius, 8px);
  background: var(--blue, #2563eb);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background .15s, transform .1s;
}
.qr-submit:hover { background: var(--blue-dark, #1d4ed8); }
.qr-submit:active { transform: scale(.99); }
.qr-submit:disabled { opacity: .7; cursor: default; }
.qr-ok { background: var(--green, #16a34a); margin-top: 18px; }
.qr-ok:hover { background: #15803d; }

.qr-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: qrSpin .7s linear infinite;
}
.qr-submit.is-loading .qr-spinner { display: inline-block; }

.qr-note {
  font-size: 11.5px;
  color: var(--gray-400, #8b93b0);
  text-align: center;
  margin: 10px 0 0;
}

.qr-direct {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--gray-200, #e2e6f0);
  font-size: 13px;
  color: var(--gray-500, #5a6282);
  text-align: center;
}
.qr-direct-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: center;
  margin-top: 8px;
}
.qr-direct-links a {
  color: var(--blue, #2563eb);
  font-weight: 800;
  text-decoration: none;
  font-size: 14px;
}
.qr-direct-links a.qr-wa { color: #128c4a; }

/* پیام موفقیت */
.qr-success { text-align: center; padding-top: 34px; }
.qr-check {
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--green-light, #f0fdf4);
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-check svg { width: 30px; height: 30px; fill: var(--green, #16a34a); }

@keyframes qrFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes qrPop  { from { opacity: 0; transform: translateY(14px) scale(.97) } to { opacity: 1; transform: none } }
@keyframes qrSpin { to { transform: rotate(360deg) } }

/* موبایل — به شکل bottom sheet */
@media (max-width: 520px) {
  .qr-overlay { padding: 0; align-items: flex-end; }
  .qr-dialog {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    animation: qrSlide .24s cubic-bezier(.2, .8, .3, 1);
  }
  .qr-body { padding: 24px 18px 20px; }
  .qr-title { font-size: 17.5px; }
}
@keyframes qrSlide { from { transform: translateY(100%) } to { transform: none } }

@media (prefers-reduced-motion: reduce) {
  .qr-dialog, .qr-backdrop { animation: none; }
}
