
/* Unified input styles - applied to all forms */
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group select,
.form-group textarea,
.form-item input[type="text"],
.form-item input[type="number"],
.form-item input[type="email"],
.form-item input[type="password"],
.form-item input[type="date"],
.form-item select,
.form-item textarea,
.operator-card input[type="text"],
.operator-card input[type="number"],
.operator-card input[type="email"],
.operator-card input[type="password"],
.operator-card input[type="date"],
.operator-card select,
.operator-card textarea,
.category-select-input,
.invoice-select-input,
.user-select-input {
  width: 105% !important;
  padding: 18px 16px 18px 40px !important;
  border: 2px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
  font-size: 12px !important;
  box-sizing: border-box !important;
  min-height: 52px !important;
  height: 52px !important;
  line-height: 1.5 !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  text-align: right !important;
  direction: rtl !important;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-item input:focus,
.form-item select:focus,
.form-item textarea:focus,
.operator-card input:focus,
.operator-card select:focus,
.operator-card textarea:focus,
.category-select-input:focus,
.invoice-select-input:focus,
.user-select-input:focus {
  outline: none !important;
  border-color: #3b82f6 !important;
  background: rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.form-group textarea,
.form-item textarea,
.operator-card textarea {
  min-height: 120px !important;
  height: auto !important;
  resize: vertical;
}


body {
  min-height: 100vh;
  margin: 0;
  font-family: 'Vazirmatn', 'IRANSans', 'Tahoma', Arial, sans-serif !important;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #1e133d 100%);
  position: relative;
  direction: rtl;
  overflow-x: hidden;
  font-display: swap;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  font-family: 'Vazirmatn', 'IRANSans', 'Tahoma', Arial, sans-serif !important;
}

/* Exclude Font Awesome icons from Vazirmatn font */
.fa, .fas, .far, .fal, .fab, .fa-solid, .fa-regular, .fa-light, .fa-brands,
[class*="fa-"], i[class*="fa-"] {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 6 Brands" !important;
}

*, *::before, *::after { box-sizing: border-box; }

.login-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #7c3aed 0%, #2d1d69 100%);
  z-index: 0;
}

.login-bg:after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url('https://svgshare.com/i/12dA.svg') repeat center center;
  opacity: 0.15;
  z-index: 1;
}

.login-glass {
  position: relative;
  z-index: 2;
  max-width: 480px;
  width: 90%;
  margin: 40px auto;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(15,6,40,0.6), 0 8px 32px rgba(124, 58, 237, 0.1);
  padding: 32px 24px 28px 24px;
  text-align: right;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s ease;
}

.login-glass:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 70px rgba(15,6,40,0.7), 0 12px 40px rgba(124, 58, 237, 0.15);
}
/* System Header Styles */
.system-header {
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.system-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px auto;
  background: linear-gradient(135deg, #7c3aed, #6f42c1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.3);
  transition: all 0.3s ease;
}

.system-logo:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 40px rgba(124, 58, 237, 0.4);
}

.system-logo i {
  font-size: 32px;
  color: #fff;
}

