/* ==========================================================================
   DANJE AUTH — Luxury Centered Card Login/Register
   ==========================================================================
   
   Centered Card Layout inspired by premium Dribbble design:
   - Left side: Asymmetric grid showing 4 product images
   - Right side: Login & Registration forms with premium typography
   - Adapts to Light/Dark modes seamlessly
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. HIDE HEADER & FOOTER ON AUTH PAGE (Immersive Login)
   -------------------------------------------------------------------------- */
.woocommerce-account:not(.logged-in) .danje-site-header,
.woocommerce-account:not(.logged-in) .danje-nav__mobile-overlay,
.woocommerce-account:not(.logged-in) .danje-site-footer,
.woocommerce-account:not(.logged-in) .danje-footer-copyright,
.woocommerce-account:not(.logged-in) #danje-cart-drawer {
  display: none !important;
}

.woocommerce-account:not(.logged-in) .site-content {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* --------------------------------------------------------------------------
   1. FULL VIEWPORT WRAPPER & CARD
   -------------------------------------------------------------------------- */
.danje-auth__page-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  background: var(--bg-primary);
  padding: var(--space-xl) var(--space-lg);
  box-sizing: border-box;
}

[data-theme="light"] .danje-auth__page-wrapper {
  background: #f9f6f0; /* Warm beige luxury background */
}

/* Container card */
.danje-auth__card {
  display: grid;
  grid-template-columns: 1fr 1.15fr; /* Visually form on the right, gallery on the left in RTL */
  background: var(--bg-card);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  width: 100%;
  max-width: 1060px;
  min-height: 660px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-slow) var(--ease-luxury);
}

[data-theme="light"] .danje-auth__card {
  background: #ffffff;
  border-color: rgba(201, 168, 76, 0.15);
  box-shadow: 0 20px 50px rgba(120, 110, 90, 0.08), 0 0 0 1px rgba(201, 168, 76, 0.05);
}

/* Remove all page wrappers that add padding when on this page */
.woocommerce-account .danje-page {
  padding: 0 !important;
  margin: 0 !important;
}
.woocommerce-account .danje-page .danje-container {
  max-width: 100% !important;
  padding: 0 !important;
}
.woocommerce-account .danje-page .danje-page__header {
  display: none !important; /* Hide default "حساب کاربری من" title */
}
.woocommerce-account .danje-page__content {
  padding: 0 !important;
  margin: 0 !important;
}
.woocommerce-account .danje-page__content > .woocommerce {
  padding: 0 !important;
  margin: 0 !important;
}

/* Remove default WC form wrapper margins */
.woocommerce-account .woocommerce-form-login,
.woocommerce-account .woocommerce-form-register {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
}

/* --------------------------------------------------------------------------
   2. FORM COLUMN (Right in RTL)
   -------------------------------------------------------------------------- */
.danje-auth__form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-2xl);
  background: transparent;
  box-sizing: border-box;
}

.danje-auth__form-container {
  width: 100%;
  max-width: 380px;
}

