/* ============================================
   NSP CRM - Complete Login Page Styles
   Tech Blue Theme with NSP Branding
   ============================================ */

:root {
  /* NSP Primary Blues - Matching site.css */
  --nsp-primary-blue: #007AE3;
  --nsp-blue-light: #2196F3;
  --nsp-blue-dark: #0056B3;
  --nsp-tech-cyan: #00BCD4;
  /* Brand Colors */
  --nsp-brand-red: #c62828;
  /* Backgrounds */
  --nsp-bg-white: #ffffff;
  --nsp-bg-light: #F5F7FA;
  --nsp-bg-lighter: #E3F2FD;
  /* Text Colors */
  --nsp-text-primary: #333333;
  --nsp-text-dark: #2c3e50;
  --nsp-text-muted: #6c757d;
  /* Borders */
  --nsp-border-light: #ddd;
  --nsp-border-medium: #ccc;
  /* Shadows - Matching site.css */
  --shadow-sm: 0 1px 3px rgba(0, 122, 227, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 122, 227, 0.12);
  --shadow-lg: 0 8px 24px rgba(0, 122, 227, 0.15);
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body.login-page {
  font-family: var(--font-family);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--nsp-text-primary);
}

.s-container-tight {
  max-width: 40rem !important;
}

/* ============================================
   Full Page Container - NSP Blue Gradient
   ============================================ */

.s-full-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--nsp-primary-blue) 0%, var(--nsp-blue-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* ============================================
   Tech Circuit Background Decoration
   ============================================ */

.login-background-decoration {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  animation: float 20s infinite ease-in-out;
}

.circle-1 {
  width: 300px;
  height: 300px;
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.circle-2 {
  width: 200px;
  height: 200px;
  bottom: -50px;
  left: -50px;
  animation-delay: 7s;
}

.circle-3 {
  width: 150px;
  height: 150px;
  top: 50%;
  left: -75px;
  animation-delay: 14s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, -30px) scale(1.1);
  }

  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }
}

/* ============================================
   Login Card Container
   ============================================ */

.login-container-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  padding: 20px;
  animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Main Login Card
   ============================================ */

.login-card {
  background: var(--nsp-bg-white);
  border-radius: 12px;
  padding: 48px 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(0, 122, 227, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

  /* Tech Circuit Pattern for Card */
  .login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--nsp-primary-blue) 0%, var(--nsp-tech-cyan) 100%);
  }

  .login-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0, 122, 227, 0.2);
  }

/* ============================================
   Header Section
   ============================================ */

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--nsp-text-dark);
  margin: 0 0 8px 0;
  letter-spacing: -0.5px;
}

.login-subtitle {
  font-size: 15px;
  color: var(--nsp-text-muted);
  margin: 0;
  font-weight: 400;
}

/* ============================================
   Form Styling
   ============================================ */

.login-form {
  margin-top: 32px;
  position: relative;
}

.property-grid-enhanced .field,
#LoginPanel .field {
  margin-bottom: 24px;
}

/* Enhanced Field Labels */
.property-grid-enhanced .caption,
#LoginPanel .caption,
.s-PropertyGrid .caption {
  font-size: 14px;
  font-weight: 600;
  color: var(--nsp-text-dark);
  margin-bottom: 8px;
  display: block;
  letter-spacing: 0.3px;
}

/* Hide labels if LabelWidth is 0 */
.property-grid-enhanced .field .caption:empty,
.property-grid-enhanced .field .caption[style*="width: 0"],
#LoginPanel .field .caption:empty,
#LoginPanel .field .caption[style*="width: 0"] {
  display: none;
}

/* Input Field Container */
.property-grid-enhanced .editor,
#LoginPanel .editor,
.property-grid-enhanced .field > div:not(.caption) {
  position: relative;
}

/* ============================================
   Enhanced Input Fields - NSP Style
   ============================================ */

.property-grid-enhanced input[type="text"],
.property-grid-enhanced input[type="password"],
#LoginPanel input[type="text"],
#LoginPanel input[type="password"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--nsp-border-light);
  border-radius: 8px;
  font-size: 15px;
  transition: all 0.3s ease;
  background: var(--nsp-bg-light);
  font-family: var(--font-family);
  color: var(--nsp-text-primary);
  font-weight: 500;
}

  /* Focus State */
  .property-grid-enhanced input[type="text"]:focus,
  .property-grid-enhanced input[type="password"]:focus,
  #LoginPanel input[type="text"]:focus,
  #LoginPanel input[type="password"]:focus {
    outline: none;
    border-color: var(--nsp-primary-blue);
    background: var(--nsp-bg-white);
    box-shadow: 0 0 0 4px rgba(0, 122, 227, 0.1);
    transform: translateY(-2px);
  }

  /* Hover State */
  .property-grid-enhanced input[type="text"]:hover,
  .property-grid-enhanced input[type="password"]:hover,
  #LoginPanel input[type="text"]:hover,
  #LoginPanel input[type="password"]:hover {
    border-color: var(--nsp-border-medium);
    background: var(--nsp-bg-white);
  }

