/* Pepper Login Experience — scoped strictly to html.pepper-auth-active */

html.pepper-auth-active,
html.pepper-auth-active body {
  background: #08080c !important;
  color: #f4f4f7 !important;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif !important;
  -webkit-font-smoothing: antialiased;
}

/* Hide Huly's default status bar and static background image on auth pages */
html.pepper-auth-active .antiStatusBar {
  display: none !important;
}

html.pepper-auth-active #ui-root {
  position: relative !important;
  z-index: 1 !important;
  background: transparent !important;
}

html.pepper-auth-active #ui-root > .app {
  height: 100vh !important;
  height: 100dvh !important;
  background: transparent !important;
}

html.pepper-auth-active .backd {
  background: transparent !important;
  position: relative !important;
  overflow: hidden !important;
}

html.pepper-auth-active .backd .bg-image > picture,
html.pepper-auth-active .backd .bg-image > .flex-row-center {
  display: none !important;
}

/* Shader canvas + architectural veil */
#pepper-login-shader-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(60% 55% at 18% 22%, rgba(255, 94, 58, 0.22) 0%, rgba(255, 94, 58, 0) 70%),
    radial-gradient(55% 55% at 82% 76%, rgba(124, 92, 255, 0.22) 0%, rgba(124, 92, 255, 0) 70%),
    radial-gradient(45% 45% at 52% 48%, rgba(20, 22, 34, 0.9) 0%, #07070b 100%);
}

#pepper-login-shader {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#pepper-login-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 75% 75% at 50% 50%, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0) 85%);
  -webkit-mask-image: radial-gradient(ellipse 75% 75% at 50% 50%, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0) 85%);
}

#pepper-login-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 32%, rgba(5, 5, 9, 0.62) 100%);
}

/* Main stage layout */
html.pepper-auth-active .backd .bg-image.back {
  position: relative !important;
  z-index: 1 !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: clamp(2.5rem, 6vw, 6.5rem) !important;
  width: 100% !important;
  height: 100% !important;
  padding: clamp(1.25rem, 3vw, 3rem) !important;
  background: transparent !important;
  box-sizing: border-box !important;
  overflow-y: auto !important;
}

/* Editorial hero column (left on wide viewports) */
#pepper-auth-hero {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 440px;
  flex: 0 1 440px;
  color: #f4f4f7;
  user-select: none;
  animation: pepperFadeUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.pepper-hero-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.pepper-brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.pepper-brand-badge svg {
  width: 24px;
  height: 24px;
}

.pepper-brand-name {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.025em;
  color: #ffffff;
}

.pepper-brand-pill {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  color: rgba(255, 198, 178, 0.92);
  background: rgba(255, 94, 58, 0.12);
  border: 1px solid rgba(255, 118, 84, 0.28);
}

.pepper-hero-title {
  margin: 0 0 16px;
  font-size: clamp(32px, 3.6vw, 46px);
  line-height: 1.1;
  font-weight: 650;
  letter-spacing: -0.035em;
  color: #ffffff;
}

.pepper-hero-title-accent {
  background: linear-gradient(100deg, #ffffff 10%, #ffb49a 56%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pepper-hero-sub {
  margin: 0 0 32px;
  font-size: 15px;
  line-height: 1.65;
  color: rgba(226, 228, 238, 0.68);
  max-width: 380px;
}

.pepper-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pepper-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(236, 238, 246, 0.78);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.pepper-meta-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff6e4a;
  box-shadow: 0 0 10px rgba(255, 110, 74, 0.8);
}

.pepper-meta-dot--violet {
  background: #a78bfa;
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.8);
}

.pepper-meta-dot--emerald {
  background: #34d399;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.75);
}