/* Brand logo section */
.danje-auth__brand {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.danje-auth__brand-logo {
  font-family: 'Vazirmatn', sans-serif;
  font-size: var(--text-3xl);
  font-weight: 900;
  color: var(--gold);
  margin: 0 0 var(--space-xs) 0;
  letter-spacing: -0.01em;
}

.danje-auth__brand-sub {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: 500;
  margin: 0;
}

/* --------------------------------------------------------------------------
   3. TABS (Login / Register)
   -------------------------------------------------------------------------- */
.danje-auth__tabs {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .danje-auth__tabs {
  border-bottom-color: #e5e0d8;
}

.danje-auth__tab {
  flex: 1;
  background: none;
  border: none;
  padding: var(--space-md) var(--space-sm);
  font-family: 'Vazirmatn', sans-serif;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: color 0.4s var(--ease-luxury);
  white-space: nowrap;
  text-align: center;
}

.danje-auth__tabs:has(.danje-auth__tab:nth-child(3)) .danje-auth__tab {
  font-size: var(--text-sm);
  padding-inline: var(--space-xs);
}

.danje-auth__tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  inset-inline-start: 0;
  width: 100%;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.4s var(--ease-luxury);
}

.danje-auth__tab--active {
  color: var(--text-primary);
  font-weight: 700;
}

[data-theme="light"] .danje-auth__tab--active {
  color: #1a1000;
}

.danje-auth__tab--active::after {
  transform: scaleX(1);
}

.danje-auth__tab:hover:not(.danje-auth__tab--active) {
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   4. FORM FIELDS — Bordered Luxury Design
   -------------------------------------------------------------------------- */
.danje-auth__field-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.danje-auth__field {
  position: relative;
}

.danje-auth__label {
  display: block;
  font-family: 'Vazirmatn', sans-serif;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

[data-theme="light"] .danje-auth__label {
  color: #6a6458;
}

.danje-auth__input {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  font-family: 'Vazirmatn', sans-serif;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
  direction: rtl;
  box-sizing: border-box;
}

[data-theme="light"] .danje-auth__input {
  color: #1a1a1a;
  background: #fdfdfc;
  border-color: #e5e5e5;
}

.danje-auth__input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.12);
}

/* Password wrapper for toggle button */
.danje-auth__password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.danje-auth__password-wrapper .danje-auth__input {
  padding-inline-end: 46px;
}

.danje-auth__toggle-pass {
  position: absolute;
  inset-inline-end: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: var(--space-xs);
  transition: color 0.3s var(--ease-out);
  display: flex;
  align-items: center;
  justify-content: center;
}

.danje-auth__toggle-pass:hover {
  color: var(--gold);
}

/* --------------------------------------------------------------------------
   4b. MOBILE OTP LOGIN
   -------------------------------------------------------------------------- */
.danje-otp__step {
  display: flex;
  flex-direction: column;
}

.danje-otp__step[hidden] {
  display: none !important;
}

.danje-otp__phone-input {
  text-align: left;
  letter-spacing: 0.04em;
}

#danje-otp-send-btn,
#danje-otp-verify-btn {
  margin-top: var(--space-lg);
}

.danje-otp__sent-to {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0 0 var(--space-lg) 0;
  text-align: center;
  font-family: 'Vazirmatn', sans-serif;
}

[data-theme="light"] .danje-otp__sent-to {
  color: #6a6458;
}

.danje-otp__sent-to bdi {
  color: var(--gold);
  font-weight: 700;
}

.danje-otp__code-boxes {
  display: flex;
  flex-direction: row;
  direction: ltr;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.danje-otp__code-digit {
  width: 52px;
  height: 60px;
  text-align: center;
  font-size: var(--text-xl);
  font-weight: 700;
  font-family: 'Vazirmatn', sans-serif;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), transform 0.2s var(--ease-out);
}

[data-theme="light"] .danje-otp__code-digit {
  color: #1a1a1a;
  background: #fdfdfc;
  border-color: #e5e5e5;
}

.danje-otp__code-digit:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.12);
  transform: translateY(-2px);
}

.danje-otp__spam-note {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.7;
  margin: 0;
}

.danje-otp__footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-lg);
  font-family: 'Vazirmatn', sans-serif;
}

.danje-otp__link-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--gold);
  padding: 0;
  transition: color 0.3s var(--ease-out), opacity 0.3s var(--ease-out);
}

.danje-otp__link-btn:hover:not(:disabled) {
  color: var(--gold-light);
}

.danje-otp__link-btn:disabled {
  cursor: default;
  color: var(--text-muted);
  opacity: 0.6;
}

.danje-otp__msg {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-align: center;
  margin: var(--space-md) 0 0 0;
  min-height: 1.4em;
  transition: color 0.3s var(--ease-out);
}

.danje-otp__msg--error {
  color: #fca5a5;
}

.danje-auth__submit.is-busy .danje-auth__submit-text {
  opacity: 0;
}

