
/* ========================================
   Reset
======================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}


/* ========================================
 Root
======================================== */

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;

  background: #f5f7fb;
  color: #1f2937;

  font-family: inherit;

  overflow-x: hidden;
}


/* ========================================
 Login Page
 Space reserved for the navbar
======================================== */

.login-page {
  width: 100%;

  /*
     فضای بالای صفحه برای جلوگیری از قرار گرفتن
     کارت ورود زیر نوبار
  */
  min-height: 100vh;

  padding:
      112px
      24px
      48px;

  display: flex;

  align-items: center;
  justify-content: center;
}


/* ========================================
 Login Card
======================================== */

.login-card {
  width: 100%;
  max-width: 440px;

  margin: 0 auto;

  padding: 40px;

  background: #ffffff;

  border: 1px solid #e2e8f0;
  border-radius: 22px;

  box-shadow:
      0 12px 35px rgba(15, 23, 42, 0.07);

  animation: login-card-appear 0.35s ease both;
}


/* ========================================
 Card Animation
======================================== */

@keyframes login-card-appear {
  from {
      opacity: 0;
      transform: translateY(8px);
  }

  to {
      opacity: 1;
      transform: translateY(0);
  }
}


/* ========================================
 Login Header
======================================== */

.login-header {
  margin-bottom: 30px;

  text-align: center;
}

.login-header h1 {
  margin-bottom: 10px;

  color: #172033;

  font-size: 23px;
  font-weight: 800;
  line-height: 1.7;
}

.login-header p {
  color: #64748b;

  font-size: 14px;
  line-height: 2;
}


/* ========================================
 Login Form
======================================== */

.login-form {
  display: flex;
  flex-direction: column;

  gap: 20px;
}


/* ========================================
 Form Group
======================================== */

.form-group {
  display: flex;
  flex-direction: column;

  gap: 8px;
}

.form-group label {
  color: #374151;

  font-size: 14px;
  font-weight: 700;
  line-height: 1.8;
}


/* ========================================
 Form Inputs
======================================== */

.form-group input {
  width: 100%;
  height: 48px;

  padding: 0 14px;

  border: 1px solid #d1d5db;
  border-radius: 11px;

  background: #ffffff;
  color: #172033;

  font-family: inherit;
  font-size: 14px;

  outline: none;

  transition:
      border-color 0.2s ease,
      box-shadow 0.2s ease,
      background-color 0.2s ease;
}

.form-group input:hover {
  border-color: #94a3b8;
}

.form-group input:focus {
  border-color: #2563eb;

  box-shadow:
      0 0 0 3px rgba(37, 99, 235, 0.10);
}

.form-group input::placeholder {
  color: #9ca3af;
}


/* ========================================
 Password Field
======================================== */

.password-field-wrapper {
  position: relative;
  width: 100%;
}

.password-field-wrapper input {
  padding-left: 48px;
}

.toggle-password {
  position: absolute;

  left: 7px;
  top: 50%;

  transform: translateY(-50%);

  width: 34px;
  height: 34px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  border: none;
  border-radius: 8px;

  background: transparent;
  color: #94a3b8;

  cursor: pointer;

  transition:
      color 0.2s ease,
      background-color 0.2s ease;
}

.toggle-password:hover {
  color: #1d4ed8;
  background: #eff6ff;
}

.toggle-password:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.eye-icon {
  width: 20px;
  height: 20px;
}

.eye-closed {
  display: none;
}

.toggle-password.active .eye-open {
  display: none;
}

.toggle-password.active .eye-closed {
  display: block;
}


/* ========================================
 Login Actions
======================================== */

.login-actions {
  display: flex;
  align-items: stretch;

  gap: 10px;

  margin-top: 4px;
}


/* ========================================
 Shared Button Style
======================================== */

.login-button,
.home-button {
  min-width: 0;
  min-height: 48px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  flex: 1;

  padding: 10px 14px;

  border-radius: 11px;

  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.7;

  text-align: center;
  text-decoration: none;

  transition:
      background-color 0.2s ease,
      border-color 0.2s ease,
      color 0.2s ease,
      transform 0.15s ease,
      box-shadow 0.2s ease;
}


/* ========================================
 Login Button
======================================== */

.login-button {
  border: 1px solid #172554;

  background: #172554;
  color: #ffffff;

  cursor: pointer;
}

.login-button:hover {
  border-color: #1e3a8a;
  background: #1e3a8a;

  box-shadow:
      0 5px 14px rgba(23, 37, 84, 0.16);
}

.login-button:active {
  transform: translateY(1px);
}

.login-button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.3);
  outline-offset: 3px;
}


/* ========================================
 Home Button
======================================== */

.home-button {
  border: 1px solid #d1d5db;

  background: #ffffff;
  color: #475569;
}

.home-button:hover {
  border-color: #94a3b8;

  background: #f8fafc;
  color: #172554;

  box-shadow:
      0 5px 14px rgba(15, 23, 42, 0.06);
}

.home-button:active {
  transform: translateY(1px);
}

.home-button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.2);
  outline-offset: 3px;
}


/* ========================================
 Form Errors
======================================== */

.form-error {
  margin-top: 2px;

  color: #dc2626;

  font-size: 12px;
  line-height: 1.8;
}

.form-error ul {
  padding: 0;
  margin: 0;

  list-style: none;
}

.form-error li {
  margin: 2px 0;
}

.general-error {
  padding: 11px 13px;

  border: 1px solid #fecaca;
  border-radius: 10px;

  background: #fef2f2;

  text-align: center;
}


/* ========================================
 Tablet
======================================== */

@media (max-width: 768px) {
  .login-page {
      padding:
          100px
          20px
          40px;
  }

  .login-card {
      max-width: 430px;

      padding: 34px 30px;

      border-radius: 20px;
  }
}


/* ========================================
 Mobile
======================================== */

@media (max-width: 480px) {
  .login-page {
      /*
         فاصله‌ی بالای موبایل کمتر است،
         اما همچنان برای نوبار فضا نگه می‌دارد.
      */
      padding:
          88px
          16px
          28px;
  }

  .login-card {
      max-width: 100%;

      padding: 28px 22px;

      border-radius: 17px;
  }

  .login-header {
      margin-bottom: 26px;
  }

  .brand {
      margin-bottom: 16px;

      font-size: 25px;
  }

  .login-header h1 {
      font-size: 21px;
  }

  .login-header p {
      font-size: 13px;
  }

  .login-form {
      gap: 18px;
  }

  .login-actions {
      flex-direction: column;

      gap: 10px;
  }

  .login-button,
  .home-button {
      width: 100%;
      min-height: 48px;

      flex: none;
  }
}


/* ========================================
 Small Mobile
======================================== */

@media (max-width: 360px) {
  .login-page {
      padding:
          82px
          12px
          24px;
  }

  .login-card {
      padding: 24px 17px;

      border-radius: 15px;
  }

  .login-header h1 {
      font-size: 19px;
  }

  .form-group input {
      height: 46px;
  }

  .login-button,
  .home-button {
      min-height: 46px;

      font-size: 13px;
  }
}


/* ========================================
 Reduced Motion
======================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
      scroll-behavior: auto !important;
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
  }
}
