/* MyLife auth redesign v2 — atmospheric sage, brand-first */
body.ml-auth-skin {
  --ml-ink: #102820;
  --ml-muted: #4f675e;
  --ml-accent: #187560;
  --ml-accent-deep: #0b3f34;
  --ml-accent-soft: #cfe8de;
  --ml-line: rgba(16, 40, 32, 0.11);
  --ml-surface: rgba(255, 255, 255, 0.72);
  --ml-field: #ffffff;
  --ml-radius: 1.5rem;
}

body.ml-auth-skin #root > div.min-h-screen {
  align-items: flex-start !important;
  justify-content: center !important;
  min-height: 100dvh !important;
  padding:
    max(1.1rem, env(safe-area-inset-top))
    1rem
    max(2rem, env(safe-area-inset-bottom)) !important;
  background-color: #c9dbd3 !important;
  background-image:
    radial-gradient(ellipse 100% 70% at 0% 0%, #9fc4b4 0%, transparent 55%),
    radial-gradient(ellipse 80% 60% at 100% 10%, #7eaa9a 0%, transparent 50%),
    radial-gradient(ellipse 70% 50% at 50% 110%, #b7d2c6 0%, transparent 55%),
    linear-gradient(165deg, #dce9e2 0%, #c5d8cf 48%, #aec9bd 100%) !important;
  overflow-x: hidden;
}

body.ml-auth-skin #root > div.min-h-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  background-image:
    radial-gradient(circle at 18% 28%, rgba(255, 255, 255, 0.35) 0 2px, transparent 3px),
    radial-gradient(circle at 72% 18%, rgba(255, 255, 255, 0.28) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 44% 76%, rgba(16, 40, 32, 0.08) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 88% 62%, rgba(255, 255, 255, 0.22) 0 2px, transparent 3px);
  background-size: 120px 120px, 160px 160px, 100px 100px, 140px 140px;
  animation: mlAuthDrift 28s linear infinite;
}

body.ml-auth-skin #root > div.min-h-screen::after {
  content: "";
  position: fixed;
  width: min(70vw, 28rem);
  height: min(70vw, 28rem);
  right: -18%;
  top: -12%;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, transparent 68%);
  filter: blur(2px);
}

@keyframes mlAuthDrift {
  from { background-position: 0 0, 0 0, 0 0, 0 0; }
  to { background-position: 120px 80px, -80px 40px, 40px -60px, -50px 90px; }
}

body.ml-auth-skin .ml-auth-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 24.5rem;
  margin: 0.25rem auto 0;
  animation: mlAuthRise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes mlAuthRise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* Brand hero */
body.ml-auth-skin .ml-auth-brand {
  text-align: center;
  margin: 0 0 1.1rem;
  padding: 0.35rem 0.4rem 0.15rem;
  position: relative;
}

body.ml-auth-skin .ml-auth-brand::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 42%;
  width: 7.5rem;
  height: 7.5rem;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55) 0%, transparent 70%);
  z-index: -1;
  animation: mlAuthGlow 4.5s ease-in-out infinite;
}

@keyframes mlAuthGlow {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.85; }
  50% { transform: translate(-50%, -50%) scale(1.12); opacity: 1; }
}

