/* ═══════════════════════════════════════════════════════════
   Login — Premium SaaS 2026 (scoped to .lux-login only)
   ═══════════════════════════════════════════════════════════ */

.lux-login {
  --lux-bg: #FAFBFD;
  --lux-navy: #0F172A;
  --lux-navy-hover: #1E293B;
  --lux-gold: #C8A96B;
  --lux-white: #FFFFFF;
  --lux-border: #E8D8B5;
  --lux-text: #111827;
  --lux-muted: #6B7280;
  --lux-secure: #8A94A6;
  --lux-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --lux-shadow-card: 0 20px 60px rgba(15, 23, 42, 0.08);
  --lux-shadow-focus: 0 0 0 4px rgba(200, 169, 107, 0.12);

  font-family: "Vazirmatn", "IRANSansX", "IRANSans", "Segoe UI", system-ui, sans-serif;
  background: var(--lux-bg);
  color: var(--lux-text);
  min-height: 100dvh;
  min-height: 100svh;
  overflow-x: hidden;
  position: relative;
  box-sizing: border-box;
}

.lux-login *,
.lux-login *::before,
.lux-login *::after {
  box-sizing: border-box;
}

@keyframes lux-fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes lux-step-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Subtle background shapes (< 4% opacity) ── */
.lux-bg-shape {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
}

.lux-bg-shape--1 {
  width: 280px;
  height: 280px;
  top: -80px;
  left: -60px;
  background: radial-gradient(circle, rgba(200, 169, 107, 0.035) 0%, transparent 70%);
}

.lux-bg-shape--2 {
  width: 220px;
  height: 220px;
  bottom: 12%;
  right: -50px;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.03) 0%, transparent 72%);
}

.lux-bg-shape--3 {
  width: 160px;
  height: 160px;
  top: 42%;
  left: 8%;
  background: rgba(200, 169, 107, 0.025);
}

/* ── Page layout (mobile-first column) ── */
.lux-page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
  min-height: 100dvh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ── Hero + Card unified stack ── */
.lux-hero-stack {
  position: relative;
  flex-shrink: 0;
  width: 100%;
}

/* ── Top hero ── */
.lux-top-hero {
  position: relative;
  flex-shrink: 0;
  margin-bottom: 0;
  animation: lux-fade-up 500ms var(--lux-ease) both;
}

.lux-top-hero__media {
  position: relative;
  width: 100%;
  height: clamp(380px, 42vh, 430px);
  border-radius: 0 0 48px 48px;
  overflow: hidden;
  isolation: isolate;
}

.lux-top-hero__photo {
  position: absolute;
  top: 0;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translateX(-50%);
  z-index: 1;
  display: block;
  object-fit: cover;
  object-position: center 18%;
}

.lux-top-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    180deg,
    rgba(250, 251, 253, 0.2) 0%,
    rgba(250, 251, 253, 0) 32%,
    rgba(15, 23, 42, 0.1) 58%,
    rgba(15, 23, 42, 0.28) 100%
  );
  pointer-events: none;
}

.lux-top-hero__wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 90px;
  display: block;
  pointer-events: none;
  z-index: 3;
}

.lux-top-hero__brand {
  position: absolute;
  top: calc(20px + env(safe-area-inset-top, 0));
  left: 0;
  right: 0;
  z-index: 4;
  text-align: center;
  padding: 0 24px;
  animation: lux-fade-up 500ms var(--lux-ease) 0.08s both;
}

.lux-top-hero__brand .lux-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  display: block;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.18));
}

.lux-top-hero__brand h1 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  line-height: 1.45;
}

.lux-top-hero__brand p {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  color: #FFFFFF;
  line-height: 1.55;
}

/* ── Login card (rides on wave) ── */
.lux-card-wrap {
  position: relative;
  z-index: 5;
  width: 92%;
  max-width: 100%;
  margin: -65px auto 0;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0));
  flex-shrink: 0;
  animation: lux-fade-up 500ms var(--lux-ease) 0.12s both;
}

.lux-login-card {
  background: #FFFFFF;
  border-radius: 32px;
  padding: 36px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
  border: none;
  width: 100%;
}

.lux-card-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: -8px -4px 12px;
  padding: 6px 8px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--lux-muted);
  font-family: Vazirmatn, inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: color 150ms var(--lux-ease), background 150ms var(--lux-ease);
}

.lux-card-back svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.lux-card-back:hover {
  color: var(--lux-navy);
  background: rgba(15, 23, 42, 0.04);
}

.lux-card-back:focus-visible {
  outline: 2px solid rgba(200, 169, 107, 0.55);
  outline-offset: 2px;
}

.lux-card-head {
  text-align: center;
  margin-bottom: 20px;
}

.lux-card-head__title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--lux-text);
  line-height: 1.35;
  text-align: center;
}

.lux-card-head__subtitle {
  margin: 0 auto;
  max-width: 280px;
  font-size: 14px;
  font-weight: 400;
  color: var(--lux-muted);
  line-height: 1.55;
  text-align: center;
}

