/* ==========================================================================
   BehzadPro — Auth Login / Register (App Mobile Kit)
   ========================================================================== */

body.woocommerce-account:not(.logged-in) .site-header .main-header,
body.bb-auth-guest .site-header .main-header {
  /* keep top bar; reduce clutter on mobile */
}

body.woocommerce-account:not(.logged-in) .bb-account-container,
body.woocommerce-account:not(.logged-in) .container.bb-account-container {
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

body.woocommerce-account:not(.logged-in) article.post,
body.woocommerce-account:not(.logged-in) .entry-header {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
}

.bb-auth-page {
  position: relative;
  min-height: calc(100vh - 90px);
  padding: 16px 12px 110px;
  overflow: hidden;
  background: linear-gradient(165deg, #0b1226 0%, #101b38 45%, #1a2748 100%);
  font-family: var(--font-family, 'Vazirmatn', sans-serif);
}

.bb-auth-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 40% at 90% 0%, rgba(218, 179, 105, 0.28), transparent 58%),
    radial-gradient(ellipse 45% 35% at 5% 90%, rgba(19, 126, 121, 0.2), transparent 55%),
    radial-gradient(ellipse 30% 25% at 50% 40%, rgba(133, 37, 54, 0.18), transparent 60%);
  animation: bbAuthGlow 10s ease-in-out infinite alternate;
}

@keyframes bbAuthGlow {
  from { opacity: 0.75; }
  to { opacity: 1; }
}