.system-header h1 {
  color: #fff;
  font-size: 29px;
  font-family: 'Vazirmatn', 'IRANSans', 'Tahoma', Arial, sans-serif !important;
  font-weight: 800;
  margin: 0 0 8px 0;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.system-subtitle {
  color: rgba(255,255,255,0.8);
  font-size: 15px;
  font-family: 'Vazirmatn', 'IRANSans', 'Tahoma', Arial, sans-serif !important;
  margin: 0;
  font-weight: 500;
}

.login-glass h2 {
  margin-bottom: 24px;
  color: #fff;
  font-size: 24px;
  font-family: 'Vazirmatn', 'IRANSans', 'Tahoma', Arial, sans-serif !important;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: center;
}
.input-group {
  position: relative;
  margin-bottom: 16px;
}
.input-group input {
  width: 100%;
  padding: 10px 12px 10px 40px; /* smaller vertical padding */
  border-radius: 8px;
  border: none;
  background: rgba(255,255,255,0.06);
  color: #f6f3ff;
  font-size: 15px;
  font-family: 'Vazirmatn', 'IRANSans', 'Tahoma', Arial, sans-serif !important;
  line-height: 1;
  outline: none;
  text-align: left;
  direction: ltr;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02), 0 6px 14px rgba(10,6,30,0.32);
}
.input-group input::placeholder {
  color: #e0d7fa;
  font-family: 'Vazirmatn', 'IRANSans', 'Tahoma', Arial, sans-serif !important;
  text-align: left;
  direction: ltr;
}
.input-icon {
  position: absolute;
  left: 12px; /* icon on the left for RTL */
  top: 50%;
  transform: translateY(-50%);
  color: #cbbff8;
  font-size: 17px;
}
.login-options {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  font-size: 16px;
  font-family: 'Vazirmatn', 'IRANSans', 'Tahoma', Arial, sans-serif !important;
  color: #e6dbff;
}
.login-options label {
  cursor: pointer;
}
.login-btn {
  width: 100%;
  background: linear-gradient(90deg,#8b5cf6,#6f42c1);
  color: #fff;
  border: none;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 17px;
  font-family: 'Vazirmatn', 'IRANSans', 'Tahoma', Arial, sans-serif !important;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 6px;
  box-shadow: 0 10px 30px rgba(79,10,120,0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(79,10,120,0.34);
}
.login-footer {
  display: none; /* removed per request */
}
.error-message {
  color: #ffd6d6;
  background: rgba(220,53,69,0.08);
  border-radius: 8px;
  margin-top: 12px;
  min-height: 28px;
  font-size: 16px;
  font-family: 'Vazirmatn', 'IRANSans', 'Tahoma', Arial, sans-serif !important;
  padding: 6px 10px;
  text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
  .login-glass {
    width: 95%;
    margin: 20px auto;
    padding: 24px 20px 20px 20px;
    border-radius: 20px;
  }
  
  .system-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
  }
  
  .system-logo {
    width: 70px;
    height: 70px;
    margin-bottom: 12px;
  }
  
  .system-logo i {
    font-size: 28px;
  }
  
  .system-header h1 {
    font-size: 24px;
  }
  
  .system-subtitle {
    font-size: 14px;
  }
  
  .login-glass h2 {
    font-size: 21px;
    margin-bottom: 20px;
  }
  
  .input-group input {
    padding: 12px 14px 12px 40px;
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  .login-btn {
    padding: 14px 16px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }
  
  .login-glass {
    width: 100%;
    margin: 10px auto;
    padding: 20px 16px 16px 16px;
    border-radius: 16px;
  }
  
  .system-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
  }
  
  .system-logo {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
  }
  
  .system-logo i {
    font-size: 24px;
  }
  
  .system-header h1 {
    font-size: 21px;
  }
  
  .system-subtitle {
    font-size: 14px;
  }
  
  .login-glass h2 {
    font-size: 19px;
    margin-bottom: 18px;
  }
  
  .input-group {
    margin-bottom: 14px;
  }
  
  .input-group input {
    padding: 10px 12px 10px 36px;
    font-size: 16px;
  }
  
  .input-icon {
    left: 10px;
    font-size: 16px;
  }
  
  .login-options {
    margin-bottom: 16px;
    font-size: 14px;
  }
  
  .login-btn {
    padding: 12px 14px;
    font-size: 15px;
  }
}

/* Landscape mobile optimization */
@media (max-height: 600px) and (orientation: landscape) {
  .login-glass {
    margin: 10px auto;
    padding: 20px 24px 16px 24px;
  }
  
  .system-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
  }
  
  .system-logo {
    width: 50px;
    height: 50px;
    margin-bottom: 8px;
  }
  
  .system-logo i {
    font-size: 20px;
  }
  
  .system-header h1 {
    font-size: 19px;
  }
  
  .system-subtitle {
    font-size: 13px;
  }
  
  .login-glass h2 {
    font-size: 18px;
    margin-bottom: 16px;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  .login-btn {
    min-height: 48px;
  }
  
  .input-group input {
    min-height: 48px;
  }
  
  .login-options label {
    padding: 8px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* Error and Success Popups */
.error-popup, .success-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.error-popup-content, .success-popup-content {
  background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,255,255,0.9));
  border-radius: 20px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.2);
  text-align: center;
  position: relative;
  animation: slideUp 0.3s ease;
}

.error-popup-content {
  border-left: 4px solid #dc3545;
}

.success-popup-content {
  border-left: 4px solid #28a745;
}

.error-icon, .success-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.error-icon {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: white;
  box-shadow: 0 8px 32px rgba(220, 53, 69, 0.3);
}

.success-icon {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  box-shadow: 0 8px 32px rgba(40, 167, 69, 0.3);
}

.error-text h3, .success-text h3 {
  margin: 0 0 8px 0;
  font-size: 19px;
  font-weight: 700;
  color: #333;
}

.error-text h3 {
  color: #dc3545;
}

.success-text h3 {
  color: #28a745;
}

.error-text p, .success-text p {
  margin: 0;
  color: #666;
  font-size: 15px;
  line-height: 1.5;
}

.error-close {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(220, 53, 69, 0.1);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #dc3545;
  transition: all 0.2s ease;
}

.error-close:hover {
  background: rgba(220, 53, 69, 0.2);
  transform: scale(1.1);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Loading button animation */
.login-btn:disabled {
  opacity: 0.8;
  cursor: not-allowed;
}

.login-btn .fa-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Responsive popups */
@media (max-width: 480px) {
  .error-popup-content, .success-popup-content {
    padding: 20px;
    max-width: 350px;
  }
  
  .error-icon, .success-icon {
    width: 50px;
    height: 50px;
    font-size: 20px;
    margin-bottom: 12px;
  }
  
  .error-text h3, .success-text h3 {
    font-size: 18px;
  }
  
  .error-text p, .success-text p {
    font-size: 14px;
  }
}
