html.auth-page {
  overflow-x: hidden;
}

body.auth-page {
  min-height: 100dvh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  padding: max(1.25rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right))
    max(1.25rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: none;
}

body {
  background-color: #09090b;
  color: #e4e4e7;
}

.auth-page-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-page-wrap {
  width: 100%;
}

.auth-brand-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 0.5rem;
  color: var(--ft-brand);
}

.auth-brand-logo-wrap {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.25);
}

.auth-brand-logo {
  width: 1.8rem;
  height: auto;
  display: block;
}

.auth-back-link {
  display: none;
  align-items: center;
  justify-content: center;
  width: auto;
  margin-top: 1rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  color: #9ca3af;
  text-decoration: none;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.auth-back-link.is-visible {
  display: inline-flex;
}

.auth-back-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.auth-content {
  position: relative;
  z-index: 10;
}

/* اسکلتون روی همان input و دکمه واقعی — ابعاد دقیقاً یکی */
.auth-phone-form--loading #input-phone {
  color: transparent;
  caret-color: transparent;
  pointer-events: none;
  border-color: #3f3f46;
  background-color: #27272a;
  background-image: linear-gradient(90deg, #27272a 0%, #3f3f46 50%, #27272a 100%);
  background-size: 200% 100%;
  animation: auth-skeleton-shimmer 1.2s ease-in-out infinite;
}

.auth-phone-form--loading #input-phone::placeholder {
  color: transparent;
}

.auth-phone-form--loading #btn-phone-submit {
  color: transparent;
  pointer-events: none;
  background-color: rgb(var(--ft-brand-rgb) / 0.28);
  background-image: linear-gradient(
    90deg,
    rgb(var(--ft-brand-rgb) / 0.18) 0%,
    rgb(var(--ft-brand-rgb) / 0.48) 50%,
    rgb(var(--ft-brand-rgb) / 0.18) 100%
  );
  background-size: 200% 100%;
  animation: auth-skeleton-shimmer 1.2s ease-in-out infinite;
  box-shadow: none;
}

.auth-phone-form--loading #btn-phone-submit .ft-icon {
  visibility: hidden;
}