.bb-auth-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.bb-auth-app {
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-radius: 32px;
  border: 2px solid rgba(218, 179, 105, 0.45);
  box-shadow:
    0 28px 60px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  overflow: hidden;
  color: var(--navy, #101b38);
  animation: bbAuthRise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  padding: 0 0 22px;
}

@keyframes bbAuthRise {
  from { opacity: 0; transform: translateY(22px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.bb-auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #fcf7ed, #fff);
  border-bottom: 1px solid rgba(218, 179, 105, 0.22);
}

.bb-auth-back,
.bb-auth-support {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(16, 27, 56, 0.06);
  color: var(--navy, #101b38);
  text-decoration: none;
  transition: transform 0.2s, background 0.2s;
}
.bb-auth-back:hover,
.bb-auth-support:hover {
  background: rgba(218, 179, 105, 0.25);
  transform: scale(1.05);
  color: var(--navy, #101b38);
}

.bb-auth-topbar-text {
  text-align: center;
  flex: 1;
}
.bb-auth-topbar-text strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 900;
}
.bb-auth-topbar-text span {
  font-size: 0.72rem;
  color: rgba(16, 27, 56, 0.5);
  font-weight: 700;
}

.bb-auth-hero {
  text-align: center;
  padding: 22px 22px 8px;
}

.bb-auth-logo-3d {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  perspective: 600px;
}
.bb-auth-logo-glow {
  position: absolute;
  inset: -8px;
  border-radius: 28px;
  background: radial-gradient(circle, rgba(218, 179, 105, 0.45), transparent 70%);
  animation: bbAuthPulse 2.8s ease-in-out infinite;
}
.bb-auth-logo {
  position: relative;
  z-index: 1;
  width: 64px;
  height: 64px;
  object-fit: contain;
  padding: 12px;
  border-radius: 22px;
  background: linear-gradient(145deg, #101b38, #1c2f5c);
  box-shadow: 0 16px 32px rgba(16, 27, 56, 0.35);
  transform: rotateY(-8deg) rotateX(6deg);
  animation: bbAuthLogoFloat 5s ease-in-out infinite;
}
@keyframes bbAuthPulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}
@keyframes bbAuthLogoFloat {
  0%, 100% { transform: rotateY(-8deg) rotateX(6deg) translateY(0); }
  50% { transform: rotateY(8deg) rotateX(4deg) translateY(-6px); }
}

.bb-auth-brand {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--wine, #852536);
}
.bb-auth-title {
  margin: 0 0 8px;
  font-size: 1.55rem;
  font-weight: 900;
}
.bb-auth-sub {
  margin: 0 auto;
  max-width: 320px;
  font-size: 0.88rem;
  line-height: 1.75;
  color: rgba(16, 27, 56, 0.62);
}

.bb-auth-steps {
  padding: 18px 22px 0;
}

.bb-auth-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 800;
}

.bb-auth-phone-wrap {
  position: relative;
  margin-bottom: 8px;
}
.bb-auth-phone-icon {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  color: var(--gold, #dab369);
}
.bb-auth-input {
  width: 100%;
  height: 56px;
  border-radius: 16px;
  border: 1.5px solid rgba(16, 27, 56, 0.12);
  background: #fff;
  padding: 0 46px 0 16px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--navy, #101b38);
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.bb-auth-input:focus {
  border-color: var(--gold, #dab369);
  box-shadow: 0 0 0 4px rgba(218, 179, 105, 0.22);
  transform: translateY(-1px);
}
.bb-auth-hint {
  margin: 0 0 16px;
  font-size: 0.75rem;
  color: rgba(16, 27, 56, 0.45);
}

.bb-auth-btn {
  width: 100%;
  height: 54px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(120deg, #101b38 0%, #1e3466 45%, #852536 100%);
  background-size: 200% 100%;
  box-shadow: 0 14px 28px rgba(16, 27, 56, 0.28);
  position: relative;
  transition: background-position 0.35s, transform 0.2s;
}
.bb-auth-btn:hover:not(:disabled) {
  background-position: 100% 0;
  transform: translateY(-2px);
}
.bb-auth-btn:disabled { opacity: 0.7; cursor: wait; }
.bb-auth-btn.is-loading .bb-auth-btn-text,
.bb-auth-btn.is-loading .bb-auth-btn-arrow { opacity: 0; }
.bb-auth-btn-loader {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: bbAuthSpin 0.7s linear infinite;
}
@keyframes bbAuthSpin { to { transform: rotate(360deg); } }

.bb-auth-digits {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: clamp(4px, 1.8vw, 10px);
  width: 100%;
  max-width: 100%;
  margin: 0 auto 16px;
  padding: 0 2px;
  box-sizing: border-box;
  direction: ltr;
}
.bb-auth-digit {
  flex: 1 1 0;
  width: auto;
  max-width: 48px;
  min-width: 0;
  height: clamp(46px, 12vw, 52px);
  box-sizing: border-box;
  border-radius: 12px;
  border: 1.5px solid rgba(16, 27, 56, 0.12);
  text-align: center;
  font-size: clamp(1.05rem, 4vw, 1.25rem);
  font-weight: 900;
  font-family: inherit;
  outline: none;
  padding: 0;
  margin: 0;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.bb-auth-digit:focus {
  border-color: var(--gold, #dab369);
  box-shadow: 0 0 0 3px rgba(218, 179, 105, 0.25);
  transform: scale(1.04);
}
.bb-auth-digit.is-filled {
  border-color: rgba(19, 126, 121, 0.45);
  background: rgba(19, 126, 121, 0.06);
}

.bb-auth-sent-to {
  text-align: center;
  margin: 0 0 14px;
  font-weight: 800;
  font-size: 0.9rem;
}
.bb-auth-footer-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}
.bb-auth-link {
  border: 0;
  background: none;
  color: var(--teal, #137e79);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}
.bb-auth-link:disabled {
  opacity: 0.45;
  cursor: default;
  color: rgba(16, 27, 56, 0.4);
}

.bb-auth-msg {
  min-height: 1.4em;
  margin: 12px 22px 0;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--wine, #852536);
}
.bb-auth-msg.is-ok { color: var(--teal, #137e79); }

.bb-auth-panel {
  animation: bbAuthRise 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.bb-auth-panel--success {
  text-align: center;
  padding: 24px 0 10px;
}
.bb-auth-check {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
}
.bb-auth-check svg {
  width: 72px;
  height: 72px;
  stroke: var(--teal, #137e79);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bb-auth-check circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: bbAuthStroke 0.6s ease-out forwards;
}
.bb-auth-check path {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: bbAuthStroke 0.35s 0.4s ease-out forwards;
}
@keyframes bbAuthStroke { to { stroke-dashoffset: 0; } }
.bb-auth-success-msg {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
}

.bb-auth-trust {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 16px 0;
}
.bb-auth-trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  border-radius: 14px;
  background: rgba(252, 247, 237, 0.9);
  border: 1px solid rgba(218, 179, 105, 0.25);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  color: var(--navy, #101b38);
}
.bb-auth-trust-item i { color: var(--gold, #dab369); font-size: 1rem; }

.bb-auth-shop-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 22px 0;
  padding: 12px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--navy, #101b38);
  background: rgba(16, 27, 56, 0.05);
  transition: background 0.2s, transform 0.2s;
}
.bb-auth-shop-link:hover {
  background: rgba(218, 179, 105, 0.2);
  transform: translateY(-1px);
  color: var(--navy, #101b38);
}

/* Desktop widen */
@media (min-width: 768px) {
  .bb-auth-page {
    min-height: calc(100vh - 160px);
    padding: 40px 20px 60px;
    display: flex;
    align-items: center;
  }
  .bb-auth-shell { max-width: 460px; }
}

@media (max-width: 992px) {
  html:has(body.woocommerce-account:not(.logged-in)),
  body.woocommerce-account:not(.logged-in),
  body.bb-auth-guest {
    overflow-x: hidden !important;
    max-width: 100% !important;
  }

  body.woocommerce-account:not(.logged-in) .top-bar,
  body.woocommerce-account:not(.logged-in) .main-header,
  body.woocommerce-account:not(.logged-in) .nav-header,
  body.woocommerce-account:not(.logged-in) .site-footer .footer-features-bar,
  body.woocommerce-account:not(.logged-in) .site-footer .footer-main-content,
  body.woocommerce-account:not(.logged-in) .auto-mobile-app-nav,
  body.woocommerce-account:not(.logged-in) .offcanvas-drawer,
  body.woocommerce-account:not(.logged-in) .behzad-ajax-cart-drawer,
  body.woocommerce-account:not(.logged-in) .mobile-cat-drawer {
    display: none !important;
  }

  .bb-auth-page {
    min-height: 100vh;
    padding: 16px 12px 28px;
    overflow-x: hidden;
    max-width: 100%;
  }

  .bb-auth-shell,
  .bb-auth-app {
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bb-auth-ambient,
  .bb-auth-logo,
  .bb-auth-logo-glow { animation: none; }
}