/* ── Form steps ── */
.lux-form__step {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.lux-form__step--hidden {
  display: none;
}

.lux-form__step--active {
  animation: lux-step-in 500ms var(--lux-ease) both;
}

.lux-form__head {
  margin-bottom: 18px;
  text-align: center;
}

.lux-form__title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  color: var(--lux-text);
}

.lux-form__subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--lux-muted);
  line-height: 1.5;
}

.lux-form__field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--lux-muted);
  margin-bottom: 8px;
}

.lux-field {
  animation: lux-fade-up 500ms var(--lux-ease) both;
}

.lux-field--1 { animation-delay: 0.16s; }
.lux-field--2 { animation-delay: 0.22s; }
.lux-field--3 { animation-delay: 0.28s; }
.lux-field--4 { animation-delay: 0.34s; }
.lux-field--5 { animation-delay: 0.4s; }
.lux-field--6 { animation-delay: 0.46s; }
.lux-field--7 { animation-delay: 0.52s; }
.lux-field--8 { animation-delay: 0.58s; }

.lux-field + .lux-field,
.lux-input-wrap + .lux-field {
  margin-top: 14px;
}

.lux-phone-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--lux-bg);
  border: 1.5px solid var(--lux-border);
}

.lux-phone-display__num {
  font-size: 15px;
  font-weight: 600;
  color: var(--lux-navy);
  direction: ltr;
  text-align: right;
}

.lux-phone-display__change {
  font-size: 13px;
  font-weight: 600;
  color: var(--lux-gold);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  font-family: inherit;
  transition: color 300ms var(--lux-ease);
}

.lux-phone-display__change:hover {
  color: var(--lux-navy);
}

/* ── Inputs ── */
.lux-input-wrap {
  position: relative;
}

.lux-input-wrap .lux-input-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  pointer-events: none;
  z-index: 1;
}

.lux-input-wrap .lux-input-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.lux-input {
  width: 100%;
  height: 64px;
  padding: 20px 52px 20px 20px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--lux-text);
  background: var(--lux-white);
  border: 1.5px solid var(--lux-border);
  border-radius: 18px;
  direction: ltr;
  text-align: start;
  transition:
    border-color 300ms var(--lux-ease),
    box-shadow 300ms var(--lux-ease),
    transform 300ms var(--lux-ease);
}

.lux-input:focus {
  outline: none;
  border-color: var(--lux-gold);
  box-shadow: var(--lux-shadow-focus);
}

.lux-input::placeholder {
  color: #C4C4C4;
  font-weight: 400;
}

.lux-input--text {
  direction: rtl;
  text-align: right;
  letter-spacing: normal;
}

.lux-input--select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 16px center;
  padding-left: 40px;
  cursor: pointer;
}

.lux-input--select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background-color: var(--lux-bg);
}

.lux-form__optional {
  font-size: 11px;
  font-weight: 500;
  color: var(--lux-muted);
}

.lux-input-wrap--password .lux-input {
  padding-left: 52px;
}

.lux-password-toggle {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lux-muted);
  border-radius: 10px;
  padding: 0;
  z-index: 2;
  transition:
    color 200ms var(--lux-ease),
    background 200ms var(--lux-ease);
}

.lux-password-toggle:hover {
  color: var(--lux-gold);
  background: rgba(200, 169, 107, 0.1);
}

.lux-password-toggle:focus-visible {
  outline: none;
  box-shadow: var(--lux-shadow-focus);
}

.lux-password-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* ── Buttons ── */
.lux-btn {
  width: 100%;
  height: 64px;
  margin-top: 16px;
  border: none;
  border-radius: 18px;
  background: var(--lux-navy);
  color: var(--lux-white);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition:
    background 300ms var(--lux-ease),
    transform 300ms var(--lux-ease),
    box-shadow 300ms var(--lux-ease);
}

.lux-btn:hover:not(:disabled) {
  background: var(--lux-navy-hover);
  transform: scale(1.02);
}

.lux-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.lux-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.lux-btn--ghost {
  background: var(--lux-white);
  color: var(--lux-text);
  border: 1.5px solid var(--lux-border);
  box-shadow: none;
}

.lux-btn--ghost:hover:not(:disabled) {
  background: var(--lux-white);
  border-color: var(--lux-gold);
  color: var(--lux-navy);
}

/* ── Registration wizard ── */
.lux-reg-progress {
  margin-bottom: 18px;
  animation: lux-fade-up 400ms var(--lux-ease) both;
}

.lux-reg-progress__track {
  height: 5px;
  background: rgba(232, 216, 181, 0.45);
  border-radius: 999px;
  overflow: hidden;
}

.lux-reg-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--lux-gold), #d4b87a);
  border-radius: 999px;
  transition: width 450ms var(--lux-ease);
}

.lux-reg-progress__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--lux-muted);
}

.lux-reg-progress__count {
  font-weight: 600;
  color: var(--lux-navy);
}

.lux-reg-progress__label {
  text-align: right;
}

.lux-reg-progress__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.lux-reg-progress__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #E5E7EB;
  transition:
    background 300ms var(--lux-ease),
    transform 300ms var(--lux-ease);
}

