* { box-sizing: border-box; }
html {
  min-width: 0;
  min-height: 100%;
  overflow: auto;
  -webkit-text-size-adjust: 100%;
}
body.login-body {
  min-width: 0;
  width: 100%;
  min-height: 100dvh;
  margin: 0;
  overflow: auto;
  font-family: "Vazirmatn", sans-serif;
  color: #35243d;
  background:
    radial-gradient(circle at 12% 18%, rgba(142, 68, 173, .18), transparent 34%),
    radial-gradient(circle at 88% 84%, rgba(119, 24, 126, .12), transparent 31%),
    linear-gradient(145deg, #fbf5ff, #f2e2f8);
}
.login-main {
  width: 100%;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(14px, 4vw, 38px);
}
.login-main-container {
  width: min(100%, 470px);
  min-width: 0;
  padding: clamp(20px, 5vw, 38px);
  border: 1px solid rgba(119, 24, 126, .16);
  border-radius: clamp(22px, 4vw, 34px);
  background: rgba(255, 255, 255, .95);
  box-shadow: 0 26px 70px rgba(72, 23, 82, .2);
  backdrop-filter: blur(12px);
}
.login-main-title {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-bottom: clamp(22px, 5vw, 32px);
  text-align: center;
}
.login-main-title img {
  display: block;
  width: min(210px, 68%);
  max-height: 94px;
  object-fit: contain;
  filter: drop-shadow(0 7px 13px rgba(88, 50, 102, .16));
}
.login-main-title h1 {
  margin: 0;
  color: #4a1d6d;
  font-size: clamp(1.18rem, 4vw, 1.7rem);
  line-height: 1.55;
  font-weight: 900;
}
.login-main-body,
.login-main-form { width: 100%; min-width: 0; }
.login-main-form {
  display: grid;
  gap: 16px;
}
.login-form-field,
.login-form-username,
.login-form-password {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.login-form-field > label,
.login-form-username > label:first-child,
.login-form-password > label:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #4a1d6d;
  font-size: .92rem;
  font-weight: 800;
}
.login-form-field > label i { width: 18px; text-align: center; }
.form-control {
  width: 100%;
  min-width: 0;
  min-height: 49px;
  padding: 11px 14px;
  border: 1.5px solid #e4d2e8;
  border-radius: 14px;
  outline: 0;
  background: #fff;
  color: #302337;
  font: inherit;
  font-size: .95rem;
  text-align: right;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.form-control:hover { border-color: #c9a8d1; }
.form-control:focus {
  border-color: #8e44ad;
  box-shadow: 0 0 0 4px rgba(142, 68, 173, .13);
  background: #fff;
}
.login-password-control { position: relative; min-width: 0; }
.login-password-control .form-control { padding-left: 54px; }
.login-password-toggle {
  position: absolute;
  left: 6px;
  top: 50%;
  width: 40px;
  height: 38px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: #f5eaf7;
  color: #77187e;
  cursor: pointer;
  transition: .2s ease;
}
.login-password-toggle:hover,
.login-password-toggle[aria-pressed="true"] { background: #77187e; color: #fff; }
.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 2px 1px;
}
.login-check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #51395a;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.login-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.login-check-box {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #c9a8d1;
  border-radius: 7px;
  background: #fff;
  color: transparent;
  transition: .2s ease;
}
.login-check-box i { font-size: .72rem; }
.login-check input:checked + .login-check-box {
  border-color: #77187e;
  background: #77187e;
  color: #fff;
  box-shadow: 0 4px 12px rgba(119, 24, 126, .22);
}
.login-check input:focus-visible + .login-check-box { box-shadow: 0 0 0 4px rgba(119, 24, 126, .14); }
.submit-btn {
  width: 100%;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 2px;
  padding: 11px 18px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, #8e44ad, #641f76);
  color: #fff;
  box-shadow: 0 10px 22px rgba(103, 38, 119, .25);
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.submit-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(103, 38, 119, .3); filter: saturate(1.08); }
.submit-btn:active { transform: translateY(0); }
.login-continue { margin-top: 18px; }
.login-error-box {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid #f4bfc5;
  border-radius: 13px;
  background: #fff4f5;
  color: #a61b2b;
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.8;
  text-align: center;
  overflow-wrap: anywhere;
}
.password-requirements {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px dashed #ddc5e3;
  border-radius: 13px;
  background: #fdf9fe;
  color: #6c5572;
  font-size: .8rem;
}
.password-requirements span { display: flex; align-items: center; gap: 7px; min-width: 0; }
.password-requirements span i { color: #b7a5bc; font-size: .68rem; }
.password-requirements span.valid { color: #23743a; }
.password-requirements span.valid i { color: #2e934b; }
.login-main-card {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(119, 24, 126, .16);
  border-radius: 22px;
  background: linear-gradient(145deg, #fff, #faf2fc);
  box-shadow: 0 14px 35px rgba(88, 50, 102, .13);
}
.login-main-card-photo,
.login-main-card-photo .user-avatar-wrapper {
  width: 94px;
  height: 94px;
  display: inline-flex;
  flex: 0 0 auto;
}
.login-main-card-img {
  width: 94px;
  height: 94px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  object-fit: cover;
  border: 3px solid #d6b6dd;
  border-radius: 50%;
  background: #fff;
  color: #77187e;
  overflow: hidden;
}
.login-main-card-img.user-avatar-fallback i { font-size: 2rem; }
.login-main-card-texts {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: right;
}
.login-main-card-welcome-text {
  color: #806887;
  font-size: .84rem;
  font-weight: 700;
}
.login-main-card-name-text {
  width: 100%;
  color: #4a1d6d;
  font-size: clamp(1.08rem, 4vw, 1.38rem);
  font-weight: 900;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.login-main-card-rank-text {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 5px 11px;
  border-radius: 999px;
  background: #ead9ef;
  color: #642271;
  font-size: .78rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.user-avatar-wrapper { display: inline-flex; }
.user-avatar-fallback { display: inline-flex; align-items: center; justify-content: center; }
.user-avatar-fallback[hidden] { display: none !important; }
@media (max-width: 520px) {
  .login-main { place-items: start center; padding: 10px; }
  .login-main-container { padding: 20px 14px; border-radius: 20px; }
  .login-main-title img { width: min(190px, 72%); }
  .login-options { align-items: flex-start; flex-direction: column; }
  .login-main-card { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .login-main-card-texts { align-items: center; text-align: center; width: 100%; }
  .password-requirements { grid-template-columns: 1fr; }
}
@media (max-height: 650px) {
  .login-main { place-items: start center; padding-block: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
