@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", sans-serif;
  background: #ffffff;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

/* ============================================================
   OUTER CONTAINER
   ============================================================ */
.auth-page {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  overflow: hidden;
}

/* ============================================================
   FORM PANELS (login left, signup right)
   Each panel takes up exactly half the screen at all times.
   The sliding image covers whichever half is inactive.
   ============================================================ */
.auth-form-panel {
  width: 50%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 20px;
}

.login-panel  { left: 0; }
.signup-panel { right: 0; }

/* ── Inner scroll container ── */
.form-inner {
  width: 100%;
  max-width: 420px;
  max-height: 100vh;
  overflow-y: auto;
  padding: 10px 4px 20px;
  scrollbar-width: none;
}
.form-inner::-webkit-scrollbar { display: none; }

/* ── Brand row ── */
.form-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.form-brand img {
  height: 36px;
  width: 36px;
  object-fit: contain;
}
.form-brand span {
  font-size: 15px;
  font-weight: 600;
  color: #1a1d2e;
  letter-spacing: 0.3px;
}

/* ── Headings ── */
.form-inner h2 {
  font-size: 28px;
  font-weight: 700;
  color: #1a1d2e;
  margin-bottom: 6px;
}
.form-sub {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 28px;
}

/* ── Field groups ── */
.field-group {
  position: relative;
  width: 100%;
  margin-bottom: 14px;
}

.field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 14px;
  pointer-events: none;
  z-index: 1;
}

.field-group input,
.field-group select {
  width: 100%;
  height: 48px;
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 0 42px 0 40px;
  font-size: 14px;
  font-family: "Poppins", sans-serif;
  color: #1a1d2e;
  outline: none;
  transition: border-color 0.25s, background 0.25s;
  appearance: none;
  -webkit-appearance: none;
}

.field-group input::placeholder { color: #9ca3af; }
.field-group select option { background: #ffffff; color: #1a1d2e; }

.field-group input:focus,
.field-group select:focus {
  border-color: #f97316;
  background: #ffffff;
}

/* select arrow */
.select-field::after {
  content: "\f107";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
  font-size: 13px;
}

/* ── Eye button ── */
.eye-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  transition: color 0.2s;
}
.eye-btn:hover { color: #f97316; }

/* ── Two-column row ── */
.fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Forgot link ── */
.forgot-link {
  display: block;
  text-align: right;
  font-size: 13px;
  color: #f97316;
  text-decoration: none;
  margin-bottom: 18px;
  margin-top: -4px;
}
.forgot-link:hover { text-decoration: underline; }

/* ── Terms checkbox ── */
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  margin-top: 4px;
}
.check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #f97316;
  cursor: pointer;
  flex-shrink: 0;
}
.check-row label {
  font-size: 13px;
  color: #6b7280;
  cursor: pointer;
}
.check-row a {
  color: #f97316;
  text-decoration: none;
}
.check-row a:hover { text-decoration: underline; }

