/* ========================================================
   THRM EDUTECH - AUTHENTICATION MODAL & PROFILE STYLES
   ======================================================== */

.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-modal-backdrop.active {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.auth-modal-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 26px;
  max-width: 470px;
  width: 100%;
  position: relative;
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 
    0 30px 80px -15px rgba(15, 23, 42, 0.3),
    0 0 0 1px rgba(37, 99, 235, 0.08),
    0 10px 30px -5px rgba(37, 99, 235, 0.08);
  transform: scale(0.94) translateY(16px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  padding: 0;
}

.auth-modal-backdrop.active .auth-modal-card {
  transform: scale(1) translateY(0);
}

.auth-card-top-accent {
  height: 5px;
  width: 100%;
  background: linear-gradient(90deg, #2563EB 0%, #7C3AED 50%, #06B6D4 100%);
}

.auth-card-glow-mesh {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.12) 0%, rgba(124, 58, 237, 0.06) 50%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.auth-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  z-index: 10;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.auth-modal-close:hover {
  background: #EEF2F6;
  color: #0F172A;
  border-color: #CBD5E1;
  transform: rotate(90deg) scale(1.06);
}

.auth-modal-header {
  padding: 30px 32px 0;
  position: relative;
  z-index: 1;
}

.auth-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.auth-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.auth-brand-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.06));
}

.auth-brand-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.22rem;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.015em;
  line-height: 1;
}

.brand-gradient-txt {
  background: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-security-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #059669;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 4px 10px;
  border-radius: 9999px;
  letter-spacing: 0.01em;
}

.auth-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.58rem;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.025em;
  margin: 0 0 6px 0;
}

.auth-desc {
  font-size: 0.88rem;
  color: #64748B;
  line-height: 1.52;
  margin: 0 0 20px 0;
}

.auth-tab-pills {
  margin: 0 32px 18px;
  display: flex;
  background: #F1F5F9;
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
  position: relative;
  z-index: 1;
}

.auth-tab-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: #64748B;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-tab-btn.active {
  background: #ffffff;
  color: #2563EB;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
}

.auth-alert {
  margin: 0 32px 16px;
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-alert.error {
  background: #FEF2F2;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #B91C1C;
}

.auth-alert.success {
  background: #ECFDF5;
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #047857;
}

.auth-form {
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  position: relative;
  z-index: 1;
}

.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.auth-input-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-input-group label i {
  color: #2563EB;
  font-size: 0.8rem;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix-icon {
  position: absolute;
  left: 14px;
  color: #94A3B8;
  font-size: 0.88rem;
  pointer-events: none;
  z-index: 2;
}

.auth-input-wrapper input {
  width: 100%;
  padding: 12px 42px 12px 42px;
  border-radius: 12px;
  border: 1.5px solid #E2E8F0;
  background: #F8FAFC;
  font-family: inherit;
  font-size: 0.92rem;
  color: #0F172A;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-input-wrapper input:focus {
  outline: none;
  background: #ffffff;
  border-color: #2563EB;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.btn-toggle-pwd {
  position: absolute;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #94A3B8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-auth-submit {
  margin-top: 6px;
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 45%, #7C3AED 100%);
  color: #ffffff;
  border: none;
  padding: 14px 24px;
  border-radius: 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 24px -4px rgba(37, 99, 235, 0.38);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -4px rgba(37, 99, 235, 0.48);
}

.auth-features-strip {
  margin: 18px 32px 0;
  padding-top: 16px;
  border-top: 1px dashed #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.auth-feature-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
}

.auth-feature-pill .text-accent-blue { color: #2563EB; }
.auth-feature-pill .text-accent-purple { color: #7C3AED; }
.auth-feature-pill .text-accent-green { color: #059669; }

.auth-modal-footer {
  padding: 14px 32px 28px;
  text-align: center;
  font-size: 0.83rem;
  color: #64748B;
}

.auth-modal-footer a {
  color: #2563EB;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* User profile button & dropdown */
.nav-auth-slot {
  display: inline-flex;
  align-items: center;
}

.btn-auth-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: #ffffff;
  border: 1.5px solid #E2E8F0;
  border-radius: 9999px;
  color: #0F172A;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
  transition: all 0.2s ease;
}

.btn-auth-trigger:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
  color: #2563EB;
}

.user-profile-menu-wrap {
  position: relative;
  display: inline-block;
}

.user-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  background: #ffffff;
  border: 1.5px solid #E2E8F0;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-avatar-pill {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563EB, #7C3AED);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
}

.user-name-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0F172A;
}

.user-dropdown-card {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  background: #ffffff;
  border: 1px solid #E2E8F0;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
  padding: 16px;
  display: none;
  z-index: 1000;
}

.user-dropdown-card.active {
  display: block !important;
}

/* ========================================================
   MOBILE RESPONSIVE STYLES (≤ 540px)
   Seamless, production-grade responsive fit on all mobile viewports
   ======================================================== */
@media (max-width: 540px) {
  .auth-modal-backdrop {
    padding: 12px !important;
    align-items: center !important;
  }

  .auth-modal-card {
    border-radius: 20px !important;
    max-height: 92vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin: auto !important;
  }

  .auth-modal-header {
    padding: 22px 18px 0 !important;
  }

  .auth-title {
    font-size: 1.25rem !important;
    margin-bottom: 4px !important;
  }

  .auth-desc {
    font-size: 0.8rem !important;
    line-height: 1.4 !important;
  }

  .auth-tab-pills {
    margin: 14px 18px 0 !important;
    padding: 3px !important;
  }

  .auth-tab-btn {
    padding: 7px 10px !important;
    font-size: 0.78rem !important;
  }

  .auth-form {
    padding: 16px 18px 20px !important;
  }

  .auth-input-group {
    margin-bottom: 12px !important;
  }

  .auth-input-group label {
    font-size: 0.75rem !important;
    margin-bottom: 5px !important;
  }

  .auth-input-wrapper input {
    padding: 10px 12px 10px 36px !important;
    font-size: 0.85rem !important;
  }

  .input-prefix-icon {
    font-size: 0.85rem !important;
    left: 12px !important;
  }

  .btn-auth-submit {
    padding: 11px 16px !important;
    font-size: 0.86rem !important;
    margin-top: 6px !important;
  }

  .auth-modal-footer {
    padding: 12px 18px !important;
    font-size: 0.76rem !important;
  }

  .user-dropdown-card {
    position: fixed !important;
    top: auto !important;
    bottom: 20px !important;
    left: 16px !important;
    right: 16px !important;
    width: auto !important;
    border-radius: 20px !important;
    box-shadow: 0 10px 35px rgba(15, 23, 42, 0.25) !important;
  }
}