/* Auth glass card (.panel-base) */
html.pepper-auth-active .backd .panel-base {
  position: relative !important;
  inset: auto !important;
  margin: 0 !important;
  width: min(420px, 100%) !important;
  min-width: 0 !important;
  max-width: 420px !important;
  height: auto !important;
  max-height: calc(100dvh - 3rem) !important;
  flex: 0 0 auto !important;
  border-radius: 22px !important;
  background: linear-gradient(
    180deg,
    rgba(16, 17, 24, 0.72) 0%,
    rgba(10, 11, 16, 0.84) 100%
  ) !important;
  border: 1px solid rgba(255, 255, 255, 0.11) !important;
  box-shadow:
    0 32px 84px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 1px 0 rgba(255, 255, 255, 0.16) inset !important;
  backdrop-filter: blur(28px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(150%) !important;
  overflow: hidden !important;
  z-index: 2 !important;
  animation: pepperFadeUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.06s both;
}

/* Remove Huly's default blue radial gradient pseudo-layer */
html.pepper-auth-active .backd .panel-base::after {
  display: none !important;
  content: none !important;
  background: none !important;
}

html.pepper-auth-active .backd .panel-base::before {
  content: "";
  position: absolute;
  top: 0;
  left: 14%;
  right: 14%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 150, 120, 0.55), rgba(167, 139, 250, 0.5), transparent);
  pointer-events: none;
  z-index: 3;
}

html.pepper-auth-active .backd .panel-base .scroller-container,
html.pepper-auth-active .backd .panel-base .horizontalBox,
html.pepper-auth-active .backd .panel-base .scroll,
html.pepper-auth-active .backd .panel-base .box {
  height: auto !important;
  max-height: calc(100dvh - 3rem) !important;
  background: transparent !important;
}

html.pepper-auth-active .backd .panel-base .box {
  padding: 28px 28px 26px !important;
}

html.pepper-auth-active .backd .panel-base .form-content {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Card top brand header (always visible inside card) */
#pepper-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

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

.pepper-card-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 102, 66, 0.24), rgba(139, 92, 246, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.pepper-card-logo svg {
  width: 17px;
  height: 17px;
}

.pepper-card-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: #ffffff;
}

.pepper-card-env {
  font-size: 11px;
  font-weight: 500;
  color: rgba(203, 208, 224, 0.6);
  letter-spacing: 0.02em;
}

/* Inner Svelte form reset & polish */
html.pepper-auth-active .panel-base form.container {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  min-height: 0 !important;
  gap: 0 !important;
}

html.pepper-auth-active .panel-base .caption {
  margin-bottom: 20px !important;
  gap: 14px !important;
}

html.pepper-auth-active .panel-base .caption .title {
  font-size: 22px !important;
  font-weight: 650 !important;
  letter-spacing: -0.025em !important;
  color: rgba(255, 255, 255, 0.36) !important;
  text-decoration: none !important;
  transition: color 0.18s ease !important;
}

