/* NAQSH — Request a Sample */
.naqsh-sample {
  position: fixed;
  inset: 0;
  width: min(880px, calc(100% - 48px));
  max-width: none;
  max-height: 90vh;
  max-height: 90dvh;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #f7f4ef;
  color: #34251d;
  box-shadow: none;
  color-scheme: light;
}

.naqsh-sample:not([open]),
.naqsh-sample [hidden] {
  display: none !important;
}

.naqsh-sample,
.naqsh-sample *,
.naqsh-sample *::before,
.naqsh-sample *::after {
  box-sizing: border-box;
}

.naqsh-sample::backdrop {
  background: rgba(23, 21, 19, .62);
}

/* Fixed header with internally scrolling form */
.naqsh-sample__shell {
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  max-height: 90dvh;
}

.naqsh-sample__header {
  position: relative;
  flex-shrink: 0;
  padding: 36px 48px 24px;
  background: #f7f4ef;
  text-align: center;
}

.naqsh-sample .naqsh-sample__title {
  margin: 0 0 12px;
  padding-inline: 20px;
  color: #34251d;
  font-family: "Raleway", sans-serif;
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -.025em;
  text-transform: none;
  overflow-wrap: break-word;
}

.naqsh-sample__description {
  max-width: 64ch;
  margin: 0 auto;
  color: #34251d;
  font-family: "Source Sans 3", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

.naqsh-sample .naqsh-sample__close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #34251d;
  cursor: pointer;
  box-shadow: none;
}

.naqsh-sample__close svg {
  display: block;
  flex-shrink: 0;
}

/* Form scroll area */
.naqsh-sample__body {
  min-height: 0;
  padding: 8px 48px 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scroll-padding-block: 16px;
}

.naqsh-sample .naqsh-sample__form {
  margin: 0;
}

.naqsh-sample__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 20px 24px;
}

.naqsh-sample__field {
  min-width: 0;
}

.naqsh-sample__field--full {
  grid-column: 1 / -1;
}

.naqsh-sample__field label {
  display: block;
  margin: 0 0 7px;
  color: #34251d;
  font-family: "Source Sans 3", sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
}

/* Controls */
.naqsh-sample .naqsh-sample__field input,
.naqsh-sample .naqsh-sample__field select,
.naqsh-sample .naqsh-sample__field textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #d8c0aa;
  border-radius: 0;
  background: #ffffff;
  color: #34251d;
  font-family: "Source Sans 3", sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  box-shadow: none;
  scroll-margin-block: 16px;
}

.naqsh-sample .naqsh-sample__field select {
  padding-right: 32px;
}

.naqsh-sample .naqsh-sample__field option {
  background: #ffffff;
  color: #34251d;
}

.naqsh-sample .naqsh-sample__field textarea {
  min-height: 88px;
  resize: vertical;
}

.naqsh-sample .naqsh-sample__field input:focus,
.naqsh-sample .naqsh-sample__field select:focus,
.naqsh-sample .naqsh-sample__field textarea:focus {
  border-color: #34251d;
  outline: 2px solid #34251d;
  outline-offset: 2px;
  background: #ffffff;
  color: #34251d;
  box-shadow: none;
}

.naqsh-sample .naqsh-sample__field [aria-invalid="true"] {
  border-color: #34251d;
  border-width: 2px;
}