.danje-auth__submit.is-busy .danje-auth__submit-loader {
  display: flex;
  position: absolute;
  animation: danje-spin 0.9s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .danje-auth__submit.is-busy .danje-auth__submit-loader {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   5. OPTIONS ROW (Remember Me + Forgot Password)
   -------------------------------------------------------------------------- */
.danje-auth__options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
  font-family: 'Vazirmatn', sans-serif;
}

/* Custom checkbox */
.danje-auth__remember {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: 500;
  user-select: none;
}

[data-theme="light"] .danje-auth__remember {
  color: #6a6458;
}

.danje-auth__checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.danje-auth__checkmark {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-hover);
  border-radius: 4px;
  background: transparent;
  transition: all 0.3s var(--ease-out);
  position: relative;
  flex-shrink: 0;
}

[data-theme="light"] .danje-auth__checkmark {
  border-color: #ccc8c0;
}

.danje-auth__checkbox:checked + .danje-auth__checkmark {
  background: var(--gold);
  border-color: var(--gold);
}

.danje-auth__checkbox:checked + .danje-auth__checkmark::after {
  content: '';
  position: absolute;
  top: 2px;
  inset-inline-start: 5px;
  width: 5px;
  height: 9px;
  border: solid var(--text-on-gold);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Forgot password link */
.danje-auth__forgot {
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: color 0.3s var(--ease-out);
}

[data-theme="light"] .danje-auth__forgot {
  color: #8a8070;
}

.danje-auth__forgot::after {
  content: '';
  position: absolute;
  bottom: -2px;
  inset-inline-start: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.4s var(--ease-luxury);
}

.danje-auth__forgot:hover {
  color: var(--gold);
}

.danje-auth__forgot:hover::after {
  width: 100%;
}

/* --------------------------------------------------------------------------
   6. SUBMIT BUTTON — Full-Width, Dark/Gold Luxury
   -------------------------------------------------------------------------- */
.danje-auth__submit {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  background: var(--gold);
  color: var(--text-on-gold);
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  font-family: 'Vazirmatn', sans-serif;
  font-size: var(--text-base);
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.3s var(--ease-out),
    background 0.4s var(--ease-luxury),
    border-color 0.4s var(--ease-luxury),
    box-shadow 0.4s var(--ease-luxury);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.danje-auth__submit:hover {
  transform: translateY(-2px);
  background: var(--gold-light);
  border-color: var(--gold-light);
  box-shadow: var(--shadow-gold);
}

.danje-auth__submit:active {
  transform: translateY(0) scale(0.98);
}

.danje-auth__submit:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.danje-auth__submit-loader {
  display: none;
}

/* --------------------------------------------------------------------------
   7. ASYMMETRIC GALLERY COLUMN (Left in RTL)
   -------------------------------------------------------------------------- */
.danje-auth__gallery-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  padding: var(--space-xl);
  background: rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
}

[data-theme="light"] .danje-auth__gallery-side {
  background: #fbfaf8;
  border-inline-end: 1px solid rgba(201, 168, 76, 0.08);
}

.danje-auth__gallery-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  height: 100%;
  justify-content: center;
}

.danje-auth__gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: transform 0.6s var(--ease-luxury), box-shadow 0.6s var(--ease-luxury);
}

[data-theme="light"] .danje-auth__gallery-item {
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(120, 110, 90, 0.06);
}

.danje-auth__gallery-link {
  display: block;
  width: 100%;
  height: 100%;
}

.danje-auth__gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: var(--space-sm);
  box-sizing: border-box;
  display: block;
  transition: transform 0.8s var(--ease-luxury);
}

.danje-auth__gallery-item:hover img {
  transform: scale(1.08);
}

.danje-auth__gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

/* Asymmetric size variations */
.danje-auth__gallery-item--long {
  flex: 1.5;
  min-height: 260px;
}

.danje-auth__gallery-item--short {
  flex: 1;
  min-height: 180px;
}

/* --------------------------------------------------------------------------
   8. SOCIAL PROOF & DIVIDER
   -------------------------------------------------------------------------- */
.danje-auth__social-proof {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-xl);
  font-family: 'Vazirmatn', sans-serif;
}

.danje-auth__divider-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

[data-theme="light"] .danje-auth__divider-line {
  background: #e5e0d8;
}

