/* Page-specific styles — shared theme lives in common.css */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

button, input { font: inherit; }
.login-page {
  width: 100%;
  min-height: 100dvh;
  max-width: var(--page-max);
  margin: 0 auto;
  padding:
    max(16px, env(safe-area-inset-top))
    20px
    max(22px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

/* Header */

.topbar {
  height: 52px;
  display: flex;
  align-items: center;
}

.back-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 20px;
}

/* Main */

.login-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 0 0 15px;
  transform: translateY(-20px);
}

/* ------------------------------------------------------------
   ویدیوی مسکات این صفحه فعلاً غیرفعال است (تصمیم کاربر).
   این رول مال قاب ویدیو بود؛ تا وقتی ویدیو برنگشته لازم نیست،
   اما برای فعال‌سازی دوباره نگه داشته شده:

.hero {
  width: 100%;
  position: relative;
  margin-bottom: 16px;
}
   ------------------------------------------------------------ */

/* ------------------------------------------------------------
   هدر جدید (بدون ویدیو): نشان مسکات + خوش‌آمدگویی
   ------------------------------------------------------------ */

.login-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  margin-bottom: 20px;
}

.login-logo {
  width: 200px;
  height: auto;
  margin-bottom: 2px;
  animation: loginHeroBadgeIn 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}

.login-hero p {
  font-size: 12.5px;
  color: var(--text-soft);
  transform: translateY(-20px);
}

@keyframes loginHeroBadgeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------------------
   کارت شیشه‌ای فرم ورود
   ------------------------------------------------------------ */

.login-card {
  padding: 24px 20px;

  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  box-shadow:
    0 20px 50px rgba(36, 33, 55, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);

  animation: loginCardIn 0.3s ease both;
  animation-delay: 0.05s;
}
.login-card {
  position: relative;
  top: -20px;
}

@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .login-logo,
  .login-card {
    animation: none;
  }
}

/* Heading */


/* Form */

.login-form {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label,
.label-row label {
  font-size: 12px;
  font-weight: 600;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.label-row a {
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
}

.input-wrap {
  height: 51px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  transition: .2s ease;
}

.login-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 12px;
  background: #FDEAEA;
  color: #C23E3E;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.7;
  border: 1px solid rgba(243, 93, 93, 0.25);
  animation: loginErrorIn 0.22s ease;
}

.login-error[hidden] {
  display: none !important;
}

.login-error .error-icon {
  flex-shrink: 0;
  font-size: 14px;
  margin-top: 1px;
}

@keyframes loginErrorIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes loginShake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

.login-form.shake {
  animation: loginShake 0.4s ease;
}

.input-wrap.field-error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(243, 93, 93, 0.12);
}

.input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(77,125,230,.08);
}

@media (prefers-reduced-motion: reduce) {
  .login-error,
  .login-form.shake {
    animation: none;
  }
}

.input-icon {
  color: #9994a7;
  font-size: 17px;
}

.input-wrap input {
  width: 100%;
  height: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.input-wrap input::placeholder {
  color: #aaa6b5;
}

.password-toggle {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: #9994a7;
  cursor: pointer;
  transition: color 0.15s ease;
}

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

.password-toggle .ic-eye-off {
  display: none;
}

.password-toggle.is-visible {
  color: var(--primary);
}

.password-toggle.is-visible .ic-eye {
  display: none;
}

.password-toggle.is-visible .ic-eye-off {
  display: block;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.remember {
  display: flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 500;
}

.remember input {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  accent-color: var(--primary);
  cursor: pointer;
}

.forgot-password-link {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.forgot-password-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.login-button {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 14px;
  background: var(--primary);
  color: white;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 8px 18px rgba(77,125,230,.22);
  transition: .2s ease;
}

.login-button:active {
  transform: scale(.985);
}

.signup-link {
  margin-top: 21px;
  text-align: center;
  color: var(--text-soft);
  font-size: 12px;
}

.signup-link a {
  color: var(--primary);
  font-weight: 700;
  margin-right: 4px;
}

/* Gamification accents */

.bottom-decoration {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 5px;
}

.badge {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  background: white;
  border: 1px solid var(--border);
}

.badge-purple { color: var(--primary); }
.badge-yellow { color: #9a6a0b; background: var(--accent-soft); }
.badge-green { color: #4f7f22; background: var(--secondary-soft); }

/* Very small phones */

@media (max-height: 700px) {
  .login-logo {
    width: 130px;
  }

  .login-hero {
    margin-bottom: 12px;
  }

  .login-form {
    gap: 12px;
  }

  .input-wrap,
  .login-button {
    height: 47px;
  }
}

/* ===== Desktop improvements ===== */
@media (min-width: 768px) {
  .login-page {
    max-width: var(--page-max);
    padding-top: 28px;
    padding-bottom: 32px;
  }

  .topbar {
    height: 56px;
    margin-bottom: 8px;
  }

  .login-hero {
    margin-bottom: 24px;
  }

  .login-form {
    gap: 16px;
  }

  .field label {
    font-size: 13.5px;
  }

  .input-wrap {
    height: 54px;
    border-radius: 14px;
  }

  .input-wrap input {
    font-size: 14.5px;
  }

  .login-button {
    height: 54px;
    font-size: 15px;
    border-radius: 15px;
  }

  .signup-link {
    margin-top: 24px;
    font-size: 13.5px;
  }
}

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

  

}

.login-page {
  position: relative;
  overflow: hidden;
}

.login-page > *:not(.bg-orb) {
  position: relative;
  z-index: 2;
}

.orb-3 {
  width: 130px;
  height: 130px;
  background: var(--accent);
  top: 42%;
  right: -40px;
  opacity: 0.22;
  animation: orb-float 13s ease-in-out infinite;
}

/* Enhanced animations */


@keyframes orb-float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(12px, -10px); }
}