body.ml-auth-skin .ml-auth-brand-fa {
  margin: 0;
  font-family: "Vazirmatn", sans-serif;
  font-weight: 900;
  font-size: clamp(2.6rem, 9.5vw, 3.35rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: linear-gradient(125deg, #0b3f34 10%, #187560 55%, #0f5a48 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: mlAuthBrandIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.ml-auth-skin .ml-auth-brand-en {
  margin: 0.35rem 0 0;
  font-family: "Vazirmatn", sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ml-muted);
}

body.ml-auth-skin .ml-auth-tagline {
  margin: 0.7rem auto 0;
  max-width: 16.5rem;
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.7;
  color: var(--ml-ink);
  opacity: 0.72;
  animation: mlAuthRise 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

@keyframes mlAuthBrandIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* Interaction panel — quieter than old indigo card */
body.ml-auth-skin .ml-auth-card {
  background: var(--ml-surface) !important;
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.78) !important;
  border-radius: var(--ml-radius) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 24px 48px -30px rgba(11, 63, 52, 0.45) !important;
  padding: 1.15rem 1.15rem 1.35rem !important;
  width: 100% !important;
  max-width: 24.5rem !important;
}

body.ml-auth-skin .ml-auth-card .ml-auth-old-hero,
body.ml-auth-skin .ml-auth-card > div.bg-gradient-to-br,
body.ml-auth-skin .ml-auth-card > div[class*="from-indigo"] {
  display: none !important;
}

/* Tabs — underline rail */
body.ml-auth-skin .ml-auth-tabs {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 0 1.2rem !important;
  border-bottom: 1px solid var(--ml-line) !important;
  box-shadow: none !important;
}

body.ml-auth-skin .ml-auth-tabs > button {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  color: var(--ml-muted) !important;
  font-weight: 600 !important;
  padding: 0.8rem 0.4rem !important;
  position: relative;
  transition: color 0.2s ease;
}

body.ml-auth-skin .ml-auth-tabs > button.ml-auth-tab-active,
body.ml-auth-skin .ml-auth-tabs > button.bg-white,
body.ml-auth-skin .ml-auth-tabs > button.text-indigo-600,
body.ml-auth-skin .ml-auth-tabs > button[class*="shadow-md"] {
  color: var(--ml-accent-deep) !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.ml-auth-skin .ml-auth-tabs > button.ml-auth-tab-active::after,
body.ml-auth-skin .ml-auth-tabs > button.bg-white::after,
body.ml-auth-skin .ml-auth-tabs > button.text-indigo-600::after,
body.ml-auth-skin .ml-auth-tabs > button[class*="shadow-md"]::after {
  content: "";
  position: absolute;
  right: 22%;
  left: 22%;
  bottom: -1px;
  height: 2.5px;
  border-radius: 999px;
  background: var(--ml-accent);
}

/* Fields */
body.ml-auth-skin .ml-auth-card input[name="phone"],
body.ml-auth-skin .ml-auth-card input[name="password"],
body.ml-auth-skin .ml-auth-card input[name="firstName"],
body.ml-auth-skin .ml-auth-card input[name="lastName"],
body.ml-auth-skin .ml-auth-card input[placeholder="شماره تماس"],
body.ml-auth-skin .ml-auth-card input[placeholder="رمز عبور"],
body.ml-auth-skin .ml-auth-card input[placeholder="نام"],
body.ml-auth-skin .ml-auth-card input[placeholder="نام خانوادگی"] {
  background: var(--ml-field) !important;
  border: 1px solid var(--ml-line) !important;
  border-radius: 1rem !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) !important;
  color: var(--ml-ink) !important;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

body.ml-auth-skin .ml-auth-card input:focus {
  outline: none !important;
  border-color: rgba(24, 117, 96, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(24, 117, 96, 0.16) !important;
  --tw-ring-color: transparent !important;
  --tw-ring-shadow: 0 0 #0000 !important;
}

body.ml-auth-skin .ml-auth-card button[type="submit"] {
  background: linear-gradient(145deg, #1b8a70 0%, #0b3f34 100%) !important;
  border-radius: 1rem !important;
  box-shadow: 0 12px 26px -14px rgba(11, 63, 52, 0.85) !important;
  font-weight: 800 !important;
  margin-top: 0.35rem;
  transition: transform 0.15s ease, filter 0.15s ease;
}

body.ml-auth-skin .ml-auth-card button[type="submit"]:hover {
  filter: brightness(1.06);
}

body.ml-auth-skin .ml-auth-card button[type="submit"]:active {
  transform: translateY(1px);
}

body.ml-auth-skin .ml-auth-extra a,
body.ml-auth-skin .ml-auth-extra button {
  color: var(--ml-accent-deep) !important;
  font-weight: 600;
}

body.ml-auth-skin .ml-auth-card p.text-center.text-gray-400 {
  color: var(--ml-muted) !important;
  margin-top: 1.15rem !important;
}

body.ml-auth-skin .ml-terms-link {
  color: var(--ml-accent-deep) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.ml-auth-skin .ml-pw-toggle {
  color: var(--ml-muted) !important;
}

@media (min-width: 768px) {
  body.ml-auth-skin #root > div.min-h-screen {
    padding-top: 2.75rem !important;
  }

  body.ml-auth-skin .ml-auth-shell {
    max-width: 26rem;
  }

  body.ml-auth-skin .ml-auth-card {
    padding: 1.45rem 1.45rem 1.6rem !important;
  }
}

body:not(.ml-auth-skin) .ml-auth-brand {
  display: none !important;
}