.danje-auth__divider-text {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   9. NOTICES & ALERTS
   -------------------------------------------------------------------------- */
.woocommerce-account .woocommerce-notices-wrapper {
  position: fixed;
  top: var(--space-lg);
  inset-inline-end: var(--space-lg);
  z-index: 10000;
  max-width: 400px;
}

.woocommerce-account .woocommerce-notices-wrapper .woocommerce-error {
  background: #1a0a0a;
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #fca5a5;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  list-style: none;
  margin: 0;
  font-family: 'Vazirmatn', sans-serif;
}

.woocommerce-account .woocommerce-notices-wrapper .woocommerce-message {
  background: #0a1a0a;
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  list-style: none;
  margin: 0;
  font-family: 'Vazirmatn', sans-serif;
}

/* --------------------------------------------------------------------------
   10. RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
  .danje-auth__card {
    grid-template-columns: 1fr;
    max-width: 520px;
    min-height: auto;
  }

  .danje-auth__gallery-side {
    display: none; /* Hide product gallery on mobile/tablet to stay clean */
  }

  .danje-auth__form-side {
    padding: var(--space-2xl) var(--space-xl);
  }
}

@media (max-width: 480px) {
  .danje-auth__page-wrapper {
    padding: var(--space-md);
  }

  .danje-auth__form-side {
    padding: var(--space-xl) var(--space-md);
  }

  .danje-auth__options {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  .danje-otp__code-digit {
    width: 44px;
    height: 52px;
  }

  .danje-otp__code-boxes {
    gap: var(--space-xs);
  }
}

/* ---- Lost password — narrow glass modal over a blurred backdrop ---- */

/* Not position:fixed — this page's content wrapper has a CSS transform
   applied by the site's scroll-reveal animations, and a transformed
   ancestor makes position:fixed relative to IT instead of the
   viewport, collapsing the box to a sliver instead of covering the
   screen (the same issue already worked around for the address-book
   modal, which reparents to <body> — simpler here to just avoid fixed
   positioning altogether since this is a full standalone page, not a
   toggled overlay). */
.danje-lostpw {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 70vh;
	padding: 24px;
}

.danje-lostpw__backdrop {
	display: none;
}

.danje-lostpw__card {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 380px;
	padding: 36px 30px;
	background: var(--bg-surface);
	border: 1px solid var(--gold-border);
	border-radius: var(--radius-xl, 28px);
	box-shadow: var(--shadow-card-hover, 0 20px 60px rgba(0,0,0,0.12));
	text-align: center;
	animation: danje-lostpw-rise 0.6s cubic-bezier(0.16,1,0.3,1) both;
}

@keyframes danje-lostpw-rise {
	from { opacity: 0; transform: translateY(16px) scale(0.98); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

.danje-lostpw__logo {
	font-size: 20px;
	font-weight: 800;
	color: var(--gold-dark);
	margin: 0 0 6px;
}

.danje-lostpw__desc {
	font-size: 13px;
	color: var(--text-secondary);
	line-height: 1.9;
	margin: 0 0 24px;
}

.danje-lostpw__card .danje-auth__field {
	text-align: right;
	margin-bottom: 18px;
}

.danje-lostpw__card .danje-auth__submit {
	width: 100%;
}

.danje-lostpw__hint {
	margin: 16px 0 0;
	font-size: 11.5px;
	color: var(--text-muted);
	line-height: 1.8;
	text-align: right;
}

@media (prefers-reduced-motion: reduce) {
	.danje-lostpw__card {
		animation: none;
	}
}

/* ---- Lost-password confirmation notice — matches the card above ---- */

body.woocommerce-lost-password .woocommerce-notices-wrapper {
	max-width: 380px;
	margin: 70px auto 0;
	padding: 0 24px;
}

body.woocommerce-lost-password .woocommerce-message,
body.woocommerce-lost-password .woocommerce-error {
	background: var(--bg-surface);
	border: 1px solid var(--gold-border);
	border-radius: var(--radius-lg);
	padding: 20px 22px;
	text-align: center;
	font-size: 13px;
	line-height: 1.9;
	color: var(--text-primary);
	list-style: none;
	margin: 0 0 8px;
}

body.woocommerce-lost-password .woocommerce-message::before,
body.woocommerce-lost-password .woocommerce-error::before {
	display: none;
}
