/* ========================================
   حساب کاربران گرا.کالا
======================================== */

.gk-account-modal,
.gk-account-modal * {
  box-sizing: border-box;
}

.gk-account-modal[hidden] {
  display: none !important;
}

.gk-account-modal {
  position: fixed;
  z-index: 30000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 17px;
  direction: rtl;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: rgba(49, 43, 51, 0.56);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: opacity 220ms ease, visibility 220ms ease;
}

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

.gk-account-window {
  position: relative;
  isolation: isolate;
  width: min(900px, 100%);
  max-height: calc(100vh - 34px);
  overflow: hidden auto;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 24px;
  color: #f8f3f5;
  background:
    radial-gradient(circle at 92% 2%, rgba(135, 29, 68, 0.44), transparent 34%),
    radial-gradient(circle at 4% 96%, rgba(24, 57, 101, 0.5), transparent 40%),
    linear-gradient(125deg, rgba(111, 100, 110, 0.8), rgba(39, 49, 68, 0.8));
  -webkit-backdrop-filter: blur(28px) saturate(125%);
  backdrop-filter: blur(28px) saturate(125%);
  box-shadow:
    0 28px 70px rgba(24, 23, 31, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
  transform: translateY(16px) scale(0.98);
  transition: transform 240ms ease;
}

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

.gk-account-window::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 1px;
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), transparent 25%),
    linear-gradient(320deg, rgba(173, 163, 173, 0.12), transparent 42%);
  pointer-events: none;
}

.gk-account-accent {
  position: relative;
  z-index: 1;
  height: 4px;
  background: linear-gradient(90deg, #203f6f, #72717b 50%, #8e244c);
  box-shadow: 0 0 16px rgba(121, 34, 70, 0.24);
}

.gk-account-inner {
  position: relative;
  z-index: 1;
  padding: 20px 26px 18px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.055),
    rgba(255, 255, 255, 0.015)
  );
}

.gk-account-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.gk-account-brand {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
}