html.pepper-auth-active .panel-base .caption .title.selected {
  color: #ffffff !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

html.pepper-auth-active .panel-base .caption .title[data-pepper-hidden="true"] {
  display: none !important;
}

/* Form rows & floating inputs */
html.pepper-auth-active .panel-base .form {
  display: flex !important;
  flex-direction: column !important;
  gap: 14px !important;
}

html.pepper-auth-active .panel-base .form-row {
  margin: 0 !important;
}

html.pepper-auth-active .panel-base .editbox {
  position: relative !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease !important;
}

html.pepper-auth-active .panel-base .editbox:hover {
  border-color: rgba(255, 255, 255, 0.18) !important;
  background: rgba(255, 255, 255, 0.055) !important;
}

html.pepper-auth-active .panel-base .editbox:focus-within {
  border-color: rgba(255, 118, 84, 0.72) !important;
  background: rgba(255, 255, 255, 0.065) !important;
  box-shadow: 0 0 0 3px rgba(255, 102, 66, 0.16) !important;
}

html.pepper-auth-active .panel-base .editbox input {
  color: #ffffff !important;
  background: transparent !important;
  font-size: 14px !important;
  caret-color: #ff7e5f !important;
}

html.pepper-auth-active .panel-base .editbox input:-webkit-autofill,
html.pepper-auth-active .panel-base .editbox input:-webkit-autofill:hover,
html.pepper-auth-active .panel-base .editbox input:-webkit-autofill:focus {
  -webkit-text-fill-color: #ffffff !important;
  -webkit-box-shadow: 0 0 0 1000px #151620 inset !important;
  transition: background-color 9999s ease-in-out 0s;
}

html.pepper-auth-active .panel-base .editbox .label {
  color: rgba(208, 212, 226, 0.56) !important;
}

/* Status banner — subtle inline whisper instead of boxed alert */
html.pepper-auth-active .panel-base .status {
  min-height: 20px !important;
  margin-top: 2px !important;
}

html.pepper-auth-active .panel-base .status .container {
  background: transparent !important;
  border: none !important;
  padding: 2px 2px !important;
  min-height: 0 !important;
  box-shadow: none !important;
}

html.pepper-auth-active .panel-base .status .INFO {
  color: rgba(203, 210, 228, 0.56) !important;
}

html.pepper-auth-active .panel-base .status .ERROR {
  color: #fda4af !important;
}

/* Primary submit button */
html.pepper-auth-active .panel-base .form-row.send {
  margin-top: 4px !important;
}

html.pepper-auth-active .panel-base .form-row.send button.antiButton {
  height: 44px !important;
  border-radius: 12px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
  background: linear-gradient(135deg, #ffffff 0%, #e7e9f2 100%) !important;
  color: #0b0c12 !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28) !important;
  transition: transform 0.15s ease, box-shadow 0.18s ease, opacity 0.18s ease !important;
}

html.pepper-auth-active .panel-base .form-row.send button.antiButton .label {
  color: #0b0c12 !important;
}

html.pepper-auth-active .panel-base .form-row.send button.antiButton:not(:disabled):hover {
  transform: translateY(-1px) !important;
  box-shadow:
    0 12px 30px rgba(255, 102, 66, 0.22),
    0 6px 18px rgba(0, 0, 0, 0.35) !important;
}

html.pepper-auth-active .panel-base .form-row.send button.antiButton:disabled {
  opacity: 0.42 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* Footer & secondary links */
html.pepper-auth-active .panel-base .footer {
  margin-top: 18px !important;
  padding-top: 16px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.07) !important;
  font-size: 13px !important;
  color: rgba(203, 208, 224, 0.56) !important;
}

html.pepper-auth-active .panel-base .footer a,
html.pepper-auth-active .panel-base .actions a {
  color: rgba(235, 238, 248, 0.84) !important;
  text-decoration: none !important;
  transition: color 0.15s ease !important;
}

html.pepper-auth-active .panel-base .footer a:hover,
html.pepper-auth-active .panel-base .actions a:hover {
  color: #ff9c82 !important;
}

html.pepper-auth-active .panel-base .actions {
  margin: 12px 0 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px 16px !important;
  font-size: 13px !important;
}

/* Hide guest login on invite-only instance */
html.pepper-auth-active .panel-base .actions .login-as-guest {
  display: none !important;
}

/* Workspace selector list styling (shown right after login on /login/selectWorkspace) */
html.pepper-auth-active .panel-base .workspace {
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(255, 255, 255, 0.035) !important;
  transition: border-color 0.16s ease, background-color 0.16s ease !important;
}

html.pepper-auth-active .panel-base .workspace:hover {
  border-color: rgba(255, 118, 84, 0.45) !important;
  background: rgba(255, 255, 255, 0.07) !important;
}

/* Responsive: collapse editorial hero on narrow / split-pane viewports */
@media (max-width: 920px) {
  #pepper-auth-hero {
    display: none !important;
  }

  html.pepper-auth-active .backd .bg-image.back {
    padding: 1.25rem !important;
    justify-content: center !important;
    align-items: center !important;
  }

  html.pepper-auth-active .backd .panel-base {
    position: relative !important;
    inset: auto !important;
    margin: 0 auto !important;
    transform: none !important;
    width: min(420px, calc(100vw - 2rem)) !important;
  }
}

@keyframes pepperFadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  #pepper-auth-hero,
  html.pepper-auth-active .backd .panel-base {
    animation: none !important;
  }
}
