/* ===== BASE ===== */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial;
  background: #f8fafc;
  margin: 0;
}

/* ===== WRAPPER ===== */
.cs_login_wrapper {
  position: relative;
  min-height: 100vh;
  background-size: cover;
  overflow: hidden;
}

.cs_login_overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0.97) 0%,
      rgba(255, 255, 255, 0.92) 40%,
      rgba(255, 255, 255, 0.6) 65%,
      rgba(255, 255, 255, 0.2) 80%,
      rgba(255, 255, 255, 0) 100%);
  z-index: 1;
}

.cs_login_wrapper .container-fluid {
  position: relative;
  z-index: 2;
}

/* ===== BRAND ===== */
.cs_login_brand {
  padding: 30px;
  align-items: flex-start;
}

.cs_login_brand img {
  max-width: 200px;
}

/* ===== CARD ===== */
.cs_login_card {
  background: #ffffff;
  padding: 50px 45px;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

.cs_login_card h2 {
  font-size: 28px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 8px;
}

.cs_login_card p {
  color: #6b7280;
  font-size: 15px;
  margin-bottom: 32px;
}

/* ===== INPUT GROUP ===== */
.cs_input_group {
  position: relative;
  width: 100%;
  margin-bottom: 20px;
}

.cs_input_label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.cs_input_wrapper {
  position: relative;
  width: 100%;
}

.cs_input_icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: #9ca3af;
  transition: color 0.3s ease;
  z-index: 2;
}

.cs_input_wrapper:focus-within .cs_input_icon {
  color: #e11d2a;
}

.cs_input_group input {
  width: 100%;
  height: 56px;
  padding: 0 18px 0 52px;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  background: #f9fafb;
  font-size: 15px;
  color: #1f2937;
  transition: all 0.3s ease;
  box-sizing: border-box;
  outline: none;
}

.cs_input_group input::placeholder {
  color: #9ca3af;
}

.cs_input_group input:focus {
  border-color: #e11d2a;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(225, 29, 42, 0.1);
}

/* ===== SWITCH TOGGLE ===== */
.cs_switch_toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px;
  z-index: 3;
}

.cs_switch_btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: #6b7280;
  outline: none;
}

.cs_switch_btn:hover {
  background: #f3f4f6;
  color: #374151;
}

.cs_switch_btn.active {
  background: #e11d2a;
  color: #ffffff;
}

.cs_switch_btn i {
  font-size: 16px;
}

/* ===== PASSWORD TOGGLE ===== */
.cs_password_toggle {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 8px;
  z-index: 2;
  transition: color 0.3s ease;
  outline: none;
}

.cs_password_toggle:hover {
  color: #e11d2a;
}

.cs_password_toggle i {
  font-size: 18px;
}

/* ===== OTP SECTION ===== */
#otpSection {
  margin: 24px 0;
}

.cs_send_otp_btn {
  width: 100%;
  height: 52px;
  border-radius: 12px;
  border: 2px dashed #e11d2a;
  background: #ffffff;
  color: #e11d2a;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
  margin-bottom: 20px;
}

.cs_send_otp_btn:hover {
  background: #fef2f2;
  border-color: #c81e2c;
  transform: translateY(-2px);
}

.cs_send_otp_btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#otpInputSection {
  background: #ffffff;
  padding: 24px;
  border-radius: 16px;
  border: 2px solid #fee2e2;
  text-align: center;
  box-shadow: 0 4px 12px rgba(225, 29, 42, 0.08);
  position: relative;
  margin-top: 16px;
}

#otpInputSection::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #e11d2a, #ff4757, #e11d2a);
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.otp-title {
  color: #991b1b;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}

.otp-subtitle {
  font-size: 13px;
  color: #dc2626;
  margin-bottom: 20px;
}

.otp-inputs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 16px 0;
}

.otp-box {
  width: 50px;
  height: 55px;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  background: #ffffff;
  color: #1f2937;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  outline: none !important;
  caret-color: #e11d2a;
}

.otp-box:focus {
  border-color: #e11d2a;
  box-shadow: 0 0 0 4px rgba(225, 29, 42, 0.12);
  transform: translateY(-2px) scale(1.05);
  background: #ffffff;
}

.otp-box:not(:placeholder-shown) {
  border-color: #fa1818;
  background: #ffffff;
  color: #e61515;
}

/* Verifying state */
.otp-verifying {
  pointer-events: none;
  opacity: 0.6;
}

.otp-verifying .otp-box {
  border-color: #fbbf24;
  animation: verifyPulse 1s ease infinite;
}

@keyframes verifyPulse {

  0%,
  100% {
    border-color: #fbbf24;
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.2);
  }

  50% {
    border-color: #f59e0b;
    box-shadow: 0 0 0 6px rgba(251, 191, 36, 0.3);
  }
}

