/* =========================
   BSF ACADEMY - Auth Pages CSS
   Blue Theme
   ========================= */

/* Auth Page Layout */
.authPage {
  min-height: calc(100vh - 180px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.authContainer {
  width: 100%;
  max-width: 520px;
}

/* Auth Card */
.authCard {
  background: var(--glass2);
  border: 1px solid var(--stroke);
  border-radius: var(--r-xl);
  padding: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Logo Section */
.authLogo {
  text-align: center;
  margin-bottom: 24px;
}

.authLogoRing {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--brand-light), var(--brand-dark));
  padding: 3px;
  box-shadow: 0 12px 32px rgba(30, 58, 95, 0.3);
}

.authLogoRing img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.authTitle {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin: 0 0 4px;
  color: var(--text);
}

.authSubtitle {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  margin: 0;
}

/* Alert Messages */
.alertBox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  margin-bottom: 20px;
  font-size: 13px;
  font-weight: 600;
}

.alertBox [data-lucide] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.alertError {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #dc2626;
}

.alertSuccess {
  background: rgba(43, 108, 176, 0.1);
  border: 1px solid rgba(43, 108, 176, 0.3);
  color: #1e3a5f;
}

/* Tabs */
.authTabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  background: var(--bg1);
  padding: 6px;
  border-radius: var(--r-md);
}

.authTab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all .2s ease;
}

.authTab [data-lucide] {
  width: 16px;
  height: 16px;
}

.authTab:hover {
  color: var(--text);
}

.authTab.active {
  background: var(--bg2);
  color: var(--brand);
  box-shadow: var(--shadow-xs);
}

/* Forms */
.authForm {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.authForm.hidden {
  display: none;
}

.formGroup {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.formRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 500px) {
  .formRow {
    grid-template-columns: 1fr;
  }
}

.formLabel {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.formLabel [data-lucide] {
  width: 14px;
  height: 14px;
  opacity: .7;
}

.formInput {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--stroke);
  border-radius: var(--r-sm);
  background: var(--bg2);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: all .2s ease;
}

.formInput::placeholder {
  color: var(--muted2);
}

.formInput:hover {
  border-color: var(--brand);
}

.formInput:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.15);
}

.inputWithIcon {
  position: relative;
}

.inputWithIcon .formInput {
  padding-right: 46px;
}

.togglePassword {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-xs);
  transition: all .2s ease;
}

.togglePassword:hover {
  color: var(--brand);
  background: rgba(30, 58, 95, 0.1);
}

.togglePassword [data-lucide] {
  width: 18px;
  height: 18px;
}

.formHint {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 8px;
}

.formActions {
  display: flex;
  justify-content: flex-end;
}

.forgotLink {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}

.forgotLink:hover {
  text-decoration: underline;
}

/* Account Type Selector */
.typeSelector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 500px) {
  .typeSelector {
    grid-template-columns: 1fr;
  }
}

.typeOption {
  cursor: pointer;
}

.typeOption input {
  display: none;
}

.typeCard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  border: 2px solid var(--stroke);
  border-radius: var(--r-md);
  background: var(--bg2);
  text-align: center;
  transition: all .2s ease;
}

.typeCard [data-lucide] {
  width: 32px;
  height: 32px;
  color: var(--muted);
  transition: all .2s ease;
}

.typeName {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.typeDesc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.typeOption input:checked + .typeCard {
  border-color: var(--brand);
  background: rgba(30, 58, 95, 0.08);
}

.typeOption input:checked + .typeCard [data-lucide] {
  color: var(--brand);
}

.typeOption:hover .typeCard {
  border-color: var(--brand);
}

/* Categories Box */
.categoriesBox {
  max-height: 280px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  background: var(--bg1);
}

.categoryGroup {
  margin-bottom: 12px;
  --cat-color: var(--brand);
}

.categoryGroup:last-child {
  margin-bottom: 0;
}

.categoryParent {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-xs);
  cursor: pointer;
  transition: background .15s ease;
}

.categoryParent:hover {
  background: rgba(0,0,0,.04);
}

html[data-theme="dark"] .categoryParent:hover {
  background: rgba(255,255,255,.04);
}

.categoryParent .catLabel {
  font-size: 13px;
  font-weight: 700;
  color: var(--cat-color, var(--brand));
}

.categoryChildren {
  margin-left: 24px;
  padding-left: 12px;
  border-left: 2px solid var(--stroke);
}

.categoryChild {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--r-xs);
  cursor: pointer;
  transition: background .15s ease;
}

.categoryChild:hover {
  background: rgba(0,0,0,.04);
}

html[data-theme="dark"] .categoryChild:hover {
  background: rgba(255,255,255,.04);
}

.categoryChild .catLabel {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
}

.catCheckbox {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
  cursor: pointer;
}

/* Buttons */
.btnLg {
  height: 48px;
  font-size: 14px;
}

/* Social Login */
.socialDivider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
}

.socialDivider::before,
.socialDivider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--stroke);
}

.socialDivider span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.socialButtons {
  display: flex;
  gap: 10px;
}

.socialBtn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--stroke);
  border-radius: var(--r-sm);
  background: var(--bg2);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}

.socialBtn:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-xs);
}

.socialBtn.is-disabled,
.socialBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.socialIcon {
  width: 18px;
  height: 18px;
}

@media (max-width: 500px) {
  .socialBtn span {
    display: none;
  }

  .socialBtn {
    padding: 0;
    justify-content: center;
  }
}

/* Auth Switch */
.authSwitch {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

.linkBtn {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  font-weight: 700;
  color: var(--brand);
  cursor: pointer;
}

.linkBtn:hover {
  text-decoration: underline;
}

/* Mobile Adjustments */
@media (max-width: 560px) {
  .authPage {
    padding: 24px 12px;
  }

  .authCard {
    padding: 24px 20px;
  }

  .authLogoRing {
    width: 60px;
    height: 60px;
  }

  .authTitle {
    font-size: 20px;
  }

  .authTab {
    padding: 10px 12px;
    font-size: 12px;
  }

  .formInput {
    height: 44px;
    font-size: 13px;
  }

  .typeCard {
    padding: 16px 12px;
  }

  .typeCard [data-lucide] {
    width: 28px;
    height: 28px;
  }

  .typeName {
    font-size: 13px;
  }

  .typeDesc {
    font-size: 10px;
  }

  .categoriesBox {
    max-height: 220px;
  }
}

/* Scrollbar for categories */
.categoriesBox::-webkit-scrollbar {
  width: 6px;
}

.categoriesBox::-webkit-scrollbar-track {
  background: transparent;
}

.categoriesBox::-webkit-scrollbar-thumb {
  background: var(--muted2);
  border-radius: 3px;
}

.categoriesBox::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* RTL Support */
html[dir="rtl"] .formRow {
  direction: rtl;
}

html[dir="rtl"] .categoryChildren {
  margin-left: 0;
  margin-right: 24px;
  padding-left: 0;
  padding-right: 12px;
  border-left: none;
  border-right: 2px solid var(--stroke);
}

html[dir="rtl"] .inputWithIcon .formInput {
  padding-right: 14px;
  padding-left: 46px;
}

html[dir="rtl"] .togglePassword {
  right: auto;
  left: 4px;
}

/* ── Site Banner (cross-domain login indicator) ── */
.authSiteBanner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #4338ca;
  font-size: 0.83rem;
  margin-bottom: 4px;
}
.authSiteBanner [data-lucide] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.authSiteBanner strong {
  font-weight: 600;
}
