/* پنجره مشترک قوانین در صفحه اصلی، ثبت‌نام و فرم‌های آگهی */
.gk-rules-overlay,
.gk-rules-overlay * {
  box-sizing: border-box;
}

.gk-rules-overlay[hidden] {
  display: none !important;
}

.gk-rules-overlay {
  position: fixed;
  z-index: 40000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
  direction: rtl;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: opacity 190ms ease, visibility 190ms ease;
}

.gk-rules-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.gk-rules-window {
  position: relative;
  isolation: isolate;
  width: min(720px, 100%);
  max-height: calc(100vh - 32px);
  overflow: hidden auto;
  color: #fffaf0;
  border: 1px solid rgba(242, 199, 92, 0.7);
  border-radius: 23px;
  background:
    radial-gradient(circle at 94% 4%, rgba(242, 199, 92, 0.14), transparent 37%),
    radial-gradient(circle at 4% 96%, rgba(160, 116, 28, 0.1), transparent 43%),
    linear-gradient(145deg, rgba(17, 21, 22, 0.99), rgba(5, 7, 8, 0.995));
  -webkit-backdrop-filter: blur(24px) saturate(120%);
  backdrop-filter: blur(24px) saturate(120%);
  box-shadow:
    0 0 24px rgba(242, 199, 92, 0.12),
    0 30px 85px rgba(0, 0, 0, 0.62),
    inset 0 1px 0 rgba(255, 239, 181, 0.12);
  font-family: Tahoma, Arial, sans-serif;
  transform: translateY(14px) scale(0.985);
  transition: transform 190ms ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(242, 199, 92, 0.62) transparent;
}

.gk-rules-overlay.is-open .gk-rules-window {
  transform: translateY(0) scale(1);
}

.gk-rules-window::-webkit-scrollbar {
  width: 5px;
}

.gk-rules-window::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(242, 199, 92, 0.62);
}

.gk-rules-accent {
  position: sticky;
  z-index: 3;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, #806019, #ffe189 50%, #806019);
  box-shadow: 0 0 18px rgba(242, 199, 92, 0.34);
}

.gk-rules-close {
  position: absolute;
  z-index: 4;
  top: 15px;
  left: 15px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #f5d56f;
  border: 1px solid rgba(242, 199, 92, 0.38);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.3);
  font: 400 23px/1 Tahoma, Arial, sans-serif;
  cursor: pointer;
  transition: transform 170ms ease, background-color 170ms ease;
}

.gk-rules-close:hover {
  color: #fff2b0;
  border-color: rgba(255, 225, 137, 0.85);
  background: rgba(242, 199, 92, 0.13);
  box-shadow: 0 0 12px rgba(242, 199, 92, 0.24);
  transform: rotate(90deg);
}

.gk-rules-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 24px 15px 68px;
  text-align: right;
}

.gk-rules-logo-frame {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #191409;
  border: 1px solid rgba(242, 199, 92, 0.62);
  border-radius: 18px;
  background: linear-gradient(145deg, #ffe69a, #d6a72f);
  box-shadow: 0 10px 25px rgba(196, 145, 30, 0.2);
  font-size: 25px;
  font-weight: 900;
}

.gk-rules-logo-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.gk-rules-header > div {
  min-width: 0;
}

.gk-rules-header small,
.gk-rules-header h2,
.gk-rules-header p,
.gk-rules-footer p {
  margin: 0;
}

.gk-rules-header small {
  color: #ddbd61;
  font-size: 10px;
  font-weight: 800;
}

.gk-rules-header h2 {
  margin-top: 3px;
  color: #f4cf67;
  font-size: 20px;
  font-weight: 900;
}

.gk-rules-header p {
  margin-top: 4px;
  color: rgba(255, 250, 235, 0.64);
  font-size: 11px;
  line-height: 1.8;
}

.gk-rules-list {
  display: grid;
  gap: 8px;
  padding: 0 24px 17px;
}

.gk-rules-item {
  overflow: hidden;
  border: 1px solid rgba(242, 199, 92, 0.17);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.24);
  transition: border-color 180ms ease, background-color 180ms ease;
}

.gk-rules-item:hover,
.gk-rules-item.is-open {
  border-color: rgba(242, 199, 92, 0.5);
  background: rgba(242, 199, 92, 0.075);
}

.gk-rules-question {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 31px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: inherit;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  text-align: right;
  cursor: pointer;
}

.gk-rules-question:focus-visible,
.gk-rules-understood:focus-visible,
.gk-rules-close:focus-visible,
.gk-ad-rules-link:focus-visible,
.gk-account-rules-link:focus-visible {
  outline: 3px solid rgba(255, 225, 137, 0.68);
  outline-offset: 2px;
}

.gk-rules-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #1b160a;
  border: 1px solid rgba(255, 231, 158, 0.62);
  border-radius: 11px;
  background: linear-gradient(145deg, #ffe89d, #d2a22b);
  font-size: 12px;
  font-weight: 900;
}

.gk-rules-question-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.gk-rules-question-copy strong {
  color: #f2cb61;
  font-size: 12px;
  font-weight: 900;
}

