/* Popup Overlay */
.login-popup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffffbd;
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* Popup Container */
.login-container {
  background: #ffffff00;
  backdrop-filter: blur(7px);
  border-radius: 16px;
  width: 100%;
  max-width: 824px;
  display: flex;
  overflow: hidden;
  box-shadow: 0 0px 5px rgba(0, 0, 0, 0.15);
  position: relative;
  min-height: 500px;
  height: auto;
  /* align-items: stretch; */
  padding: 12px;
}

.login-left,
.login-right {
  width: 50%;
  max-width: 50%;
  min-width: 50%;
}

/* Close Button */
.close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 10;
  padding: 5px;
  transition: opacity 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  fill: #1c1b1f;
  background: #ffffff00;
  border-radius: 50%;
  backdrop-filter: blur(4px);
}

.close-btn:hover {
  opacity: 0.7;
}

.close-btn svg {
  width: 24px;
  height: 24px;
  /* stroke: #333; */
  stroke: #fff;
  stroke-width: 2;
}

/* Left Side - Form */
.login-left {
  flex: 1;
  padding: 32px 48px;
  display: flex;
  flex-direction: column;
  /* background: white; */
}

/* Logo */
.logo-wrapper {
  /* margin-bottom: 35px; */
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 60px;
}

.logo {
  width: 38px;
  height: 38px;
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Header */
.login-left h1 {
  color: #000;
  font-size: 28px;
  font-weight: 600;
  line-height: 44px;
  letter-spacing: 0px;
  margin-bottom: 32px;
}

.signup-link {
  color: #666;
  /* margin-bottom: 35px; */
  font-size: 12px;
  font-weight: normal;
  line-height: 16px;
  letter-spacing: 0px;
}

.signup-link a {
  color: #0075b8;
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
}

.signup-link a:hover {
  text-decoration: none;
}

/* Form Elements */
.form-group {
  position: relative;
  margin-bottom: 20px;
}

.form-group label {
  color: #0075b8;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0px;
  width: max-content;
  height: auto;
  gap: 10px;
  padding: 0px 4px;
  position: absolute;
  top: -8px;
  left: 15px;
  background: #ffffff;
  z-index: 1;
  border-radius: 3px;
}

.input-wrapper {
  position: relative;
}

.form-group input {
  width: 100%;
  height: 52px;
  padding: 12px 16px;
  border: 1.5px solid #0075b8;
  border-radius: 10px;
  font-size: 14px;
  /* transition: all 0.3s ease; */
  /* color: #333; */
}

.form-group input:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-group input.error {
  border-color: #dc3545;
}

.form-group input.error:focus {
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.error-text {
  color: #dc3545;
  font-size: 12px;
  margin-top: 5px;
  display: none;
}

.error-text.show {
  display: block;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-password svg {
  width: 20px;
  height: 20px;
  color: #999;
}

.login-btn {
  width: 100%;
  background: #0066cc;
  color: white;
  border: none;
  padding: 14px;
  border-radius: 50px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
  /* margin-bottom: 32px; */
  margin-bottom: 20px;
  /* margin-top: 5px; */
}

.login-btn:hover:not(:disabled) {
  background: #0052a3;
}

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

.forgot-password {
  text-align: left;
  /* margin-top: 15px; */
}

.forgot-password a {
  color: #0066cc;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
}

.forgot-password a:hover {
  text-decoration: none;
}

.error-message {
  background: #fee;
  color: #c33;
  /* padding: 12px 16px; */
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 13px;
  display: none;
  border: 1px solid #fcc;
}

.error-message.show {
  display: block;
}

/* Right Side - Image */
.login-right {
  flex: 1;
  /* background: linear-gradient(135deg, #e8f0f7 0%, #f5f8fa 100%); */
  display: flex;
  align-items: center;
  justify-content: center;
  /* margin: 12px; */
  padding: 12px;
  position: relative;
  overflow: hidden;
}

.classroom-image {
  width: 100%;
  height: 100%;
  /* max-height: 500px; */
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 12px;
  overflow: hidden;
}

.community-badge {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #00000040;
  padding: 8px 16px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(30px);
  z-index: 2;
  width: max-content;
}

.community-badge span {
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0px;
}

.community-badge span img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  object-position: center;
}

/* Responsive */
@media (max-width: 768px) {
  .login-container {
    flex-direction: column;
    min-height: auto !important;
    padding: 25px;
  }

  .login-right {
    display: none;
  }

  .login-left {
    padding: 0px;
  }

  .close-btn {
    top: 15px;
    right: 15px;
  }

  .login-left,
  .login-right {
    width: 100%;
    max-width: 100%;
    min-width: 100%;
  }

  .login-left h1 {
    font-size: 18px;
  }

  .login-title {
    order: 1;
  }

  form#loginForm {
    order: 2;
  }

  .error-message {
    order: 3;
  }

  .forgot-password {
    order: 4;
  }

  .logo-wrapper {
    order: 5;
    justify-content: center;
    margin-top: 50px;
    margin-bottom: 0px;
  }

  .logo-wrapper .logo {
    display: none;
  }

  .close-btn svg {
    stroke: #333;
  }
}

/* ── Session Conflict UI ── */

.session-conflict-box {
  display: none;
  margin-bottom: 16px;
}

.session-conflict-msg {
  background: #fff0f0;
  color: #c0392b;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}

.session-conflict-msg svg {
  flex-shrink: 0;
  margin-top: 1px;
  width: 16px;
  height: 16px;
}

.force-login-btn {
  width: 100%;
  background: transparent;
  color: #c0392b;
  border: 1.5px solid #c0392b;
  padding: 13px;
  border-radius: 50px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
  margin-bottom: 16px;
}

.force-login-btn:hover:not(:disabled) {
  background: #fff0ee;
}

.force-login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── New Multi-Screen Login Additions ── */

.login-screen {
  display: flex;
  flex-direction: column;
}

.login-subtitle {
  font-size: 13px;
  color: #555;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Bottom links row (Forgot Password / Login with Password) */
.login-bottom-links {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}

.login-bottom-links a {
  color: #0066cc;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
}

.login-bottom-links a:hover {
  text-decoration: none;
}

/* Change number row */
.change-number-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
}

.change-number-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #0066cc;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.change-number-link:hover {
  text-decoration: none;
}

.phone-display {
  font-size: 13px;
  color: #444;
  padding-left: 2px;
}

/* OTP sent info box */
.otp-sent-info {
  background: #e8f4ff;
  color: #0066cc;
  border: 1px solid #b3d9ff;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  text-align: center;
}

/* OTP label */
.otp-label {
  font-size: 13px;
  color: #333;
  margin-bottom: 10px;
  text-align: center;
}

/* OTP input boxes */
.otp-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.otp-box {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  border: 1.5px solid #0075b8;
  border-radius: 10px;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  color: #111;
  background: transparent;
}

.otp-box:focus {
  border-color: #0052a3;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

/* Resend row */
.resend-row {
  text-align: center;
  margin-bottom: 8px;
}

.resend-link {
  color: #0066cc;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.resend-link:hover {
  text-decoration: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .otp-box {
    width: 38px;
    height: 46px;
    font-size: 18px;
  }

  .otp-inputs {
    gap: 7px;
  }

  .login-bottom-links {
    flex-direction: row;
    gap: 8px;
    align-items: flex-start;
  }

  .login-screen {
    order: unset;
  }

  .login-bottom-links a {
    font-size: 11px !important;
  }
}
/* ══════════════════════════════════════════════════════════════════ */
/* Sign Up Popup Additions                                            */
/* ══════════════════════════════════════════════════════════════════ */

/* Signup popup uses .login-popup base styles — just needs display:flex
   on open (handled by JS). No extra wrapper styles needed. */

/* Animate signup popup in (matches login popup feel) */
#signupPopup .login-container {
  animation: popupFadeIn 0.2s ease;
}

@keyframes popupFadeIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* "Already have an account?" row — reuse .signup-link + .have-account */
/* No extra rules needed; these are already defined above. */

/* Signup form spacing — slightly more breathing room between fields */
#signupPopup .form-group {
  margin-bottom: 22px;
}

/* Subtle success / info tint on the OTP sent box within signup */
#screen-signup-otp .otp-sent-info {
  background: #e8f4ff;
  color: #0066cc;
  border: 1px solid #b3d9ff;
}

/* Responsive — signup popup mirrors login responsive behaviour */
@media (max-width: 768px) {
  #signupPopup .login-container {
    flex-direction: column;
    min-height: auto !important;
    padding: 25px;
  }

  #signupPopup .login-right {
    display: none;
  }

  #signupPopup .login-left {
    padding: 0px;
  }

  #signupPopup .login-left,
  #signupPopup .login-right {
    width: 100%;
    max-width: 100%;
    min-width: 100%;
  }

  #signupPopup .login-left h1 {
    font-size: 18px;
  }

  #signupPopup .close-btn svg {
    stroke: #333;
  }

  #signupPopup .logo-wrapper {
    justify-content: center;
    margin-top: 50px;
    margin-bottom: 0px;
  }

  #signupPopup .logo-wrapper .logo {
    display: none;
  }

  .force-login-btn {
    font-size: 12px !important;
  }
}