.gk-account-logo-frame {
  display: block;
  flex: 0 0 auto;
  width: 84px;
  height: 56px;
  padding: 3px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 14px;
  background: rgba(77, 73, 80, 0.42);
  box-shadow:
    0 9px 20px rgba(27, 25, 34, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.gk-account-logo {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 11px;
  object-fit: cover;
}

.gk-account-brand-name,
.gk-account-title,
.gk-account-subtitle {
  margin: 0;
}

.gk-account-brand-name {
  margin-bottom: 4px;
  color: #f0d7df;
  font-size: 17px;
  font-weight: 700;
  text-shadow: 0 0 14px rgba(126, 32, 70, 0.18);
}

.gk-account-title {
  margin-bottom: 5px;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.gk-account-subtitle {
  color: rgba(246, 240, 243, 0.74);
  font-size: 13px;
  line-height: 1.8;
}

.gk-account-close {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 11px;
  color: rgba(255, 255, 255, 0.86);
  font: inherit;
  font-size: 25px;
  line-height: 1;
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease;
}

.gk-account-close:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: rotate(5deg) scale(1.04);
}

.gk-account-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: min(360px, 100%);
  margin: 14px auto 16px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 13px;
  background: rgba(205, 202, 207, 0.13);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 8px 22px rgba(0, 0, 0, 0.12);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.gk-account-tab {
  min-height: 42px;
  padding: 8px 16px;
  border: 0;
  border-radius: 10px;
  color: rgba(249, 244, 246, 0.68);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  background: transparent;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.gk-account-tab[aria-selected="true"] {
  color: #fff7f9;
  background: linear-gradient(
    135deg,
    rgba(139, 32, 72, 0.9),
    rgba(28, 61, 105, 0.9)
  );
  box-shadow:
    0 7px 18px rgba(4, 7, 16, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.gk-account-panel[hidden],
.gk-account-tabs[hidden] {
  display: none !important;
}

.gk-account-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}

#gkAccountLoginForm .gk-account-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gk-account-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.gk-account-field-label {
  color: rgba(249, 244, 246, 0.82);
  font-size: 12px;
  font-weight: 700;
}

.gk-account-input-shell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 11px;
  color: #e4ced6;
  background: rgba(213, 210, 214, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: border-color 180ms ease, background-color 180ms ease;
}

.gk-account-input-shell:focus-within {
  border-color: rgba(231, 202, 212, 0.72);
  background: rgba(225, 221, 226, 0.16);
  box-shadow:
    0 0 0 3px rgba(125, 34, 70, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.gk-account-field-icon {
  display: grid;
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  place-items: center;
}

.gk-account-field-icon svg {
  display: block;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gk-account-input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  color: #fff;
  font: inherit;
  font-size: 13px;
  background: transparent;
}

.gk-account-input::placeholder {
  color: rgba(249, 244, 246, 0.4);
}

.gk-account-phone-input {
  direction: ltr;
  text-align: right;
}

.gk-account-bottom-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 300px);
  align-items: center;
  gap: 18px;
  margin-top: 15px;
}

.gk-account-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(246, 240, 243, 0.78);
  font-size: 12px;
}

.gk-account-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.gk-account-checkbox {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #8e244c;
}

.gk-account-text-action {
  padding: 3px;
  border: 0;
  color: #f0c9d5;
  font: inherit;
  background: transparent;
  cursor: pointer;
}

.gk-account-text-action:hover {
  color: #fff;
}

.gk-account-submit,
.gk-account-secondary,
.gk-account-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 9px 18px;
  border-radius: 12px;
  color: #fff7fa;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease;
}

.gk-account-submit {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(
    110deg,
    rgba(145, 34, 74, 0.94),
    rgba(29, 63, 108, 0.92)
  );
  box-shadow:
    0 12px 25px rgba(7, 16, 34, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.gk-account-submit:hover,
.gk-account-secondary:hover,
.gk-account-logout:hover {
  filter: brightness(1.13);
  transform: translateY(-2px);
}

.gk-account-submit:disabled,
.gk-account-secondary:disabled,
.gk-account-logout:disabled {
  cursor: wait;
  filter: grayscale(0.25);
  opacity: 0.7;
  transform: none;
}

.gk-account-message {
  min-height: 20px;
  margin: 10px 0 0;
  color: rgba(250, 246, 247, 0.72);
  font-size: 12px;
  text-align: center;
}

.gk-account-message[data-state="error"] {
  color: #ffd4dc;
}

.gk-account-message[data-state="success"] {
  color: #d7f4e5;
}

.gk-account-privacy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 7px 0 0;
  color: rgba(249, 244, 246, 0.56);
  font-size: 11px;
  text-align: center;
}

.gk-account-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 14px 0 12px;
}

.gk-account-profile {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  min-width: 0;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  background: rgba(220, 216, 221, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.gk-account-avatar {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 15px;
  color: #fff;
  font-size: 21px;
  font-weight: 800;
  background: linear-gradient(135deg, #8e244c, #203f6f);
}

.gk-account-profile h3,
.gk-account-profile p,
.gk-account-profile small {
  margin: 0;
}

.gk-account-profile h3 {
  margin-bottom: 5px;
  color: #fff;
  font-size: 17px;
}

.gk-account-profile p {
  direction: ltr;
  color: rgba(249, 244, 246, 0.75);
  font-size: 13px;
  text-align: right;
}

.gk-account-profile small {
  display: block;
  margin-top: 5px;
  color: #d7f4e5;
  font-size: 11px;
}

.gk-account-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 11px;
  color: rgba(255, 255, 255, 0.88);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  background: rgba(222, 218, 223, 0.11);
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease;
}

.gk-account-refresh:hover {
  background: rgba(222, 218, 223, 0.19);
  transform: translateY(-1px);
}

.gk-account-refresh:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.gk-account-refresh.is-loading span {
  animation: gk-account-spin 800ms linear infinite;
}

@keyframes gk-account-spin {
  to {
    transform: rotate(-360deg);
  }
}

.gk-account-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 12px;
}

.gk-account-stats article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 12px;
  background: rgba(208, 204, 210, 0.09);
}

.gk-account-stats span {
  color: rgba(249, 244, 246, 0.72);
  font-size: 11px;
  font-weight: 700;
}

.gk-account-stats strong {
  color: #fff;
  font-size: 20px;
  line-height: 1;
}

.gk-account-my-ads {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 15px;
  background: rgba(27, 35, 51, 0.18);
}

.gk-account-my-ads-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.gk-account-my-ads-head h3,
.gk-account-my-ads-head p,
.gk-account-my-ads-head small {
  margin: 0;
}

.gk-account-my-ads-head h3 {
  margin-bottom: 3px;
  color: #fff;
  font-size: 14px;
}

.gk-account-my-ads-head p,
.gk-account-my-ads-head small {
  color: rgba(249, 244, 246, 0.58);
  font-size: 10px;
}

.gk-account-ads-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 225px));
  justify-content: center;
  align-items: start;
  gap: 9px;
  max-height: 430px;
  padding-left: 3px;
  overflow-y: auto;
  scrollbar-color: rgba(147, 105, 123, 0.75) rgba(255, 255, 255, 0.07);
  scrollbar-width: thin;
}

.gk-account-ad-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 268px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 13px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.09),
    rgba(255, 255, 255, 0.035)
  );
}

.gk-account-ad-image {
  display: grid;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 11px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 25px;
  background: linear-gradient(145deg, rgba(140, 35, 75, 0.5), rgba(31, 63, 105, 0.55));
}

.gk-account-ad-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gk-account-ad-content {
  min-width: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 0 2px;
}

.gk-account-ad-topline,
.gk-account-ad-meta,
.gk-account-ad-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.gk-account-ad-topline {
  justify-content: space-between;
}

.gk-account-ad-kind,
.gk-account-ad-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.gk-account-ad-kind {
  color: #f6dbe4;
  background: rgba(135, 34, 72, 0.45);
}