.gk-rules-question-copy small {
  overflow: hidden;
  color: rgba(255, 250, 235, 0.62);
  font-size: 10px;
  line-height: 1.7;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gk-rules-arrow {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  color: #f2cb61;
  border-radius: 9px;
  background: rgba(242, 199, 92, 0.08);
  font-size: 17px;
  transition: transform 180ms ease, background-color 180ms ease;
}

.gk-rules-item.is-open .gk-rules-arrow {
  color: #fff0aa;
  background: rgba(242, 199, 92, 0.17);
  transform: rotate(45deg);
}

.gk-rules-answer[hidden] {
  display: none !important;
}

.gk-rules-answer {
  margin: 0 58px 12px 42px;
  padding: 11px 13px;
  color: rgba(255, 250, 235, 0.76);
  border-top: 1px solid rgba(242, 199, 92, 0.17);
  border-radius: 0 0 10px 10px;
  background: rgba(0, 0, 0, 0.27);
  animation: gk-rules-answer-in 180ms ease both;
}

.gk-rules-answer p {
  margin: 0 0 7px;
  color: #f1d374;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.9;
}

.gk-rules-answer ul {
  margin: 0;
  padding: 0 18px 0 0;
}

.gk-rules-answer li {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.9;
}

.gk-rules-answer li::marker {
  color: #f2c75c;
}

.gk-rules-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 24px 19px;
  border-top: 1px solid rgba(242, 199, 92, 0.16);
  background: rgba(0, 0, 0, 0.25);
}

.gk-rules-footer p {
  color: rgba(255, 250, 235, 0.67);
  font-size: 10px;
  line-height: 1.8;
}

.gk-rules-footer p span {
  color: #f3cf66;
  font-weight: 900;
}

.gk-rules-understood {
  flex: 0 0 auto;
  min-width: 132px;
  min-height: 41px;
  padding: 8px 17px;
  color: #1b1609;
  border: 1px solid #ffe8a0;
  border-radius: 11px;
  background: linear-gradient(135deg, #fff0b0, #f2c75c 58%, #c99622);
  box-shadow:
    0 0 16px rgba(242, 199, 92, 0.26),
    0 9px 23px rgba(0, 0, 0, 0.3);
  font: 900 11px/1.6 Tahoma, Arial, sans-serif;
  cursor: pointer;
  transition: filter 170ms ease, transform 170ms ease;
}

.gk-rules-understood:hover {
  filter: brightness(1.08);
  box-shadow:
    0 0 22px rgba(255, 225, 137, 0.42),
    0 11px 25px rgba(0, 0, 0, 0.34);
  transform: translateY(-1px);
}

/* پیام کوتاه قوانین در انتهای همه فرم‌های آگهی */
.gk-ad-rules-notice {
  grid-column: 1 / -1;
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 5px 0 10px;
  padding: 9px 11px;
  color: rgba(255, 249, 229, 0.84);
  border: 1px solid rgba(242, 199, 92, 0.3);
  border-radius: 11px;
  background:
    radial-gradient(circle at 100% 0, rgba(242, 199, 92, 0.11), transparent 40%),
    linear-gradient(145deg, rgba(21, 24, 24, 0.97), rgba(7, 9, 10, 0.98));
  font: 750 10px/1.8 Tahoma, Arial, sans-serif;
  text-align: center;
}

.gk-ad-rules-notice > span {
  color: #f2c75c;
  font-weight: 900;
}

.gk-ad-rules-notice p {
  margin: 0;
}

.gk-ad-rules-link,
.gk-account-rules-link {
  padding: 2px 3px;
  color: #f2c75c;
  border: 0;
  border-bottom: 1px dashed currentColor;
  border-radius: 0;
  background: transparent;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.gk-ad-rules-link:hover {
  color: #fff0aa;
}

.gk-account-rules-link {
  color: #f3d373;
}

.gk-account-rules-link:hover {
  color: #fff1ad;
}

@keyframes gk-rules-answer-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

@media (max-width: 620px) {
  .gk-rules-overlay {
    padding: 9px;
  }

  .gk-rules-window {
    max-height: calc(100vh - 18px);
    border-radius: 18px;
  }

  .gk-rules-close {
    top: 11px;
    left: 11px;
    width: 32px;
    height: 32px;
  }

  .gk-rules-header {
    align-items: flex-start;
    padding: 17px 15px 13px 50px;
  }

  .gk-rules-logo-frame {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .gk-rules-header h2 {
    font-size: 16px;
  }

  .gk-rules-list {
    padding: 0 13px 13px;
  }

  .gk-rules-question {
    grid-template-columns: 32px minmax(0, 1fr) 28px;
    min-height: 61px;
    gap: 8px;
    padding: 9px;
  }

  .gk-rules-number {
    width: 31px;
    height: 31px;
  }

  .gk-rules-question-copy small {
    white-space: normal;
  }

  .gk-rules-answer {
    margin: 0 48px 10px 10px;
    padding: 9px 10px;
  }

  .gk-rules-footer {
    align-items: stretch;
    flex-direction: column;
    padding: 12px 14px 15px;
  }

  .gk-rules-understood {
    width: 100%;
  }

  .gk-ad-rules-notice {
    align-items: stretch;
    flex-direction: column;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gk-rules-overlay,
  .gk-rules-window,
  .gk-rules-arrow,
  .gk-rules-close,
  .gk-rules-understood {
    transition: none;
  }

  .gk-rules-answer {
    animation: none;
  }
}