/* Helpers and inline errors */
.naqsh-sample__helper {
  margin: 6px 0 0;
  color: #34251d;
  font-family: "Source Sans 3", sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

.naqsh-sample__error {
  display: block;
  color: #34251d;
  font-family: "Source Sans 3", sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.naqsh-sample__error:not(:empty) {
  margin-top: 6px;
}

.naqsh-sample__confirmation-note {
  margin: 10px 0 18px;
}

/* Submit */
.naqsh-sample .naqsh-sample__submit {
  display: block;
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 14px 20px;
  border: 1px solid #34251d;
  border-radius: 0;
  background: #34251d;
  color: #f7f4ef;
  font-family: "Source Sans 3", sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
  text-transform: none;
  white-space: normal;
  cursor: pointer;
  box-shadow: none;
  transition:
    background-color 150ms ease,
    border-color 150ms ease;
}

.naqsh-sample .naqsh-sample__submit:disabled {
  opacity: .65;
  cursor: not-allowed;
}

.naqsh-sample .naqsh-sample__submit:focus-visible,
.naqsh-sample .naqsh-sample__close:focus-visible {
  outline: 2px solid #34251d;
  outline-offset: 3px;
}

.naqsh-sample__title:focus-visible,
.naqsh-sample__success-message:focus-visible {
  outline: 2px solid #34251d;
  outline-offset: 4px;
}

@media (hover: hover) and (pointer: fine) {
  .naqsh-sample .naqsh-sample__submit:not(:disabled):hover {
    border-color: #171513;
    background: #171513;
    color: #f7f4ef;
  }

  .naqsh-sample .naqsh-sample__close:hover {
    background: #d8c0aa;
    color: #34251d;
  }
}

.naqsh-sample .naqsh-sample__submit:not(:disabled):active {
  border-color: #171513;
  background: #171513;
}

/* Submission messages */
.naqsh-sample__status {
  margin: 0;
  color: #34251d;
  font-family: "Source Sans 3", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

.naqsh-sample__status:not(:empty) {
  margin-top: 16px;
}

.naqsh-sample__success {
  padding-block: 24px 40px;
  text-align: center;
}

.naqsh-sample__success-message {
  max-width: 52ch;
  margin: 0 auto;
  color: #34251d;
  font-family: "Source Sans 3", sans-serif;
  font-size: 20px;
  line-height: 1.6;
}

/* Popup entrance — native dialog open state */
@media (prefers-reduced-motion: no-preference) {
  .naqsh-sample[open],
  .naqsh-sample[open]::backdrop {
    animation: naqsh-sample-fade 200ms ease-out both;
  }

  .naqsh-sample__success:not([hidden]) {
    animation: naqsh-sample-fade 150ms ease-out both;
  }
}

@keyframes naqsh-sample-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Mobile full-screen dialog */
@media (max-width: 767px) {
  .naqsh-sample {
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-height: 100%;
    max-height: 100dvh;
    margin: 0;
  }

  .naqsh-sample__shell {
    height: 100%;
    max-height: 100%;
  }

  .naqsh-sample__header {
    padding:
      calc(32px + env(safe-area-inset-top, 0px))
      24px
      20px;
  }

  .naqsh-sample .naqsh-sample__close {
    top: calc(4px + env(safe-area-inset-top, 0px));
    right: max(4px, env(safe-area-inset-right, 0px));
  }

  .naqsh-sample .naqsh-sample__title {
    padding-inline: 16px;
    font-size: clamp(28px, 7.5vw, 36px);
  }

  .naqsh-sample__description {
    font-size: 16px;
  }

  .naqsh-sample__body {
    flex: 1;
    padding:
      4px
      max(24px, env(safe-area-inset-right, 0px))
      calc(24px + env(safe-area-inset-bottom, 0px))
      max(24px, env(safe-area-inset-left, 0px));
  }

  .naqsh-sample__fields {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .naqsh-sample__field--full {
    grid-column: auto;
  }

  .naqsh-sample .naqsh-sample__submit {
    font-size: 16px;
  }

  .naqsh-sample__success-message {
    font-size: 18px;
  }
}

/* Short desktop screens */
@media (min-width: 768px) and (max-height: 600px) {
  .naqsh-sample__header {
    padding-top: 24px;
    padding-bottom: 16px;
  }

  .naqsh-sample .naqsh-sample__title {
    font-size: 32px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .naqsh-sample,
  .naqsh-sample::backdrop,
  .naqsh-sample__success,
  .naqsh-sample .naqsh-sample__submit {
    animation: none;
    transition: none;
  }

  .naqsh-sample__body {
    scroll-behavior: auto;
  }
}