.gk-account-ad-status {
  color: #e8edf7;
  background: rgba(34, 68, 111, 0.48);
}

.gk-account-ad-status[data-state="pending_review"] {
  color: #fff1c9;
  background: rgba(139, 101, 27, 0.42);
}

.gk-account-ad-status[data-state="rejected"] {
  color: #ffd8df;
  background: rgba(139, 34, 62, 0.52);
}

.gk-account-ad-status[data-state="published"],
.gk-account-ad-status[data-state="active"] {
  color: #d9f6e7;
  background: rgba(31, 111, 77, 0.48);
}

.gk-account-ad-status[data-state="approved_waiting_payment"] {
  color: #e5e9ff;
  background: rgba(42, 68, 132, 0.58);
}

.gk-account-ad-title {
  margin: 7px 0 5px;
  display: -webkit-box;
  min-height: 37px;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.gk-account-ad-message {
  min-height: 29px;
  margin: 0 0 6px;
  display: -webkit-box;
  overflow: hidden;
  color: rgba(249, 244, 246, 0.67);
  font-size: 9px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.gk-account-ad-meta {
  margin-top: auto;
  flex-wrap: wrap;
  color: rgba(249, 244, 246, 0.57);
  font-size: 9px;
}

.gk-account-ad-reference {
  width: 100%;
  overflow: hidden;
  color: rgba(255, 236, 214, 0.76);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 8px;
  letter-spacing: 0.04em;
}

.gk-account-ad-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  width: 100%;
  padding-top: 2px;
}

.gk-account-ad-copy,
.gk-account-ad-pay {
  min-height: 30px;
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  color: #fff;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: filter 160ms ease, transform 160ms ease;
}

.gk-account-ad-copy {
  background: rgba(215, 211, 217, 0.12);
}

.gk-account-ad-pay {
  background: linear-gradient(110deg, #8e244c, #203f6f);
}

.gk-account-ad-copy:hover,
.gk-account-ad-pay:hover {
  filter: brightness(1.14);
  transform: translateY(-1px);
}

.gk-account-ads-empty {
  grid-column: 1 / -1;
  display: grid;
  min-height: 112px;
  place-items: center;
  padding: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.19);
  border-radius: 12px;
  color: rgba(249, 244, 246, 0.68);
  font-size: 12px;
  line-height: 1.9;
  text-align: center;
}

.gk-account-actions {
  display: flex;
  justify-content: center;
  gap: 11px;
  margin-top: 13px;
}

.gk-account-secondary,
.gk-account-logout {
  min-width: 150px;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.gk-account-secondary {
  background: rgba(222, 218, 223, 0.14);
}

.gk-account-logout {
  background: rgba(121, 32, 67, 0.62);
}

.gk-user-account-entry.is-authenticated {
  color: #fff;
  background: linear-gradient(
    135deg,
    rgba(139, 32, 72, 0.96),
    rgba(28, 61, 105, 0.96)
  );
  border-color: rgba(255, 255, 255, 0.46);
}

@media (max-width: 980px) {
  .gk-account-window {
    width: min(680px, 100%);
  }

  .gk-account-form-grid,
  #gkAccountLoginForm .gk-account-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gk-account-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 620px) {
  .gk-account-modal {
    place-items: start center;
    padding: 10px;
    overflow-y: auto;
  }

  .gk-account-window {
    width: 100%;
    max-height: none;
    margin: auto 0;
    border-radius: 18px;
  }

  .gk-account-window::before {
    border-radius: 16px;
  }

  .gk-account-inner {
    padding: 18px 16px 17px;
  }

  .gk-account-logo-frame {
    width: 72px;
    height: 48px;
  }

  .gk-account-brand {
    gap: 10px;
  }

  .gk-account-brand-name,
  .gk-account-title {
    font-size: 15px;
  }

  .gk-account-subtitle {
    font-size: 11px;
  }

  .gk-account-form-grid,
  #gkAccountLoginForm .gk-account-form-grid {
    grid-template-columns: 1fr;
  }

  .gk-account-bottom-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .gk-account-options {
    align-items: flex-start;
    flex-direction: column;
  }

  .gk-account-actions {
    flex-direction: column;
  }

  .gk-account-user-row {
    grid-template-columns: 1fr;
  }

  .gk-account-refresh {
    justify-self: stretch;
  }

  .gk-account-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gk-account-my-ads-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .gk-account-ads-list {
    max-height: 360px;
  }

  .gk-account-ad-card {
    width: 100%;
  }

  .gk-account-secondary,
  .gk-account-logout {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gk-account-modal,
  .gk-account-window,
  .gk-account-close,
  .gk-account-submit,
  .gk-account-secondary,
  .gk-account-logout,
  .gk-account-refresh,
  .gk-account-ad-copy,
  .gk-account-ad-pay {
    transition: none;
  }

  .gk-account-refresh.is-loading span {
    animation: none;
  }
}