/* Placeholder Styling */
.property-grid-enhanced input::placeholder,
#LoginPanel input::placeholder {
  color: var(--nsp-text-muted);
  font-weight: 400;
}

/* Disabled State */
.property-grid-enhanced input[type="text"]:disabled,
.property-grid-enhanced input[type="password"]:disabled,
#LoginPanel input[type="text"]:disabled,
#LoginPanel input[type="password"]:disabled {
  background: #e9ecef;
  cursor: not-allowed;
  opacity: 0.7;
}

/* ============================================
   Input Field Icons (Added via JavaScript)
   ============================================ */

.input-icon-left {
  /* Styles are inline via JavaScript */
  /* This class is just for identification */

  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
  font-size: 16px;
  pointer-events: none;
  z-index: 10;
  transition: color 0.3s ease;
}

/* ============================================
   Password Toggle Button
   ============================================ */

.password-toggle {
  position: absolute;
  right: 15px;
  top: 42%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--nsp-text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 10px;
  transition: all 0.3s ease;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 4px;
}

  .password-toggle:hover {
    color: var(--nsp-primary-blue);
    background: rgba(0, 122, 227, 0.05);
  }

  .password-toggle:focus-visible {
    outline: 2px solid var(--nsp-primary-blue);
    outline-offset: 2px;
  }

  .password-toggle:active {
    transform: translateY(-50%) scale(0.95);
  }

  .password-toggle i {
    font-size: 16px;
  }

.fa .fa-user .input-icon-left {
  content: "\\f007";
}
    
/* ============================================
   Validation States
   ============================================ */

.property-grid-enhanced input[type="text"].is-invalid,
.property-grid-enhanced input[type="password"].is-invalid,
#LoginPanel input[type="text"].is-invalid,
#LoginPanel input[type="password"].is-invalid {
  border-color: var(--nsp-brand-red);
  background: #fff5f5;
}

  .property-grid-enhanced input[type="text"].is-invalid:focus,
  .property-grid-enhanced input[type="password"].is-invalid:focus,
  #LoginPanel input[type="text"].is-invalid:focus,
  #LoginPanel input[type="password"].is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(198, 40, 40, 0.1);
  }

.property-grid-enhanced input[type="text"].is-valid,
.property-grid-enhanced input[type="password"].is-valid,
#LoginPanel input[type="text"].is-valid,
#LoginPanel input[type="password"].is-valid {
  border-color: #28a745;
  background: #f0fff4;
}

/* ============================================
   Form Options Row
   ============================================ */

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 24px 0;
}

/* ============================================
   Custom Checkbox - NSP Style
   ============================================ */

.remember-me-container {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  position: relative;
}

  .remember-me-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
  }

.checkmark {
  height: 20px;
  width: 20px;
  background-color: var(--nsp-bg-light);
  border: 2px solid var(--nsp-border-light);
  border-radius: 6px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remember-me-container:hover .checkmark {
  border-color: var(--nsp-primary-blue);
}

.remember-me-container input:checked ~ .checkmark {
  background: linear-gradient(135deg, var(--nsp-primary-blue) 0%, var(--nsp-blue-light) 100%);
  border-color: var(--nsp-primary-blue);
}

.checkmark:after {
  content: "";
  display: none;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.remember-me-container input:checked ~ .checkmark:after {
  display: block;
}

.remember-text {
  margin-left: 10px;
  font-size: 14px;
  color: var(--nsp-text-primary);
}

/* ============================================
   Forgot Password Link
   ============================================ */

.forgot-password-link {
  font-size: 14px;
  color: var(--nsp-primary-blue);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

  .forgot-password-link:hover {
    color: var(--nsp-blue-dark);
    text-decoration: underline;
  }

/* ============================================
   Enhanced Login Button - NSP Gradient
   ============================================ */

.btn-login {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--nsp-primary-blue) 0%, var(--nsp-blue-light) 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 122, 227, 0.3);
  font-family: var(--font-family);
}

  .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 227, 0.4);
    background: linear-gradient(135deg, var(--nsp-blue-dark) 0%, var(--nsp-primary-blue) 100%);
  }

  .btn-login:active {
    transform: translateY(0);
  }

  .btn-login .btn-text {
    display: inline-block;
    transition: opacity 0.3s ease;
  }

  .btn-login .btn-loader {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }

  .btn-login.loading .btn-text {
    opacity: 0;
  }

  .btn-login.loading .btn-loader {
    display: block;
  }

  .btn-login:disabled {
    cursor: not-allowed;
    opacity: 0.7;
  }

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* ============================================
   Footer
   ============================================ */

