/* Auth sheet — guest storefront (works even when fortino.css is omitted on home) */

.ft-auth-sheet {
  --ft-auth-keyboard: 0px;
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  /* Mobile: top sheet — login stays above keyboard */
  align-items: flex-start;
  justify-content: center;
  padding: calc(0.55rem + env(safe-area-inset-top, 0px)) 0.75rem 0;
  pointer-events: none;
}

.ft-auth-sheet.is-open {
  pointer-events: auto;
}

.ft-auth-sheet[hidden] {
  display: none !important;
}

.ft-auth-sheet.is-open[hidden] {
  display: flex !important;
}

.ft-auth-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.28);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.ft-auth-sheet.is-open .ft-auth-sheet__backdrop {
  opacity: 1;
}

.ft-auth-sheet__stack {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 26rem;
  /* Panel + outside close below it */
  max-height: calc(100dvh - var(--ft-auth-keyboard, 0px) - 0.5rem);
}

.ft-auth-sheet__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: calc(100% - 3.25rem);
  margin: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  border-radius: 1.15rem;
  border: 1px solid rgb(255 255 255 / 0.1);
  background: #18181b;
  color: #e4e4e7;
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.4);
  transform: translateY(calc(-100% - 2.5rem));
  opacity: 0;
  transition:
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.22s ease;
}

.ft-auth-sheet.is-open .ft-auth-sheet__panel {
  transform: translateY(0);
  opacity: 1;
}

.ft-auth-sheet__chrome {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 1.35rem;
  padding: 0.15rem 1rem 0.65rem;
}

.ft-auth-sheet__handle {
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.ft-auth-sheet__handle span {
  width: 2.35rem;
  height: 0.28rem;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.22);
}

.ft-auth-sheet__close {
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  line-height: 0;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  color: #d4d4d8;
  box-shadow: none;
  cursor: pointer;
}

.ft-auth-sheet__close svg {
  display: block;
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  flex-shrink: 0;
}

.ft-auth-sheet__close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* Mobile: X sits under the sheet, outside the panel — fades in place (does not fly with panel) */
.ft-auth-sheet__close--in {
  display: none;
}

.ft-auth-sheet__close--out {
  margin-top: 0.65rem;
  flex: 0 0 auto;
  opacity: 0;
  transform: translateY(-0.35rem);
  transition:
    opacity 0.22s ease 0.06s,
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1) 0.04s;
}

.ft-auth-sheet.is-open .ft-auth-sheet__close--out {
  opacity: 1;
  transform: translateY(0);
}

.ft-auth-sheet__body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0.85rem 1.15rem 0.35rem;
  -webkit-overflow-scrolling: touch;
}

html.ft-auth-sheet-open {
  overflow: hidden;
}

body.ft-auth-sheet-open {
  position: static; /* override any position:fixed scroll-lock that blanks the page */
  top: auto;
  overflow: hidden;
  overscroll-behavior: none;
}

@media (min-width: 640px) {
  .ft-auth-sheet {
    align-items: center;
    padding: 1.5rem;
  }

  .ft-auth-sheet__stack {
    max-height: min(88dvh, 36rem);
  }

  .ft-auth-sheet__panel {
    border-radius: 1.15rem;
    max-height: 100%;
    box-shadow: 0 24px 48px rgb(0 0 0 / 0.5);
    transform: translateY(10px) scale(0.98);
  }

  .ft-auth-sheet.is-open .ft-auth-sheet__panel {
    transform: translateY(0) scale(1);
  }

  .ft-auth-sheet__chrome {
    position: absolute;
    inset-inline-end: 0;
    top: 0;
    min-height: 0;
    width: auto;
    padding: 0;
    pointer-events: none;
  }

  .ft-auth-sheet__handle {
    display: none;
  }

  .ft-auth-sheet__close--out {
    display: none;
  }

  .ft-auth-sheet__close--in {
    display: inline-flex;
    position: absolute;
    top: 0.75rem;
    inset-inline-end: 0.75rem;
    pointer-events: auto;
  }

  .ft-auth-sheet__body {
    padding: 1.15rem 1.4rem 1.35rem;
  }
}

.ft-auth-sheet .auth-header {
  margin-bottom: 1.15rem;
  text-align: center;
}

.ft-auth-sheet .auth-header--compact {
  margin-bottom: 1.15rem;
}

.ft-auth-sheet .auth-subtitle {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f4f4f5;
  line-height: 1.6;
}

.ft-auth-sheet .auth-step-lead {
  margin: 0 0 1rem;
  text-align: center;
  font-size: 0.875rem;
  line-height: 1.7;
  color: #9ca3af;
}

.ft-auth-sheet .auth-phone-chip {
  margin-bottom: 1.35rem;
}

.ft-auth-sheet .auth-password-form,
.ft-auth-sheet .auth-phone-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ft-auth-sheet .auth-field-label-row {
  margin-bottom: 0.55rem;
}

.ft-auth-sheet .auth-content {
  position: relative;
  z-index: 1;
}

.ft-auth-sheet .auth-view {
  display: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.ft-auth-sheet .auth-view[hidden] {
  display: none !important;
}

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

.ft-auth-sheet .auth-view.active[hidden] {
  display: block !important;
}

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

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

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

.ft-auth-sheet .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;
  background: transparent;
  border: 0;
  cursor: pointer;
}

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

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

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

