/**
 * Login Page Styles
 * Optimized for construction workers - large touch targets, clear visuals
 * BEM Methodology
 */

/* ========================================
   Auth Page Body Reset
   ======================================== */
.auth-page {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height for mobile */
  background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
}

/* ========================================
   Page Layout
   ======================================== */
.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
}

/* ========================================
   Login Card
   ======================================== */
.login__card {
  width: 100%;
  max-width: 420px;
  background: white;
  border-radius: 16px;
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.05),
    0 10px 20px rgba(0, 0, 0, 0.1);
  padding: 2.5rem 2rem;
}

/* ========================================
   Logo Section
   ======================================== */
.login__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.login__logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.login__logo-icon svg {
  width: 28px;
  height: 28px;
}

.login__logo-text {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.5px;
}

/* ========================================
   Header
   ======================================== */
.login__header {
  text-align: center;
  margin-bottom: 2rem;
}

.login__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.5rem 0;
}

.login__subtitle {
  font-size: 1rem;
  color: #64748b;
  margin: 0;
}

/* ========================================
   Alert Overrides for Login
   ======================================== */
.login .alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-radius: 12px;
  font-size: 1rem;
}

.login .alert__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.login .alert-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.login .alert-success {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

/* ========================================
   Form
   ======================================== */
.login__form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ========================================
   Form Fields
   ======================================== */
.login__field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.login__label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
}

.login__label-icon {
  width: 20px;
  height: 20px;
  color: #6b7280;
}

/* ========================================
   Input Styling - Large Touch Targets
   ======================================== */
.login__input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.login__input {
  width: 100%;
  /* Large touch target - minimum 48px recommended, we use 56px */
  min-height: 56px;
  padding: 1rem 1.25rem;
  font-size: 1.125rem;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  color: #1e293b;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.login__input::placeholder {
  color: #94a3b8;
}

.login__input:hover {
  border-color: #cbd5e1;
  background: white;
}

.login__input:focus {
  outline: none;
  border-color: #3b82f6;
  background: white;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* Password field with toggle button */
.login__input-wrapper .login__input {
  padding-right: 3.5rem;
}

/* ========================================
   Password Toggle Button
   ======================================== */
.login__toggle-password {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  /* Large touch target */
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  color: #64748b;
  transition: all 0.2s ease;
}

.login__toggle-password:hover {
  background: #f1f5f9;
  color: #3b82f6;
}

.login__toggle-password:active {
  background: #e2e8f0;
}

.login__eye-icon {
  width: 24px;
  height: 24px;
}

/* ========================================
   Submit Button Override
   ======================================== */
.login__submit {
  margin-top: 0.5rem;
  /* Extra large touch target for primary action */
  min-height: 60px;
  font-size: 1.125rem;
  font-weight: 600;
  border-radius: 12px;
}

.login__submit:active {
  transform: scale(0.98);
}

/* ========================================
   Footer
   ======================================== */
.login__footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
}

.login__footer p {
  margin: 0;
  font-size: 0.875rem;
  color: #64748b;
}

/* ========================================
   Mobile Responsive
   ======================================== */
@media (max-width: 480px) {
  .login {
    padding: 1rem;
    align-items: flex-start;
    padding-top: 2rem;
  }

  .login__card {
    padding: 2rem 1.5rem;
    border-radius: 12px;
  }

  .login__logo {
    margin-bottom: 1.5rem;
  }

  .login__logo-icon {
    width: 44px;
    height: 44px;
  }

  .login__logo-icon svg {
    width: 24px;
    height: 24px;
  }

  .login__logo-text {
    font-size: 1.5rem;
  }

  .login__title {
    font-size: 1.5rem;
  }

  .login__subtitle {
    font-size: 0.9375rem;
  }

  /* Keep large touch targets on mobile */
  .login__input {
    min-height: 52px;
    font-size: 1rem;
    padding: 0.875rem 1rem;
  }

  .login__submit {
    min-height: 56px;
    font-size: 1rem;
  }
}

/* ========================================
   Focus visible for keyboard navigation
   ======================================== */
.login__input:focus-visible,
.login__toggle-password:focus-visible,
.login__submit:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* ========================================
   Reduced motion preference
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  .login__input,
  .login__toggle-password,
  .login__submit {
    transition: none;
  }
}
