/**
 * Auth / login1 — premium Liquid Glass account surface.
 */

.bp-auth {
  position: relative;
  z-index: 1;
  min-height: calc(100dvh - 96px);
  display: grid;
  place-items: center;
  padding: clamp(1.25rem, 4vw, 2.5rem) var(--bp-gutter, 24px) 3rem;
}

.bp-auth .login-container,
.bp-auth__card {
  width: min(100%, 460px);
  padding: clamp(1.55rem, 3.2vw, 2.1rem);
  border-radius: 28px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.05) 40%, transparent 100%),
    rgba(12, 12, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(36px) saturate(170%);
  -webkit-backdrop-filter: blur(36px) saturate(170%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 28px 70px rgba(0, 0, 0, 0.42);
  isolation: isolate;
  position: relative;
  overflow: hidden;
}

.bp-auth .login-container::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 10% -10%, rgba(129, 140, 248, 0.22), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 38%);
  opacity: 0.9;
}

.bp-auth .login-container > * {
  position: relative;
  z-index: 1;
}

.login-header {
  text-align: center;
  margin-bottom: 1.35rem;
}

.login-logo {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  object-fit: cover;
  margin: 0 auto 0.95rem;
  display: block;
  box-shadow:
    0 0 0 1px rgba(129, 140, 248, 0.4),
    0 14px 32px rgba(0, 0, 0, 0.35);
}

.login-title {
  margin: 0 0 0.4rem;
  font-family: var(--bp-font-display, "Space Grotesk", sans-serif);
  font-size: clamp(1.65rem, 3.2vw, 2rem);
  font-weight: 750;
  letter-spacing: -0.035em;
  color: #f5f5f7;
}

.login-subtitle {
  margin: 0;
  color: var(--bp-text-2, #c0c0c8);
  font-size: 0.95rem;
  line-height: 1.45;
}

.firebase-config-note {
  display: none;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.28);
  color: var(--bp-text-2, #c0c0c8);
  font-size: 0.84rem;
}
.firebase-config-note.is-visible { display: block; }

.login-form {
  display: grid;
  gap: 0.75rem;
}

/* Social providers — keep grid (inline display:block used to kill gap) */
#socialForm.login-form {
  display: grid !important;
  gap: 1.35rem;
}

#socialForm .btn-google,
#socialForm .btn-github,
#socialForm .btn-discord {
  margin: 0;
}

#socialForm .feature-pills {
  margin-top: 0.25rem;
}

.btn-google,
.btn-github,
.btn-discord,
.btn-primary,
.btn-logout {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 48px;
  padding: 0.85rem 1rem !important;
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  font-weight: 650 !important;
  font-size: 0.95rem !important;
  cursor: pointer;
  transition: transform 160ms ease, background 200ms ease, border-color 200ms ease, box-shadow 200ms ease !important;
  text-decoration: none !important;
}

.btn-google {
  background: rgba(255, 255, 255, 0.94) !important;
  color: #1f2937 !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18) !important;
}
.btn-google img { width: 18px; height: 18px; }

.btn-github {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}

.btn-discord {
  background: rgba(88, 101, 242, 0.38) !important;
  border-color: rgba(88, 101, 242, 0.55) !important;
  color: #fff !important;
}

.btn-primary {
  background: rgba(129, 140, 248, 0.36) !important;
  border-color: rgba(129, 140, 248, 0.5) !important;
  color: #fff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16) !important;
}

.btn-logout {
  background: rgba(248, 113, 113, 0.16) !important;
  border-color: rgba(248, 113, 113, 0.35) !important;
  color: #fecaca !important;
  margin-top: 0.85rem;
}

.btn-google:hover,
.btn-github:hover,
.btn-discord:hover,
.btn-primary:hover,
.btn-logout:hover {
  transform: translateY(-1px);
}

.btn-github:hover { background: rgba(255, 255, 255, 0.14) !important; }
.btn-discord:hover { background: rgba(88, 101, 242, 0.5) !important; }
.btn-primary:hover { background: rgba(129, 140, 248, 0.48) !important; }