.ft-auth-sheet .btn-fort:disabled,
.ft-auth-sheet .btn-fort.is-loading,
.ft-auth-sheet .btn-fort-secondary:disabled,
.ft-auth-sheet .btn-fort-secondary.is-loading {
  cursor: wait;
  opacity: 1;
  pointer-events: none;
}

.ft-auth-sheet .btn-fort:disabled:hover,
.ft-auth-sheet .btn-fort.is-loading:hover {
  background-color: var(--ft-brand-fill, var(--ft-brand));
}

.ft-auth-sheet .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 rgb(255 255 255 / 0.1);
  background-color: rgb(255 255 255 / 0.05);
  color: #e4e4e7;
  font: inherit;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.4;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ft-auth-sheet .btn-fort-secondary:hover {
  background-color: rgb(255 255 255 / 0.1);
  color: #fff;
}

.ft-auth-sheet .ft-btn-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 1.25rem;
}

.ft-auth-sheet .ft-btn-dots > i {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.28;
  animation: ft-auth-sheet-dots-pulse 1s ease-in-out infinite;
}

.ft-auth-sheet .ft-btn-dots > i:nth-child(2) {
  animation-delay: 0.15s;
}

.ft-auth-sheet .ft-btn-dots > i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes ft-auth-sheet-dots-pulse {
  0%,
  80%,
  100% {
    opacity: 0.28;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

.ft-auth-sheet .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: ft-auth-sheet-skel 1.2s ease-in-out infinite;
}

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

.ft-auth-sheet .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: ft-auth-sheet-skel 1.2s ease-in-out infinite;
  box-shadow: none;
}

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

@keyframes ft-auth-sheet-skel {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.ft-auth-sheet .ft-otp-autofill-wrap {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ft-auth-sheet .ft-otp-autofill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.02;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
}

.ft-auth-sheet .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ft-auth-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

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

.ft-auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.ft-auth-modal__card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 24rem;
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid rgb(255 255 255 / 0.1);
  background: #18181b;
  text-align: center;
  box-shadow: 0 24px 48px rgb(0 0 0 / 0.45);
}

.ft-auth-modal__title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
}

.ft-auth-modal__text {
  margin: 0 0 1.5rem;
  font-size: 0.875rem;
  line-height: 1.7;
  color: #9ca3af;
}

.ft-auth-modal__phone {
  color: #fff;
  font-weight: 500;
}

.ft-auth-modal__actions {
  display: flex;
  gap: 0.75rem;
}

.ft-auth-modal__btn {
  flex: 1 1 0%;
  min-height: 2.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.ft-auth-modal__btn--ghost {
  border: 1px solid rgb(255 255 255 / 0.1);
  background: transparent;
  color: #d4d4d8;
}

.ft-auth-modal__btn--ghost:hover {
  background: rgb(255 255 255 / 0.05);
}

.ft-auth-modal__btn--primary {
  border: 0;
  background-color: var(--ft-brand-fill, var(--ft-brand));
  color: var(--ft-brand-contrast);
  box-shadow: 0 0 15px rgb(var(--ft-brand-rgb) / 0.15);
}

.ft-auth-modal__btn--primary:hover {
  background-color: var(--ft-brand-fill-hover, var(--ft-brand-hover));
}

.ft-auth-modal__btn--primary.is-loading,
.ft-auth-modal__btn--primary:disabled {
  cursor: wait;
  pointer-events: none;
}

/*
 * Mobile top-sheet: panel hugs the top, so toast-above was off-screen.
 * Keep toast fixed near the bottom (above keyboard) where it stays visible.
 */
.ft-auth-sheet-toast {
  position: fixed;
  top: auto;
  bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px) + var(--ft-auth-keyboard, 0px));
  left: 50%;
  z-index: 90;
  display: flex;
  width: max-content;
  max-width: min(calc(100vw - 1.5rem), 22rem);
  min-width: 12rem;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.7rem 1.05rem;
  border-radius: 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 0.55rem);
  box-shadow: 0 14px 32px rgb(0 0 0 / 0.35);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

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

@media (min-width: 640px) {
  .ft-auth-sheet-toast {
    position: absolute;
    bottom: calc(100% + 0.55rem);
    z-index: 5;
    max-width: min(100%, 22rem);
  }
}

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

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

.ft-auth-toast--warn {
  background: #92400e;
  color: #fff7ed;
  border: 1px solid rgb(255 255 255 / 0.14);
}

.ft-otp-channel-note {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.8rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.55;
  text-align: center;
  border: 1px solid rgb(255 255 255 / 0.1);
  background: rgb(255 255 255 / 0.04);
  color: #e4e4e7;
}

.ft-otp-channel-note.is-warn {
  background: rgb(146 64 14 / 0.28);
  border-color: rgb(251 191 36 / 0.35);
  color: #ffedd5;
}

.ft-otp-channel-note.is-ok {
  background: rgb(21 128 61 / 0.18);
  border-color: rgb(74 222 128 / 0.28);
  color: #dcfce7;
}

#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;
}