/* ── Submit button ── */
.submit-btn {
  width: 100%;
  height: 50px;
  background: #f97316;
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  font-family: "Poppins", sans-serif;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  letter-spacing: 0.3px;
}
.submit-btn:hover  { background: #ea6c0a; transform: translateY(-1px); }
.submit-btn:active { transform: translateY(0); }

/* ── Switch hint ── */
.switch-hint {
  text-align: center;
  font-size: 13px;
  color: #6b7280;
  margin-top: 18px;
}
.switch-link {
  background: none;
  border: none;
  color: #f97316;
  font-size: 13px;
  font-family: "Poppins", sans-serif;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.switch-link:hover { color: #ea6c0a; }

/* ── Visit Main Website link ── */
.main-site-link {
  display: block;
  text-align: center;
  font-size: 12px;
  font-family: "Poppins", sans-serif;
  font-weight: 500;
  color: #9ca3af;
  text-decoration: none;
  margin-top: 14px;
  transition: color 0.2s;
}
.main-site-link i {
  font-size: 11px;
}
.main-site-link:hover { color: #f97316; }

/* ── Credit ── */
.page-credit {
  text-align: center;
  font-size: 11px;
  color: #d1d5db;
  margin-top: 20px;
}
.page-credit a {
  color: #9ca3af;
  text-decoration: none;
}
.page-credit a:hover { color: #f97316; }

/* ============================================================
   SLIDING IMAGE PANEL
   Default state  → right half (login is showing on the left)
   .signup-active → left half  (signup is showing on the right)
   ============================================================ */
.image-panel {
  position: absolute;
  top: 0;
  left: 50%;          /* starts on the right half */
  width: 50%;
  height: 100%;
  overflow: hidden;
  transition: left 0.65s cubic-bezier(0.77, 0, 0.175, 1);
  z-index: 10;
  border-radius: 0;
}

/* when signup is active, slide the image panel to cover the LEFT half */
.auth-page.signup-active .image-panel {
  left: 0;
}

/* the actual image fills the panel */
.split-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* dark gradient overlay + branding on top of the image */
.image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 10, 20, 0.55) 0%,
    rgba(10, 10, 20, 0.25) 40%,
    rgba(10, 10, 20, 0.70) 100%
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  text-align: center;
  gap: 14px;
}

.overlay-logo {
  width: 150px;
  height: 150px;
  object-fit: contain;
  margin-bottom: 14px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.image-overlay h1 {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.overlay-tagline {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 1px;
}

/* ============================================================
   FORGOT PASSWORD PANEL
   Sits over the login panel, hidden by default, slides up into view
   ============================================================ */
.forgot-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 20px;
  z-index: 5;
  transform: translateY(100%);
  transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
  pointer-events: none;
}

.forgot-panel.active {
  transform: translateY(0);
  pointer-events: all;
}

/* Back button */
.forgot-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 13px;
  font-family: "Poppins", sans-serif;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  margin-bottom: 28px;
  transition: color 0.2s;
}
.forgot-back-btn:hover { color: #f97316; }
.forgot-back-btn i { font-size: 12px; }

/* ============================================================
   MOBILE — stack vertically, hide image panel
   ============================================================ */
@media (max-width: 768px) {
  .auth-page {
    flex-direction: column;
    overflow-y: auto;
    height: 100dvh;
  }

  .auth-form-panel {
    width: 100%;
    height: auto;
    min-height: 100dvh;
    padding: 40px 24px 60px;
    background: #ffffff;
    align-items: flex-start;
    overflow-y: auto;
  }

  .form-inner {
    max-height: none;
    overflow-y: visible;
    padding-bottom: 40px;
  }

  /* Prevent iOS auto-zoom on input focus — font-size must be >= 16px */
  .field-group input,
  .field-group select {
    font-size: 16px;
  }

  .signup-panel {
    display: none;
  }

  .auth-page.signup-active .signup-panel {
    display: flex;
  }

  .auth-page.signup-active .login-panel {
    display: none;
  }

  .image-panel {
    display: none;
  }

  .fields-row {
    grid-template-columns: 1fr;
  }

  .forgot-panel {
    width: 100%;
    height: 100dvh;
    align-items: flex-start;
    overflow-y: auto;
    padding: 40px 24px 60px;
    z-index: 20;
  }
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.auth-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 14px 16px;
  border-radius: 12px;
  min-width: 280px;
  max-width: 380px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;

  /* start off-screen to the right */
  transform: translateX(calc(100% + 32px));
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.3s ease;
}

/* slide in */
.auth-toast.toast-show {
  transform: translateX(0);
  opacity: 1;
}

/* slide out */
.auth-toast.toast-hide {
  transform: translateX(calc(100% + 32px));
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.25s ease;
}

/* ── Error — muted red ── */
.auth-toast--error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
}
.auth-toast--error .toast-icon { color: #dc2626; }

/* ── Success — muted green ── */
.auth-toast--success {
  background: #f0fdf4;
  border: 1px solid #86efac;
}
.auth-toast--success .toast-icon { color: #16a34a; }

/* ── Icon ── */
.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
}

/* ── Message text ── */
.toast-msg {
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.5;
  color: #374151;
  flex: 1;
}

/* ── Close button ── */
.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  font-size: 12px;
  padding: 2px 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
}
.toast-close:hover { color: #374151; }

/* ── Mobile ── */
@media (max-width: 480px) {
  .auth-toast {
    top: 16px;
    right: 16px;
    left: 16px;
    max-width: unset;
    min-width: unset;
  }
}

/* ============================================================
   SEARCHABLE COURSE PICKER
   ============================================================ */
.course-picker {
  position: relative;
}

.course-picker input[type="text"] {
  width: 100%;
  height: 48px;
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 0 16px 0 40px;
  font-size: 14px;
  font-family: "Poppins", sans-serif;
  color: #1a1d2e;
  outline: none;
  transition: border-color 0.25s;
}
.course-picker input[type="text"]::placeholder { color: #9ca3af; }
.course-picker input[type="text"]:focus {
  border-color: #f97316;
  background: #ffffff;
}

/* selected state — show value in orange */
.course-picker.has-value input[type="text"] {
  color: #f97316;
  font-weight: 500;
  border-color: #f97316;
}

.course-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  max-height: 220px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  scrollbar-width: thin;
  scrollbar-color: #e5e7eb transparent;
}

.course-dropdown.open { display: block; }

.course-option {
  padding: 11px 14px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.15s;
}
.course-option:last-child { border-bottom: none; }
.course-option:hover,
.course-option.highlighted { background: #fff7ed; color: #f97316; }

.course-option-empty {
  padding: 14px;
  font-size: 13px;
  color: #9ca3af;
  text-align: center;
}

.course-loading {
  padding: 14px;
  font-size: 13px;
  color: #9ca3af;
  text-align: center;
}