.login-footer {
  text-align: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--nsp-border-light);
}

.footer-text {
  font-size: 14px;
  color: var(--nsp-text-muted);
  margin-right: 8px;
}

.signup-link {
  font-size: 14px;
  color: var(--nsp-primary-blue);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

  .signup-link:hover {
    color: var(--nsp-blue-dark);
    text-decoration: underline;
  }

/* ============================================
   Alert Styling
   ============================================ */

.alert {
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
  animation: slideInDown 0.5s ease-out;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-info {
  background-color: var(--nsp-bg-lighter);
  border: 1px solid rgba(0, 122, 227, 0.2);
  color: var(--nsp-primary-blue);
}

.alert-danger {
  background-color: #ffebee;
  border: 1px solid rgba(198, 40, 40, 0.2);
  color: var(--nsp-brand-red);
}

.alert-success {
  background-color: #e8f5e9;
  border: 1px solid rgba(76, 175, 80, 0.2);
  color: #2e7d32;
}

/* ============================================
   RTL Support for Arabic/Hebrew
   ============================================ */

html[dir="rtl"] .remember-text {
  margin-left: 0;
  margin-right: 10px;
}

html[dir="rtl"] .footer-text {
  margin-right: 0;
  margin-left: 8px;
}

html[dir="rtl"] .login-card::before {
  left: auto;
  right: 0;
}

html[dir="rtl"] .password-toggle {
  right: auto;
  left: 15px;
}

html[dir="rtl"] .input-icon-left {
  left: auto !important;
  right: 16px !important;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
  .login-card {
    padding: 32px 24px;
  }

  .login-title {
    font-size: 24px;
  }

  .form-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .login-container-wrapper {
    max-width: 100%;
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 24px 20px;
    border-radius: 8px;
  }

  .login-title {
    font-size: 22px;
  }

  .btn-login {
    padding: 14px;
    font-size: 15px;
  }

  .property-grid-enhanced input[type="text"],
  .property-grid-enhanced input[type="password"],
  #LoginPanel input[type="text"],
  #LoginPanel input[type="password"] {
    padding: 12px 14px;
    font-size: 14px;
  }

  .password-toggle {
    right: 10px;
    width: 36px;
    height: 36px;
  }

  html[dir="rtl"] .password-toggle {
    left: 10px;
  }
}

/* ============================================
   Dark Mode Support (Future Ready)
   ============================================ */

@media (prefers-color-scheme: dark) {
  :root {
    --nsp-bg-white: #1a1a1a;
    --nsp-bg-light: #2d2d2d;
    --nsp-bg-lighter: #1e3a52;
    --nsp-text-primary: #e0e0e0;
    --nsp-text-dark: #ffffff;
    --nsp-border-light: #404040;
    --nsp-primary-blue: #4A9EFF;
  }

  .login-card {
    background: var(--nsp-bg-white);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  }

  .property-grid-enhanced input[type="text"],
  .property-grid-enhanced input[type="password"],
  #LoginPanel input[type="text"],
  #LoginPanel input[type="password"] {
    background: var(--nsp-bg-light);
    color: var(--nsp-text-primary);
    border-color: var(--nsp-border-light);
  }
}

/* ============================================
   Accessibility Enhancements
   ============================================ */

*:focus-visible {
  outline: 3px solid var(--nsp-primary-blue);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
  .s-full-page {
    background: white;
  }

  .login-background-decoration {
    display: none;
  }

  .login-card {
    box-shadow: none;
    border: 1px solid var(--nsp-border-light);
  }
}
/* ============================================
   Footer - Copyright Style
   ============================================ */

.login-footer {
  text-align: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--nsp-border-light);
}

.footer-copyright {
  margin-bottom: 12px;
}

.copyright-text {
  font-size: 13px;
  color: var(--nsp-text-muted);
  font-weight: 400;
  display: block;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-link {
  font-size: 12px;
  color: var(--nsp-primary-blue);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

  .footer-link:hover {
    color: var(--nsp-blue-dark);
    text-decoration: underline;
  }

.footer-divider {
  font-size: 12px;
  color: var(--nsp-text-muted);
  user-select: none;
}

/* Responsive */
@media (max-width: 480px) {
  .copyright-text {
    font-size: 12px;
  }

  .footer-link {
    font-size: 11px;
  }
}