/* ===== BUTTON ===== */
.cs_btn.cs_style_1 {
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e11d2a 0%, #c81e2c 100%);
  color: #ffffff;
  font-weight: 600;
  font-size: 16px;
  border: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(225, 29, 42, 0.3);
  outline: none;
}

.cs_btn.cs_style_1:hover {
  background: linear-gradient(135deg, #c81e2c 0%, #a0161f 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(225, 29, 42, 0.4);
}

.cs_btn.cs_style_1:active {
  transform: translateY(0);
}

/* ===== LINKS ===== */
.cs_login_links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
  flex-wrap: wrap;
  gap: 12px;
}

.cs_remember {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cs_remember input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #e11d2a;
}

.cs_remember label {
  font-size: 14px;
  color: #6b7280;
  cursor: pointer;
  margin: 0;
}

.cs_login_link {
  color: #e11d2a;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.3s ease;
}

.cs_login_link:hover {
  color: #c81e2c;
  text-decoration: underline;
}

.cs_divider {
  text-align: center;
  margin: 28px 0;
  position: relative;
}

.cs_divider::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
  background: #e5e7eb;
}

.cs_divider span {
  background: #ffffff;
  padding: 0 16px;
  color: #9ca3af;
  font-size: 14px;
  position: relative;
}

.cs_signup_text {
  text-align: center;
  font-size: 14px;
  color: #6b7280;
}

/* ===== IMAGE ===== */
.cs_login_illustration img {
  max-width: 95%;
}

/* ===== LOADING STATE ===== */
.cs_btn.loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
}

.cs_btn.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 3px solid transparent;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ===== MOBILE ===== */
@media (max-width: 991px) {
  .cs_login_wrapper {
    /* Ensure background stays nice */
    background-position: center;
    padding: 20px 0;
    /* Add vertical breathing room */
    display: flex;
    align-items: center;
    /* Vertically center the content */
    min-height: 100vh;
  }

  /* Hide Desktop Elements */
  .cs_login_brand,
  .cs_login_illustration {
    display: none !important;
  }

  .cs_login_overlay {
    background: rgba(255, 255, 255, 0.98);
    /* Slightly more opaque for readability */
  }

  .cs_login_card {
    padding: 40px 30px;
    max-width: 420px;
    /* Limit width for tablet/large phone */
    margin: 0 auto;
    /* Center horizontally */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    /* Softer shadow */
  }

  .cs_login_card h2 {
    font-size: 26px;
  }

  /* Fix for Centering: Override Bootstrap min-vh-100 on mobile to let wrapper handle it */
  .min-vh-100 {
    min-height: auto !important;
    height: auto !important;
  }
}

@media (max-width: 576px) {
  .cs_login_wrapper {
    padding: 15px;
    /* Ensure card doesn't touch screen edges */
    align-items: center;
    background: #f4f6f8;
    /* Fallback color */
  }


  /* LOGO on Mobile */
  .d-lg-none.text-center.mb-4 img {
    max-width: 140px !important;
    /* Slightly smaller logo */
    margin-bottom: 5px;
  }

  /* CARD STYLING */
  .cs_login_card {
    padding: 30px 24px;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    /* Very subtle on mobile */
    margin: 0;
    width: 100%;
  }

  .cs_login_card h2 {
    font-size: 24px;
    margin-bottom: 6px;
  }

  .cs_login_card p {
    font-size: 14px;
    margin-bottom: 25px;
  }

  /* INPUTS */
  .cs_input_group {
    margin-bottom: 16px;
  }

  .cs_input_label {
    font-size: 13px;
    margin-bottom: 6px;
  }

  .cs_input_group input {
    height: 50px;
    /* Touch friendly but not huge */
    font-size: 16px;
    /* Prevents iOS zoom on focus */
    padding-left: 48px;
    border-radius: 10px;
  }

  .cs_input_icon {
    font-size: 16px;
    left: 16px;
  }

  /* BUTTONS */
  .cs_btn.cs_style_1 {
    height: 50px;
    font-size: 15px;
    border-radius: 10px;
    margin-top: 10px !important;
    /* spacing adjustment */
  }

  /* SWITCH TOGGLES */
  .cs_switch_toggle {
    right: 8px;
    padding: 4px;
  }

  .cs_switch_btn {
    width: 32px;
    height: 32px;
  }

  .cs_switch_btn i {
    font-size: 14px;
  }

  /* LINKS & EXTRAS */
  .cs_login_links {
    flex-direction: row;
    /* Keep standard if space allows */
    justify-content: space-between;
    margin: 15px 0;
  }

  .cs_forgot_pass {
    font-size: 13px !important;
  }

  /* OTP Adjustments */
  .otp-box {
    width: 42px;
    height: 50px;
    font-size: 20px;
    border-radius: 8px;
  }

  .otp-inputs {
    gap: 6px;
  }

  #otpInputSection {
    padding: 20px 15px;
  }
}