/* css/login.css - Dedicated Responsive Styles for GarJer System Login */

/* Keyframe Animations */
@keyframes loginFadeIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes logoPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

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

/* Page Layout Wrapper */
.login-body-wrapper {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background-color: var(--bg-main, #F6F1E4);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(74, 90, 48, 0.05) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(170, 84, 43, 0.06) 0%, transparent 45%);
  box-sizing: border-box;
}

/* Login Card Component */
.login-card {
  background: var(--bg-card, #FFFFFF);
  border: 1.5px solid var(--border-color, #D5C9B3);
  border-radius: var(--radius-lg, 16px);
  width: 100%;
  max-width: 440px;
  box-shadow: 0 12px 36px rgba(74, 90, 48, 0.14), 0 2px 6px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: loginFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.login-card:hover {
  box-shadow: 0 16px 42px rgba(74, 90, 48, 0.18), 0 4px 10px rgba(0, 0, 0, 0.06);
}

/* Header Section */
.login-header {
  background: var(--olive, #4A5A30);
  padding: 32px 24px 26px;
  text-align: center;
  position: relative;
  border-bottom: 3px solid var(--wheat, #EAE297);
}

.login-brand-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 14px;
  background: var(--wheat, #EAE297);
  padding: 6px;
  margin: 0 auto 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  display: block;
  transition: transform 0.3s ease;
}

.login-card:hover .login-brand-logo {
  transform: scale(1.04);
}

.login-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-light, #FBF6E9);
  letter-spacing: -0.3px;
  margin: 0;
  line-height: 1.2;
}

.login-subtitle {
  font-size: 0.88rem;
  color: var(--wheat, #EAE297);
  font-weight: 500;
  margin-top: 4px;
  opacity: 0.92;
}

/* Login Form Body */
.login-body {
  padding: 28px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Alert Notification Banner */
#loginAlert {
  animation: alertSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(194, 68, 28, 0.15);
  line-height: 1.4;
  word-break: break-word;
}

/* Form Groups & Field Inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dark, #2F2116);
  letter-spacing: 0.1px;
}

.input-icon-group {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--olive, #4A5A30);
  font-size: 1.2rem;
  pointer-events: none;
  transition: color 0.2s ease;
  z-index: 2;
}

.input-with-icon {
  width: 100%;
  height: 48px;
  padding-left: 46px !important;
  padding-right: 44px !important;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-dark, #2F2116);
  background-color: #FAF7F0;
  border: 1.5px solid var(--border-color, #D5C9B3);
  border-radius: var(--radius-sm, 8px);
  outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.input-with-icon::placeholder {
  color: #9A8372;
  opacity: 0.8;
}

.input-with-icon:focus {
  background-color: #FFFFFF;
  border-color: var(--rust, #AA542B);
  box-shadow: 0 0 0 3.5px rgba(170, 84, 43, 0.15);
}

.input-icon-group:focus-within .input-icon {
  color: var(--rust, #AA542B);
}

/* Password Visibility Toggle */
.password-toggle-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-muted, #8A6E5A);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
  z-index: 3;
}

.password-toggle-btn:hover {
  color: var(--rust, #AA542B);
  background-color: rgba(170, 84, 43, 0.08);
}

.password-toggle-btn:focus-visible {
  outline: 2px solid var(--rust, #AA542B);
}

/* Submit Action Button */
.btn-login-submit {
  width: 100%;
  height: 52px;
  margin-top: 4px;
  background: var(--rust, #AA542B);
  border: none;
  border-radius: var(--radius-sm, 8px);
  color: #FFFFFF;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(170, 84, 43, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  touch-action: manipulation;
}

.btn-login-submit:hover:not(:disabled) {
  background: var(--terracotta, #C2441C);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(194, 68, 28, 0.4);
}

.btn-login-submit:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(170, 84, 43, 0.3);
}

.btn-login-submit:disabled {
  opacity: 0.78;
  cursor: not-allowed;
}

.btn-login-submit i {
  font-size: 1.15rem;
  transition: transform 0.2s ease;
}

.btn-login-submit:hover:not(:disabled) i.ri-arrow-right-line {
  transform: translateX(4px);
}

/* ==========================================
   RESPONSIVE BREAKPOINTS
   ========================================== */

/* Mobile Devices (Portrait < 480px) */
@media (max-width: 480px) {
  .login-body-wrapper {
    padding: 16px 12px;
    align-items: flex-start;
    padding-top: calc(5vh + 10px);
  }

  .login-card {
    max-width: 100%;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(74, 90, 48, 0.12);
  }

  .login-header {
    padding: 24px 18px 20px;
  }

  .login-brand-logo {
    width: 54px;
    height: 54px;
    margin-bottom: 10px;
  }

  .login-title {
    font-size: 1.4rem;
  }

  .login-subtitle {
    font-size: 0.82rem;
  }

  .login-body {
    padding: 20px 18px 24px;
    gap: 16px;
  }

  .input-with-icon {
    height: 46px;
    font-size: 0.92rem;
  }

  .btn-login-submit {
    height: 48px;
    font-size: 0.98rem;
  }
}

/* Mobile Landscape & Short Screens (< 700px height) */
@media (max-height: 700px) and (orientation: landscape) {
  .login-body-wrapper {
    align-items: flex-start;
    padding: 16px;
  }

  .login-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: left;
  }

  .login-brand-logo {
    margin: 0;
    width: 42px;
    height: 42px;
    padding: 4px;
  }

  .login-body {
    padding: 18px 22px 20px;
    gap: 12px;
  }

  .btn-login-submit {
    height: 46px;
  }
}

/* Tablets & Foldables (768px to 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .login-card {
    max-width: 460px;
  }

  .login-header {
    padding: 36px 28px 28px;
  }

  .login-body {
    padding: 32px 32px 36px;
    gap: 22px;
  }

  .input-with-icon {
    height: 50px;
  }

  .btn-login-submit {
    height: 54px;
    font-size: 1.05rem;
  }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .login-card,
  #loginAlert,
  .btn-login-submit,
  .input-with-icon {
    animation: none !important;
    transition: none !important;
  }
}
