@import url('/context.css');

html[data-manager-session="loading"] .app-shell,
html[data-manager-session="locked"] .app-shell {
  filter: saturate(0.82) brightness(0.97);
}

.manager-boot-fallback {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.manager-boot-fallback .panel {
  width: min(560px, 100%);
}

.manager-boot-fallback h1 {
  margin: 0;
  color: var(--z-text-strong);
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.manager-boot-fallback p {
  margin: 18px 0 0;
  color: var(--z-text-muted);
  font-size: 13px;
  line-height: 1.7;
}

html[data-manager-session="locked"] .manager-boot-fallback,
html[data-manager-session="active"] .manager-boot-fallback {
  display: none;
}

.session-dialog {
  width: min(470px, calc(100vw - 28px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(7, 26, 53, 0.12);
  border-radius: 24px;
  background: var(--z-surface);
  color: var(--z-text);
  box-shadow: 0 28px 90px rgba(3, 13, 26, 0.28);
}

.production-auth-dialog {
  width: min(500px, calc(100vw - 28px));
}

.session-dialog::backdrop {
  background: rgba(3, 13, 26, 0.62);
  backdrop-filter: blur(8px);
}

.session-dialog__header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 26px 28px 20px;
  border-bottom: 1px solid var(--z-border);
}

.session-dialog__mark {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--z-sidebar);
}

.session-dialog__mark img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.session-dialog__title {
  min-width: 0;
}

.session-dialog__title span {
  display: block;
  margin-bottom: 3px;
  color: var(--z-brand-blue-strong);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.session-dialog__title h1 {
  margin: 0;
  color: var(--z-text-strong);
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.session-form {
  display: grid;
  gap: 17px;
  padding: 24px 28px 28px;
}

.session-form__copy {
  margin: 0 0 2px;
  color: var(--z-text-muted);
  font-size: 12px;
  line-height: 1.65;
}

.session-field {
  display: grid;
  gap: 7px;
}

.session-field > span {
  color: var(--z-text-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.session-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--z-border);
  border-radius: 12px;
  background: var(--z-surface);
  color: var(--z-text-strong);
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color var(--z-motion-fast), box-shadow var(--z-motion-fast);
}

.session-field input:focus {
  border-color: rgba(18, 104, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(18, 104, 255, 0.08);
}

.session-form__advanced {
  margin: -2px 0 0;
  padding: 11px 12px;
  border: 1px solid var(--z-border);
  border-radius: 12px;
  background: color-mix(in srgb, var(--z-surface) 92%, var(--z-sidebar) 8%);
}

.session-form__advanced summary {
  cursor: pointer;
  color: var(--z-text-muted);
  font-size: 11px;
  font-weight: 700;
  list-style-position: inside;
}

.session-form__advanced[open] summary {
  margin-bottom: 12px;
}

.session-form__error {
  min-height: 18px;
  margin: -4px 0 0;
  color: #b42318;
  font-size: 11px;
  line-height: 1.5;
}

.session-form__submit {
  width: 100%;
  min-height: 48px;
  border: 0;
  cursor: pointer;
}

.session-form__submit:disabled {
  cursor: wait;
  opacity: 0.58;
  transform: none;
}

.session-form__note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: -3px 0 0;
  color: var(--z-text-soft);
  font-size: 10px;
  line-height: 1.5;
}

.session-form__note svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin-top: 1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-status em {
  font-style: normal;
}

.topbar-status[data-state="loading"] span {
  background: var(--z-warning);
  animation: session-pulse 1.1s ease-in-out infinite;
}

.topbar-status[data-state="locked"] span,
.topbar-status[data-state="degraded"] span {
  background: var(--z-warning);
}

.topbar-status[data-state="active"] span {
  background: var(--z-success);
}

.profile-chip[data-session-lock] {
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--z-motion-fast), background var(--z-motion-fast), transform var(--z-motion-fast);
}

.profile-chip[data-session-lock]:hover {
  border-color: rgba(18, 104, 255, 0.22);
  background: var(--z-surface);
  transform: translateY(-1px);
}

.profile-chip[data-session-lock]:active {
  transform: translateY(0);
}

.profile-chip[data-session-lock]:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

@keyframes session-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

@media (max-width: 620px) {
  .manager-boot-fallback {
    padding: 22px;
  }

  .session-dialog__header {
    padding: 22px 22px 18px;
  }

  .session-form {
    padding: 21px 22px 24px;
  }

  .session-dialog__title h1 {
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .topbar-status[data-state="loading"] span {
    animation: none;
  }
}
