/* ------------------------------------------------
   صندوق پس‌انداز نوید | SPN
   فایل استایل صفحه ورود
------------------------------------------------ */

:root {
  --primary: #0f5b52;
  --primary-dark: #073d3e;
  --primary-light: #eaf4f1;
  --accent: #c6a15b;

  --text: #1e2a2a;
  --muted: #657373;
  --border: #dce5e2;

  --page-bg: #f4f7f5;
  --card-bg: #ffffff;

  --shadow-soft: 0 12px 30px rgba(13, 46, 44, 0.08);
  --shadow-card: 0 18px 42px rgba(13, 46, 44, 0.12);

  --radius-large: 24px;
  --radius-medium: 16px;
  --radius-small: 12px;
}

/* تنظیمات پایه */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  direction: rtl;
  color: var(--text);
  background: var(--page-bg);
  font-family: Vazirmatn, Tahoma, Arial, sans-serif;
}

button,
input {
  font-family: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.page-wrapper {
  width: min(100%, 1440px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 0 45px rgba(0, 0, 0, 0.04);
}

/* ------------------------------------------------
   Header
------------------------------------------------ */

.site-header {
  min-height: 90px;
  padding: 1rem clamp(1rem, 4vw, 4rem);

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;

  border-bottom: 1px solid #e8eeeb;
  background: rgba(255, 255, 255, 0.96);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-mark {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;

  display: flex;
  align-items: center;
  justify-content: center;

  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 16px;

  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.8px;

  box-shadow: 0 8px 18px rgba(15, 91, 82, 0.22);
}

.brand-text h1 {
  margin: 0;
  color: var(--primary-dark);
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  font-weight: 800;
}

.brand-text p {
  margin: 0.28rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;

  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 600;
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;

  border-radius: 50%;
  background: #3f9c74;
  box-shadow: 0 0 0 4px rgba(63, 156, 116, 0.12);
}

/* ------------------------------------------------
   Family Image Section
------------------------------------------------ */
/* ------------------------------------------------
   Family Image Section
   عکس بزرگ و کامل، بدون Crop
------------------------------------------------ */

.family-section {
  position: relative;
  min-height: min(78vh, 820px);
  padding: clamp(1rem, 2.8vw, 2.5rem);
  overflow: hidden;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  background: #083d3d;
  isolation: isolate;
}

/*
  پس‌زمینه از همان تصویر ساخته می‌شود.
  این لایه به‌صورت cover است، اما فقط برای ایجاد فضای
  پس‌زمینه است؛ تصویر اصلی روی آن بدون برش نمایش داده می‌شود.
*/
.family-blur-bg {
  position: absolute;
  inset: -36px;
  z-index: -2;

  background: url("pic.webp") center / cover no-repeat;
  filter: blur(22px) brightness(0.52) saturate(0.75);
  transform: scale(1.08);
}

/* لایه رنگی هماهنگ با برند */
.family-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;

  background:
    linear-gradient(
      135deg,
      rgba(5, 48, 49, 0.72) 0%,
      rgba(15, 91, 82, 0.42) 56%,
      rgba(7, 61, 62, 0.64) 100%
    );
}

.family-stage {
  width: 100%;
  height: min(65vh, 690px);

  display: flex;
  align-items: center;
  justify-content: center;
}

/*
  اصل طراحی:
  object-fit: contain یعنی کل تصویر، بدون کوچک‌ترین برش
  نمایش داده می‌شود؛ اما با ارتفاع Hero بزرگ خواهد شد.
*/
.family-image {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: contain;
  object-position: center;

  border-radius: clamp(12px, 1.4vw, 22px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.32);

  filter: contrast(1.035) saturate(0.96) brightness(1.01);
}

.family-caption {
  position: relative;
  z-index: 1;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;

  margin-top: 1rem;
  color: #ffffff;

  font-size: clamp(0.85rem, 1.2vw, 1rem);
  font-weight: 700;
  text-align: center;

  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
}

.family-caption p {
  margin: 0;
}

.caption-line {
  width: 42px;
  height: 2px;
  flex: 0 0 42px;

  border-radius: 4px;
  background: var(--accent);
}

/* ------------------------------------------------
   Responsive: Family Hero
------------------------------------------------ */

@media (max-width: 700px) {
  .family-section {
    min-height: 63vh;
    padding: 0.85rem 0.7rem 1.15rem;
  }

  .family-stage {
    height: 53vh;
  }

  .family-image {
    border-radius: 14px;
  }

  .family-caption {
    margin-top: 0.75rem;
    font-size: 0.82rem;
  }

  .caption-line {
    width: 24px;
    flex-basis: 24px;
  }
}

@media (max-width: 390px) {
  .family-section {
    min-height: 58vh;
  }

  .family-stage {
    height: 48vh;
  }

  .family-caption {
    font-size: 0.74rem;
    gap: 0.5rem;
  }
}


/* ------------------------------------------------
   Login Section
------------------------------------------------ */

.login-section {
  padding: 1.25rem 1rem clamp(2.5rem, 5vw, 4rem);
  background: var(--page-bg);
}

.login-card {
  width: min(100%, 490px);
  margin: 0 auto;
  padding: clamp(1.3rem, 4vw, 2.2rem);

  background: var(--card-bg);
  border: 1px solid rgba(220, 229, 226, 0.95);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-card);

  /*
    فرم در ابتدا پنهان است؛
    پس از اسکرول و رسیدن کاربر به بخش ورود، کلاس is-visible
    توسط JavaScript اضافه می‌شود.
  */
  opacity: 0;
  transform: translateY(28px);
}


@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.card-heading {
  display: flex;
  align-items: center;
  justify-content: center; /* قرارگیری در وسط افقی */
  margin-bottom: 1.65rem;
}

.heading-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;

  display: flex;
  align-items: center;
  justify-content: center;

  color: var(--primary);
  background: var(--primary-light);
  border-radius: 14px;
}