.lux-reg-progress__dot.is-active {
  background: var(--lux-gold);
  transform: scale(1.2);
}

.lux-reg-progress__dot.is-done {
  background: var(--lux-gold);
  opacity: 0.5;
}

.lux-reg-panel {
  display: none;
}

.lux-reg-panel--active {
  display: flex;
  flex-direction: column;
  animation: lux-step-in 450ms var(--lux-ease) both;
}

.lux-reg-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.lux-reg-actions .lux-btn {
  margin-top: 0;
  flex: 1;
  min-width: 0;
}


/* ── PWA: subtle login link ── */
.lux-install-link {
  margin-top: 16px;
  text-align: center;
}

.lux-install-link__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 11px 14px;
  border: 1px dashed rgba(200, 169, 107, 0.55);
  border-radius: 12px;
  background: rgba(200, 169, 107, 0.08);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #9a7b42;
  cursor: pointer;
  transition: background 180ms var(--lux-ease), border-color 180ms var(--lux-ease);
}

.lux-install-link__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(200, 169, 107, 0.16);
  flex-shrink: 0;
}

.lux-install-link__svg {
  width: 18px;
  height: 18px;
  stroke: #9a7b42;
}

.lux-install-link__btn:hover {
  background: rgba(200, 169, 107, 0.14);
  border-color: var(--lux-gold);
  color: #7a6235;
}

/* ── PWA bottom sheet ── */
.pwa-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  transition: opacity 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.pwa-sheet-overlay--visible {
  opacity: 1;
}

.pwa-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 85dvh;
  overflow-y: auto;
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom, 0));
  border-radius: 20px 20px 0 0;
  background: #fff;
  font-family: "Vazirmatn", "IRANSansX", system-ui, sans-serif;
  transform: translateY(100%);
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.pwa-sheet-overlay--visible .pwa-sheet {
  transform: translateY(0);
}

.pwa-sheet__handle {
  width: 36px;
  height: 4px;
  margin: 4px auto 16px;
  border-radius: 99px;
  background: #e2e8f0;
}

.pwa-sheet__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  text-align: right;
}

.pwa-sheet__icon {
  border-radius: 12px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
}

.pwa-sheet__head h3 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}

.pwa-sheet__head p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: #6b7280;
}

.pwa-sheet__install {
  width: 100%;
  margin-bottom: 16px;
}

.pwa-sheet__steps-label {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  text-align: right;
}

.pwa-sheet__steps {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pwa-sheet__step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e8edf3;
}

.pwa-sheet__step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0f172a;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.pwa-sheet__step-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
  min-width: 0;
}

.pwa-sheet__step-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
}

.pwa-sheet__step-text {
  font-size: 13px;
  line-height: 1.6;
  color: #4b5563;
}

.pwa-sheet__steps li {
  font-size: 14px;
  line-height: 1.65;
  color: #111827;
}

.pwa-sheet__note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef9ee;
  font-size: 12.5px;
  line-height: 1.55;
  color: #92400e;
  text-align: right;
}

.pwa-sheet__done {
  display: block;
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 12px;
  background: #0f172a;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.pwa-sheet__done:hover {
  background: #1e293b;
}

@media (min-width: 640px) {
  .pwa-sheet-overlay {
    align-items: center;
    padding: 20px;
  }

  .pwa-sheet {
    border-radius: 20px;
    max-height: 80vh;
    transform: translateY(24px) scale(0.97);
    opacity: 0;
    transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), opacity 280ms ease;
  }

  .pwa-sheet-overlay--visible .pwa-sheet {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  .pwa-sheet__handle {
    display: none;
  }
}

/* ── Security note (inside card) ── */
.lux-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 13px;
  color: var(--lux-secure);
  line-height: 1.45;
  animation: lux-fade-up 500ms var(--lux-ease) 0.32s both;
}

.lux-secure__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(138, 148, 166, 0.12);
  flex-shrink: 0;
}

.lux-secure svg,
.lux-secure__svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: var(--lux-secure);
}

/* ── Register flow ── */
.lux-login--register .lux-login-card {
  padding-bottom: 28px;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .lux-top-hero,
  .lux-top-hero__brand,
  .lux-card-wrap,
  .lux-field,
  .lux-secure,
  .lux-install-link,
  .lux-form__step--active,
  .lux-reg-panel--active,
  .lux-reg-progress__fill,
  .lux-btn:hover:not(:disabled) {
    animation: none !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ── Responsive ── */
@media (max-width: 360px) {
  .lux-page {
    padding: 0 12px;
  }

  .lux-card-wrap {
    width: 94%;
  }

  .lux-login-card {
    padding: 28px 24px;
  }
}

@media (min-width: 640px) {
  .lux-login {
    display: flex;
    justify-content: center;
  }

  .lux-page {
    max-width: 480px;
    padding: 0 20px;
  }

  .lux-top-hero__media {
    height: 430px;
  }

  .lux-top-hero__brand h1 {
    font-size: 22px;
  }
}

@media (min-width: 1024px) {
  .lux-page {
    max-width: 480px;
  }
}