.discord-notice {
  display: none;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: rgba(129, 140, 248, 0.12);
  border: 1px solid rgba(129, 140, 248, 0.28);
  color: var(--bp-text-2, #c0c0c8);
  font-size: 0.82rem;
}
.discord-notice.is-visible { display: block; }

.feature-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--bp-text-2, #c0c0c8);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sub-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}
.sub-tab {
  text-align: center;
  padding: 0.55rem 0.4rem;
  border-radius: 10px;
  font-size: 0.82rem;
  color: var(--bp-text-3, #888896);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  cursor: pointer;
}
.sub-tab.active {
  color: #fff;
  background: rgba(129, 140, 248, 0.22);
  border-color: rgba(129, 140, 248, 0.35);
}
.sub-form { display: none; }
.sub-form.active { display: block; }

.form-group { margin-bottom: 0.85rem; }
.form-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  color: var(--bp-text-2, #c0c0c8);
}
.input-wrapper { position: relative; }
.form-input,
.form-input.with-icon {
  width: 100%;
  padding: 0.8rem 0.9rem 0.8rem 2.4rem !important;
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--bp-text, #f5f5f7) !important;
}
.input-wrapper > i {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bp-text-3, #888896);
  pointer-events: none;
}
.password-toggle {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--bp-text-3, #888896);
  cursor: pointer;
}
.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin: 0.35rem 0 0.85rem;
  font-size: 0.82rem;
  color: var(--bp-text-3, #888896);
}
.forgot-password { color: var(--bp-accent-2, #a5b4fc); }

.error-message {
  display: none;
  margin-bottom: 0.65rem;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #fecaca;
  font-size: 0.84rem;
}
.error-message:not(:empty) { display: block; }
.success-message {
  display: none;
  margin-bottom: 0.65rem;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #a7f3d0;
  font-size: 0.84rem;
}
.success-message:not(:empty) { display: block; }

/* Logged-in account card — app-like */
.logged-in-view {
  display: none;
  text-align: center;
}
.logged-in-view.active { display: block; }

.login-account-card {
  padding: 1.15rem 1rem 1.05rem;
  border-radius: 20px;
  background:
    linear-gradient(160deg, rgba(129, 140, 248, 0.18) 0%, rgba(255, 255, 255, 0.04) 48%, transparent 100%),
    rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.login-account-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a5b4fc;
}

.user-avatar {
  width: 84px;
  height: 84px;
  margin: 0 auto 0.85rem;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.55), rgba(99, 102, 241, 0.35));
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  font-size: 1.75rem;
  font-weight: 750;
  color: #fff;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}
.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.user-name {
  font-weight: 750;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: #f5f5f7;
}

.user-email {
  color: var(--bp-text-2, #c0c0c8);
  font-size: 0.92rem;
  margin-top: 0.28rem;
  word-break: break-word;
}

.login-account-badge {
  display: inline-flex;
  margin-top: 0.55rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c7d2fe;
  background: rgba(129, 140, 248, 0.18);
  border: 1px solid rgba(129, 140, 248, 0.32);
}

.user-id {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--bp-text-3, #888896);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.user-id code {
  font-family: var(--bp-font-mono, "IBM Plex Mono", monospace);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: none;
  color: #d4d4dc;
  word-break: break-all;
}

.back-home {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.95rem;
  color: var(--bp-accent-2, #a5b4fc);
  font-size: 0.9rem;
  text-decoration: none;
}

body.app-embed .bp-chrome,
body.app-embed #bp-header { display: none !important; }
body.app-embed .bp-auth {
  min-height: 100dvh;
  padding: 1rem;
}
body.app-embed .login-container {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

html[data-theme="light"] .bp-auth .login-container {
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.82)),
    rgba(255, 255, 255, 0.78);
  border-color: rgba(15, 20, 40, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 22px 48px rgba(15, 20, 40, 0.1);
}
html[data-theme="light"] .login-title,
html[data-theme="light"] .user-name {
  color: #12131a;
}
html[data-theme="light"] .login-subtitle,
html[data-theme="light"] .user-email {
  color: #3f4558;
}
html[data-theme="light"] .login-account-card {
  background:
    linear-gradient(160deg, rgba(79, 70, 229, 0.1), rgba(255, 255, 255, 0.65));
  border-color: rgba(15, 20, 40, 0.1);
}
html[data-theme="light"] .btn-github {
  background: rgba(15, 20, 40, 0.06) !important;
  color: #12131a !important;
}

html[data-theme="light"] .bp-menu,
html[data-theme="light"] .user-dropdown {
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.82)),
    rgba(255, 255, 255, 0.88) !important;
  border-color: rgba(15, 20, 40, 0.12) !important;
}
html[data-theme="light"] .bp-menu::before {
  background: rgba(255, 255, 255, 0.75);
}
html[data-theme="light"] .bp-menu__name {
  color: #12131a;
}