.heading-icon svg {
  width: 24px;
  height: 24px;
}

.card-heading h2 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 1.38rem;
  font-weight: 800;
}

.card-heading p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.89rem;
  line-height: 1.8;
}

/* فرم */
.login-form {
  display: grid;
  gap: 1.15rem;
}

.field-group {
  display: grid;
  gap: 0.5rem;
}

.field-group label {
  color: #314343;
  font-size: 0.9rem;
  font-weight: 700;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  top: 50%;
  right: 0.95rem;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 22px;
  height: 22px;

  color: #7d9290;
  transform: translateY(-50%);
  pointer-events: none;
}

.input-icon svg {
  width: 21px;
  height: 21px;
}

.input-wrapper input {
  width: 100%;
  height: 54px;
  padding: 0 3rem 0 1rem;

  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  outline: none;

  color: var(--text);
  background: #ffffff;

  font-size: 0.95rem;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.input-wrapper input::placeholder {
  color: #a0adab;
}

.input-wrapper input:focus {
  border-color: rgba(15, 91, 82, 0.7);
  background-color: #fcfffe;
  box-shadow: 0 0 0 4px rgba(15, 91, 82, 0.10);
}

/* دکمه نمایان‌سازی رمز */
.password-wrapper input {
  padding-left: 3rem;
}

.toggle-password {
  position: absolute;
  top: 50%;
  left: 0.7rem;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 38px;
  height: 38px;

  padding: 0;
  border: 0;
  border-radius: 10px;

  color: #6d8381;
  background: transparent;
  cursor: pointer;

  transform: translateY(-50%);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.toggle-password:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.toggle-password svg {
  width: 21px;
  height: 21px;
}

/* دکمه ورود */
.login-button {
  min-height: 54px;
  margin-top: 0.2rem;
  padding: 0.75rem 1.25rem;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;

  border: none;
  border-radius: var(--radius-small);

  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));

  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;

  box-shadow: 0 12px 22px rgba(15, 91, 82, 0.22);

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease;
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(15, 91, 82, 0.28);
}

.login-button:active {
  transform: translateY(0);
  box-shadow: 0 8px 16px rgba(15, 91, 82, 0.20);
}

.login-button svg {
  width: 21px;
  height: 21px;
}

/* پیام حریم خصوصی */
.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;

  margin-top: 1.3rem;
  padding: 0.85rem;

  border: 1px solid #e5ece9;
  border-radius: 14px;
  background: #f8fbfa;

  color: #667876;
}

.privacy-note svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin-top: 0.1rem;
  color: var(--primary);
}

.privacy-note p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.9;
}

/* ------------------------------------------------
   Footer
------------------------------------------------ */

