
/* ==========================================
   GENERAL STYLES
   ========================================== */
body {
  background: linear-gradient(135deg, #e8f5e8 0%, #f0f9f0 100%);
  font-family: 'Alef', sans-serif;
  margin: 0;
  padding: 20px 0;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ==========================================
   LOGIN CONTAINER
   ========================================== */
.container {
  background: white;
  border-radius: 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  width: 100%;
  max-width: 450px;
  position: relative;
  animation: slideInUp 0.8s ease-out;
  padding: 0;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   LOGIN HEADER
   ========================================== */
.login-header {
  background: linear-gradient(135deg, #8360c3 0%, #2ebf91 100%);
  color: white;
  padding: 40px 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.login-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: repeating-linear-gradient(45deg,
      transparent,
      transparent 20px,
      rgba(255, 255, 255, 0.05) 20px,
      rgba(255, 255, 255, 0.05) 40px);
  animation: moveStripes 20s linear infinite;
}

@keyframes moveStripes {
  0% {
    transform: translateX(-100px) translateY(-100px);
  }

  100% {
    transform: translateX(100px) translateY(100px);
  }
}

.login-header-content {
  position: relative;
  z-index: 2;
}

.login-logo {
  font-size: 4rem;
  margin-bottom: 20px;
  color: white;
}

.login-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.login-subtitle {
  font-size: 1rem;
  opacity: 0.9;
}

/* ==========================================
   LOGIN BODY
   ========================================== */
.login-body {
  padding: 40px 30px;
}

.mb-3 {
  margin-bottom: 25px !important;
  position: relative;
}

.form-label {
  font-weight: 600;
  color: #155724;
  margin-bottom: 8px;
  display: block;
}

.form-control {
  border: 2px solid #e9ecef;
  border-radius: 15px;
  padding: 15px 20px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #f8f9fa;
}

.form-control:focus {
  outline: none;
  border-color: #2ebf91;
  box-shadow: 0 0 0 3px rgba(46, 191, 145, 0.1);
  background: white;
}

.input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
  font-size: 1.1rem;
}

.form-control.with-icon {
  padding-left: 50px;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn-primary {
  background: linear-gradient(135deg, #8360c3 0%, #2ebf91 100%);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 20px;
  font-size: 1.1rem;
  font-weight: 700;
  width: 100%;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(46, 191, 145, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #8360c3, #2ebf91);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(46, 191, 145, 0.5);
  color: white;
}

.btn-primary:active {
  transform: translateY(0);
}

.loading-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* ==========================================
   LINKS
   ========================================== */
.link {
  text-align: center;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

.link a {
  color: #2ebf91;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.link a:hover {
  color: #8360c3;
  text-decoration: underline;
}

/* ==========================================
   BACKGROUND ELEMENTS
   ========================================== */
.bg-elements {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.bg-circle {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(32, 201, 151, 0.05));
  animation: float 6s ease-in-out infinite;
}

.bg-circle:nth-child(1) {
  width: 200px;
  height: 200px;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.bg-circle:nth-child(2) {
  width: 150px;
  height: 150px;
  top: 60%;
  left: 80%;
  animation-delay: 2s;
}

.bg-circle:nth-child(3) {
  width: 100px;
  height: 100px;
  top: 80%;
  left: 20%;
  animation-delay: 4s;
}

.bg-circle:nth-child(4) {
  width: 80px;
  height: 80px;
  top: 30%;
  left: 70%;
  animation-delay: 1s;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }

  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

/* ==========================================
   SUCCESS ANIMATION
   ========================================== */
.success-checkmark {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
}

.success-checkmark .check-icon {
  width: 40px;
  height: 40px;
  position: relative;
  border-radius: 50%;
  background: #2ebf91;
  animation: scaleIn 0.3s ease-in-out;
}

.success-checkmark .check-icon::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 8px;
  border: 3px solid white;
  border-top: none;
  border-right: none;
  transform: translate(-50%, -60%) rotate(-45deg);
}

@keyframes scaleIn {
  0% {
    transform: scale(0);
  }

  100% {
    transform: scale(1);
  }
}

/* ==========================================
   INTERACTIVE EFFECTS
   ========================================== */
.form-control:focus+.input-icon {
  color: #2ebf91;
  transform: translateY(-50%) scale(1.1);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .container {
    max-width: 100%;
    margin: 10px;
  }

  .login-header {
    padding: 30px 20px;
  }

  .login-body {
    padding: 30px 20px;
  }

  .login-title {
    font-size: 1.5rem;
  }

  .login-logo {
    font-size: 3rem;
  }
}

/* ==========================================
   DARK MODE SUPPORT
   ========================================== */
@media (prefers-color-scheme: dark) {
  body {
    background: linear-gradient(135deg, #1a3a1a 0%, #0d2818 100%);
  }

  .container {
    background: #1e3a1e;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  }

  .form-control {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
  }

  .form-control:focus {
    background: #2d3748;
    border-color: #28a745;
  }

  .form-label {
    color: #a2d2a2;
  }
}

/* ==========================================
CUSTOM MODAL STYLES
========================================== */
.custom-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease-out;
}

.custom-modal.show {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-content {
  background: white;
  border-radius: 25px;
  padding: 0;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: modalSlideIn 0.4s ease-out;
  position: relative;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  padding: 30px 30px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.modal-header.success {
  background: linear-gradient(135deg, #2ebf91 0%, #1e8c67 100%);
  color: white;
}

.modal-header.error {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
}

.modal-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: repeating-linear-gradient(45deg,
      transparent,
      transparent 15px,
      rgba(255, 255, 255, 0.05) 15px,
      rgba(255, 255, 255, 0.05) 30px);
  animation: moveStripes 15s linear infinite;
}

.modal-icon {
  font-size: 3.5rem;
  margin-bottom: 15px;
  position: relative;
  z-index: 2;
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

.modal-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 5px;
  position: relative;
  z-index: 2;
}

.modal-body {
  padding: 20px 30px 30px;
  text-align: center;
}

.modal-message {
  font-size: 1.1rem;
  color: #495057;
  margin-bottom: 25px;
  line-height: 1.5;
}

.modal-btn {
  background: linear-gradient(135deg, #8360c3 0%, #2ebf91 100%);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 15px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(46, 191, 145, 0.3);
  min-width: 120px;
}

.modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46, 191, 145, 0.4);
}

.modal-btn:active {
  transform: translateY(0);
}

.modal-btn.error {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.modal-btn.error:hover {
  box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

/* Responsive for modal */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-width: 350px;
  }

  .modal-header {
    padding: 25px 20px 15px;
  }

  .modal-body {
    padding: 15px 20px 25px;
  }

  .modal-icon {
    font-size: 3rem;
  }

  .modal-title {
    font-size: 1.5rem;
  }
}

/* Dark mode support for modal */
@media (prefers-color-scheme: dark) {
  .modal-content {
    background: #2d3748;
  }

  .modal-message {
    color: #e2e8f0;
  }
}

.password-toggle {
  position: absolute;
  left: 40px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #6c757d;
  font-size: 1.1rem;
  z-index: 10;
  transition: all 0.3s ease;
}

.password-toggle:hover {
  color: #2ebf91;
}

.password-toggle.fa-eye-slash {
  color: #2ebf91;
}

/* זכור אותי - checkbox */
.remember-me-container {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  border-radius: 10px;
  transition: all 0.3s ease;
}



.form-check-input {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #2ebf91;
}

.form-check-label {
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  color: #495057;
  margin: 0;
}/* ========== Loading State for Login Button ========== */

.btn-primary.loading {
    pointer-events: none;
    opacity: 0.85;
    cursor: not-allowed;
}

.btn-primary.loading #login-text {
    visibility: hidden;
}

.btn-primary.loading #login-spinner {
    display: block !important;
}

#login-spinner {
    display: none;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s ease-in-out infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.btn-primary {
    position: relative;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.otp-card {
    background: white;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 100%;
    max-width: 450px;
    position: relative;
    animation: slideInUp 0.8s ease-out;
    padding: 0;
}

.otp-destination-text {
    font-weight: bold;
    color: white;
    direction: ltr;
    display: inline-block;
    font-size: 1.1rem;
    opacity: 0.95;
}

.channel-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 10px;
}

.channel-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.channel-btn:hover {
    border-color: #2ebf91;
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(46, 191, 145, 0.2);
}

.channel-btn i {
    font-size: 1.4rem;
    color: #8360c3;
    width: 30px;
}

.channel-btn small {
    margin-right: auto;
    color: #6c757d;
    direction: ltr;
}

.otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 24px 0;
}

.otp-digit {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    outline: none;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.otp-digit:focus {
    border-color: #2ebf91;
    box-shadow: 0 0 0 3px rgba(46, 191, 145, 0.1);
    background: white;
}

#verify-otp-btn {
    width: 100%;
    margin: 16px 0;
}

#resend-container {
    margin: 12px 0;
    color: #6c757d;
    font-size: 0.9rem;
    text-align: center;
}

#resend-link {
    color: #2ebf91;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

#resend-link:hover {
    color: #8360c3;
    text-decoration: underline;
}

.otp-back-link {
    color: #2ebf91;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.otp-back-link:hover {
    color: #8360c3;
    text-decoration: underline;
}

.otp-help-container {
    text-align: center;
    margin-top: 20px;
    padding-bottom: 4px;
}

.otp-help-icon {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    color: #ced4da;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.otp-help-icon:hover {
    color: #8360c3;
}


.otp-help-tooltip-fixed {
    display: none;
    position: fixed;
    transform: translateX(-50%);
    background: white;
    color: #2c3e50;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    line-height: 1.6;
    white-space: nowrap;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border: 1px solid #e0e0e0;
    pointer-events: none;
}