@keyframes auth-skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.ft-input-phone {
  font-family: Vazirmatn, sans-serif;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.ft-input-ltr {
  direction: ltr;
  text-align: left;
}

.ft-input-password {
  padding-right: 5.25rem;
  padding-left: 1rem;
}

.ft-password-toggle {
  position: absolute;
  right: 2.75rem;
  left: auto;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.25rem;
  line-height: 0;
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.ft-password-toggle.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.ft-password-toggle.is-visible:hover {
  color: #fff;
}

.ft-password-toggle .ft-icon {
  display: block;
  color: #9ca3af;
}

.ft-password-toggle.is-visible .ft-icon {
  color: #d4d4d8;
}

.btn-fort-secondary {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(255, 255, 255, 0.05);
  color: #e4e4e7;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.4;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-fort-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-fort {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 0;
  border-radius: 0.75rem;
  background-color: var(--ft-brand);
  color: var(--ft-brand-contrast);
  font-weight: 800;
  box-shadow: 0 0 15px rgb(var(--ft-brand-rgb) / 0.15);
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.btn-fort:hover {
  background-color: var(--ft-brand-hover);
}

.btn-fort:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.flex > .btn-fort {
  width: auto;
  flex: 1 1 0%;
}

.bg-glow-purple {
  position: fixed;
  top: -10%;
  right: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, rgba(9, 9, 11, 0) 70%);
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

.bg-glow-cyan {
  position: fixed;
  bottom: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.1) 0%, rgba(9, 9, 11, 0) 70%);
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

.glass-card {
  background: rgba(24, 24, 27, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.auth-view {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.auth-view.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type='number'] {
  -moz-appearance: textfield;
}

#toast.ft-toast-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.ft-auth-toast--success {
  background: #15803d;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.ft-auth-toast--info {
  background: #27272a;
  color: #e4e4e7;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#register-verified-banner.ft-banner-hidden {
  opacity: 0;
  max-height: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  overflow: hidden;
}

.ft-auth-modal.ft-modal-open {
  display: flex;
}

/* ——— Rules page ——— */
body.ft-rules-page {
  min-height: 100dvh;
  margin: 0;
  background: #09090b;
  color: #e4e4e7;
  position: relative;
  overflow-x: hidden;
}

.ft-rules-page .glass-panel {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.ft-rules-glow {
  position: fixed;
  border-radius: 9999px;
  pointer-events: none;
  filter: blur(80px);
  z-index: 0;
}

.ft-rules-glow--purple {
  width: 18rem;
  height: 18rem;
  top: -6rem;
  right: -4rem;
  background: rgba(139, 92, 246, 0.18);
}

.ft-rules-glow--cyan {
  width: 16rem;
  height: 16rem;
  bottom: -5rem;
  left: -3rem;
  background: rgba(6, 182, 212, 0.12);
}

.ft-rules-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(9, 9, 11, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.ft-rules-header__inner {
  max-width: 48rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.ft-rules-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
}

.ft-rules-brand__logo {
  display: block;
  height: 2.2rem;
  width: auto;
  max-width: 7.5rem;
  object-fit: contain;
}

.ft-rules-brand svg {
  display: block;
}

.ft-rules-header__link {
  color: #a1a1aa;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.5rem 0.875rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.ft-rules-header__link:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.ft-rules-main {
  position: relative;
  z-index: 1;
  padding: 1.5rem 1.25rem 2.5rem;
}

.ft-rules-wrap {
  max-width: 48rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ft-rules-hero {
  padding: 1.5rem 1.375rem;
  border-radius: 1.25rem;
}

.ft-rules-hero__badge {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--ft-brand);
  letter-spacing: 0.04em;
}

.ft-rules-hero__title {
  margin: 0 0 0.75rem;
  font-size: 1.375rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.45;
}

.ft-rules-hero__sub {
  margin: 0;
  font-size: 0.875rem;
  color: #a1a1aa;
  line-height: 1.7;
}

.ft-rules-section {
  padding: 1.25rem 1.375rem;
  border-radius: 1.25rem;
}

.ft-rules-section__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.ft-rules-section__title svg {
  display: block;
  color: var(--ft-brand);
  flex-shrink: 0;
}

.ft-rules-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ft-rules-list li {
  position: relative;
  padding-right: 1rem;
  font-size: 0.8125rem;
  color: #a1a1aa;
  line-height: 1.75;
}

.ft-rules-list li::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0.65rem;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background: rgb(var(--ft-brand-rgb) / 0.65);
}

.ft-rules-section__text {
  margin: 0;
  font-size: 0.8125rem;
  color: #a1a1aa;
  line-height: 1.85;
}

.ft-rules-section__text--empty {
  text-align: center;
  padding: 0.5rem 0;
}

/* ——— FAQ accordion (standalone content pages) ——— */
.ft-rules-faq {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ft-rules-faq__item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.875rem;
  background: rgba(24, 24, 27, 0.55);
  overflow: hidden;
}

.ft-rules-faq__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.125rem;
  background: transparent;
  border: 0;
  color: #fff;
  text-align: right;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 0.9375rem;
}

.ft-rules-faq__question {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
  text-align: right;
}

.ft-rules-faq__q-icon {
  flex-shrink: 0;
  color: var(--ft-brand-soft);
  margin-top: 0.1rem;
}

.ft-rules-faq__q-icon.ft-icon {
  display: block;
}

.ft-rules-faq__chev {
  flex: 0 0 auto;
  color: #71717a;
  transition: transform 0.25s ease;
}

.ft-rules-faq__chev.ft-icon {
  display: block;
}

.ft-rules-faq__item.is-open .ft-rules-faq__chev {
  transform: rotate(180deg);
}

.ft-rules-faq__panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.ft-rules-faq__answer {
  margin: 0;
  padding: 0 1.125rem 1rem;
  color: #a1a1aa;
  font-size: 0.875rem;
  line-height: 1.75;
  text-align: justify;
}

.ft-rules-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}

.ft-rules-actions__primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.875rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
}

.ft-rules-actions__secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.875rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #e4e4e7;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ft-rules-actions__secondary:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.14);
}

@media (min-width: 640px) {
  .ft-rules-main {
    padding: 2rem 1.5rem 3rem;
  }

  .ft-rules-wrap {
    gap: 1.125rem;
  }

  .ft-rules-hero__title {
    font-size: 1.625rem;
  }

  .ft-rules-actions {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .ft-rules-actions__primary {
    width: auto;
    min-width: 11rem;
  }

  .ft-rules-actions__secondary {
    width: auto;
    min-width: 11rem;
  }
}