.site-footer {
  padding: 1.15rem 1rem 1.6rem;
  text-align: center;
  background: var(--page-bg);
  color: #788785;
}

.site-footer p {
  margin: 0;
  font-size: 0.78rem;
}

/* ------------------------------------------------
   Modal
------------------------------------------------ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 1rem;

  visibility: hidden;
  opacity: 0;

  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.modal.is-open {
  visibility: visible;
  opacity: 1;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 28, 29, 0.62);
  backdrop-filter: blur(3px);
}

.modal-dialog {
  position: relative;
  z-index: 1;

  width: min(100%, 420px);
  padding: 2rem 1.5rem 1.5rem;

  text-align: center;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);

  transform: translateY(12px) scale(0.97);
  transition: transform 0.22s ease;
}

.modal.is-open .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;

  width: 34px;
  height: 34px;

  border: 0;
  border-radius: 10px;

  color: #617372;
  background: #f2f6f4;

  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;

  transition: color 0.2s ease, background-color 0.2s ease;
}

.modal-close:hover {
  color: #ffffff;
  background: var(--primary);
}

.modal-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 1rem;

  display: flex;
  align-items: center;
  justify-content: center;

  color: var(--primary);
  background: var(--primary-light);
  border-radius: 50%;
}

.modal-icon svg {
  width: 32px;
  height: 32px;
}

.modal-dialog h3 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 1.25rem;
  font-weight: 800;
}

.modal-dialog p {
  margin: 0.8rem 0 1.4rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 2;
}

.modal-confirm {
  width: 100%;
  min-height: 47px;

  border: 0;
  border-radius: 12px;

  color: #ffffff;
  background: var(--primary);

  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;

  transition: background-color 0.2s ease, transform 0.2s ease;
}

.modal-confirm:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* ------------------------------------------------
   Responsive
------------------------------------------------ */

@media (max-width: 700px) {
  .site-header {
    min-height: auto;
    align-items: flex-start;
    flex-direction: column;
    padding: 1rem 1.15rem;
  }

  .header-status {
    font-size: 0.78rem;
  }

  .family-section {
    padding: 1rem 0.75rem;
  }

  .family-frame {
    border-radius: 18px;
  }

  .family-image {
    /*
      در موبایل نیز کل تصویر نمایش داده می‌شود
      و هیچ crop یا برشی اتفاق نمی‌افتد.
    */
    width: 100%;
    height: auto;
    max-height: none;
  }

  .family-caption {
    font-size: 0.82rem;
  }

  .login-section {
    padding: 1rem 0.75rem 2.2rem;
  }

  .login-card {
    padding: 1.3rem 1rem;
    border-radius: 19px;
  }

  .card-heading h2 {
    font-size: 1.22rem;
  }

  .card-heading p {
    font-size: 0.82rem;
  }

  .input-wrapper input {
    height: 52px;
    font-size: 0.9rem;
  }

  .login-button {
    min-height: 52px;
  }
}

@media (max-width: 390px) {
  .brand-mark {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    border-radius: 14px;
    font-size: 0.85rem;
  }

  .brand-text h1 {
    font-size: 1rem;
  }

  .brand-text p {
    font-size: 0.73rem;
  }

  .header-status {
    line-height: 1.7;
  }

  .family-caption {
    font-size: 0.75rem;
  }

  .caption-line {
    width: 24px;
  }
}

/* رعایت ترجیح کاربران برای کاهش حرکت */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
/* ------------------------------------------------
   تعریف انیمیشن‌های نرم ورود (Fade-in-up)
------------------------------------------------ */
/* ------------------------------------------------
   انیمیشن‌های ورود صفحه
------------------------------------------------ */

/* ورود نرم فرم از پایین */
@keyframes smoothFadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ورود آرام و باوقار تصویر خانوادگی */
@keyframes familyReveal {
  from {
    opacity: 0;
    transform: scale(0.985) translateY(8px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ورود کوتاه و طبیعی سربرگ از بالا */
@keyframes headerFadeDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ۱. سربرگ: سریع و مختصر */
.site-header {
  animation: headerFadeDown 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ۲. عکس: آرام‌تر تا حس اهمیت و وقار داشته باشد */
.family-section {
  animation: familyReveal 1.15s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
}

/* ۳. فرم: فقط بعد از رسیدن کاربر به آن بخش اجرا می‌شود */
.login-card.is-visible {
  animation: smoothFadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}
