/*
 * Print.az — Shared "Qiymət təklifi sorğusu" (general quote request) modal.
 *
 * Site-wide, self-contained styles (no dependency on home.css). Scoped under
 * .quote-modal / .quote-form so it never collides with the separate
 * custom-project modal (.custom-project-modal) or page styles.
 *
 * Visual language intentionally mirrors the custom-project modal and Homepage v2
 * (typography, controls, error styling, focus rings, buttons, spacing) so it
 * feels like part of the same system.
 */

.quote-modal {
  position: fixed;
  inset: 0;
  z-index: 3200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  /* Neutral, self-contained font stack matching the site body. */
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
.quote-modal[hidden] { display: none; }

.quote-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 16, 0.62);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.quote-modal.is-open .quote-modal__backdrop { opacity: 1; }

.quote-modal__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  /* Scrolling lives on the inner .quote-modal__scroll; the dialog itself clips
     with overflow:hidden so the border-radius stays even on all four corners
     (a scrollbar on the dialog used to square off the right corners). */
  overflow: hidden;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 40px 90px rgba(10, 12, 16, 0.4);
  opacity: 0;
  transform: scale(0.96) translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.quote-modal.is-open .quote-modal__dialog { opacity: 1; transform: none; }

.quote-modal__scroll {
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  padding: 30px 28px 28px;
  -webkit-overflow-scrolling: touch;
}

.quote-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid #e6e8ec;
  background: #fff;
  color: #17191d;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.quote-modal__close:hover { border-color: #d71920; color: #d71920; }
.quote-modal__close svg { width: 18px; height: 18px; }
.quote-modal__close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.32);
}

.quote-modal h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #17191d;
  line-height: 1.2;
}
.quote-modal__intro {
  margin: 0 0 18px;
  color: #4f5865;
  font-size: 0.96rem;
  line-height: 1.5;
}

/* --- Form (mirrors the /elaqe/ + custom-project field conventions) -------- */
.quote-form .form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.quote-form label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #17191d;
}
.quote-form .req { color: #d71920; }
.quote-form input,
.quote-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  font: inherit;
  color: #17191d;
  background: #fff;
}
.quote-form textarea { min-height: 96px; resize: vertical; }
.quote-form input:focus,
.quote-form textarea:focus,
.quote-form .file-drop:focus-within {
  outline: none;
  border-color: #d71920;
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.18);
}
.quote-form input[aria-invalid="true"],
.quote-form textarea[aria-invalid="true"] { border-color: #d71920; }

/* Error identification does not rely on colour alone (icon + weight + text). */
.quote-field-error {
  font-size: 0.82rem;
  font-weight: 700;
  color: #a80f16;
}
.quote-field-error::before { content: "⚠ "; }
.quote-field-error[hidden] { display: none; }

.quote-form .file-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px;
  border: 1px dashed #c4cbd4;
  border-radius: 12px;
  cursor: pointer;
  background: #fafbfc;
}
.quote-form .file-drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.quote-form .file-drop strong { font-size: 0.95rem; color: #17191d; }
.quote-form .file-drop span { font-size: 0.82rem; color: #6b7280; }
.quote-form__hint {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.4;
}

.quote-form .file-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.quote-form .file-list[hidden] { display: none; }
.quote-form .file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: #f3f4f6;
  border-radius: 10px;
  font-size: 0.86rem;
}
.quote-form .file-row span { overflow-wrap: anywhere; }
.quote-form .file-remove {
  border: 0;
  background: transparent;
  color: #a80f16;
  font-weight: 800;
  cursor: pointer;
  font-size: 0.82rem;
  flex: 0 0 auto;
}
.quote-form .file-remove:hover { text-decoration: underline; }

.quote-form .form-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  /* Buttons don't inherit font-family by default; inherit so "ə" renders. */
  font-family: inherit;
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color: #fff;
  background: #d71920;
  box-shadow: 0 14px 30px rgba(215, 25, 32, 0.24);
  transition: transform 0.12s ease;
}
.quote-form .form-submit:hover { transform: translateY(-1px); }
.quote-form .form-submit[disabled] { opacity: 0.6; cursor: progress; transform: none; }
.quote-form .form-submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(215, 25, 32, 0.34);
}

.quote-form .form-status {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  display: none;
}
.quote-form .form-status[data-state] { display: block; }
.quote-form .form-status[data-state="loading"] { background: #eef2f7; color: #33415c; }
.quote-form .form-status[data-state="pending"] { background: #fff7e6; color: #7a5200; border: 1px solid #ffe1a8; }
.quote-form .form-status[data-state="error"] { background: #fdeaea; color: #a80f16; border: 1px solid #f5c2c2; }
.quote-form .form-status a { text-decoration: underline; font-weight: 800; }

.quote-modal__success { text-align: center; padding: 20px 8px 8px; }
.quote-modal__success[hidden] { display: none; }
.quote-modal__success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: #e9f7ef;
  color: #1b7a43;
}
.quote-modal__success-icon svg { width: 30px; height: 30px; }
.quote-modal__success h2 { margin: 0 0 8px; }
.quote-modal__success p {
  margin: 0 auto 20px;
  max-width: 40ch;
  color: #4f5865;
  line-height: 1.55;
}
.quote-modal__success .form-submit {
  width: auto;
  min-height: 44px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  background: #d71920;
}

body.quote-modal-open { overflow: hidden; }

@media (max-width: 480px) {
  .quote-modal { padding: 12px; }
  .quote-modal__dialog { max-height: calc(100vh - 24px); }
  .quote-modal__scroll { padding: 26px 18px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .quote-modal__backdrop,
  .quote-modal__dialog,
  .quote-form .form-submit { transition: none !important; }
}
