/**
 * NMBT 安装向导 — 动画、输入框、加载态
 */

/* ── 页面入场 ── */
.NMBT-install-wrap {
  opacity: 0;
  transform: translateY(12px);
  animation: NMBT-wrap-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes NMBT-wrap-in {
  to { opacity: 1; transform: translateY(0); }
}

/* ── 步骤切换 ── */
#content-page-main {
  width: 100%;
  min-height: 340px;
  position: relative;
}

#content-page-main > div {
  width: 100%;
  display: none;
  opacity: 0;
}

#content-page-main > div.page-active {
  display: block;
  animation: NMBT-step-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#content-page-main > div.page-leaving {
  display: block;
  animation: NMBT-step-out 0.32s ease forwards;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

@keyframes NMBT-step-in {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes NMBT-step-out {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(-18px); }
}

/* ── 进度条 ── */
.NMBT-progress-track {
  height: 6px;
  background: #e8e8e8;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.progress-bar-anim {
  height: 100%;
  background: var(--color-primary-500);
  border-radius: 999px;
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.NMBT-progress-track.is-loading .progress-bar-anim::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: NMBT-shimmer 1.2s infinite;
}

@keyframes NMBT-shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

/* ── 侧栏步骤：已完成 ── */
.NMBT-step-item.is-done .NMBT-step-num {
  background: rgba(var(--color-primary-500-rgb), 0.12);
  border-color: var(--color-primary-500);
  color: var(--color-primary-500);
}

.NMBT-step-item.is-done .NMBT-step-title {
  color: var(--NMBT-text-secondary);
}

/* ── 输入框 ── */
.form-database {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.NMBT-field {
  margin-bottom: 14px;
  transition: transform 0.2s ease;
}

.NMBT-field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--NMBT-text);
  margin-bottom: 6px;
  transition: color 0.2s;
}

.NMBT-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.NMBT-field-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #bbb;
  pointer-events: none;
  transition: color 0.25s;
  z-index: 1;
}

.NMBT-field-icon svg {
  width: 18px;
  height: 18px;
}

.NMBT-input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 40px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  color: var(--NMBT-text);
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  outline: none;
}

.NMBT-field-wrap.has-toggle .NMBT-input {
  padding-right: 44px;
}

.NMBT-input::placeholder {
  color: #c0c4cc;
}

.NMBT-input:hover {
  border-color: #c0c4cc;
}

.NMBT-field.is-focused .NMBT-input {
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-500-rgb), 0.12);
  background: #fff;
}

.NMBT-field.is-focused .NMBT-field-label {
  color: var(--color-primary-600);
}

.NMBT-field.is-focused .NMBT-field-icon {
  color: var(--color-primary-500);
}

.NMBT-field.is-filled:not(.is-focused) .NMBT-input {
  border-color: #c8e6c9;
  background: #fafdfa;
}

.NMBT-field.is-filled:not(.is-focused) .NMBT-field-icon {
  color: var(--color-primary-400);
}

.NMBT-field.is-error .NMBT-input {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
  animation: NMBT-shake 0.45s ease;
}

.NMBT-field.is-error .NMBT-field-label {
  color: #ef4444;
}

@keyframes NMBT-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.NMBT-field-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #aaa;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
  padding: 0;
}

.NMBT-field-toggle:hover {
  color: var(--color-primary-500);
  background: rgba(var(--color-primary-500-rgb), 0.08);
}

.NMBT-field-toggle svg {
  width: 18px;
  height: 18px;
}

/* ── 环境检测项 ── */
.NMBT-check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.NMBT-check-item.is-checking {
  opacity: 0.85;
}

.NMBT-check-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e8e8e8;
  border-top-color: var(--color-primary-500);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  animation: NMBT-spin 0.7s linear infinite;
}

.NMBT-check-item:not(.is-checking) .NMBT-check-spinner {
  display: none;
}

.NMBT-check-item.is-checking .NMBT-check-name::after {
  content: " 检测中…";
  font-weight: 400;
  color: var(--NMBT-text-muted);
  font-size: 12px;
}

.NMBT-check-item.animate-in {
  animation: NMBT-check-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.NMBT-check-item:nth-child(1).animate-in { animation-delay: 0.05s; }
.NMBT-check-item:nth-child(2).animate-in { animation-delay: 0.15s; }
.NMBT-check-item:nth-child(3).animate-in { animation-delay: 0.25s; }

@keyframes NMBT-check-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes NMBT-spin {
  to { transform: rotate(360deg); }
}

/* ── 协议勾选 ── */
.NMBT-term-row {
  transition: border-color 0.25s, background 0.25s, transform 0.15s;
}

.NMBT-term-row:active {
  transform: scale(0.99);
}

.NMBT-term-check {
  transition: background 0.25s, border-color 0.25s, transform 0.2s;
}

.NMBT-term-row.terms-yes .NMBT-term-check {
  animation: NMBT-pop 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes NMBT-pop {
  0% { transform: scale(0.8); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

/* ── 主按钮加载态 ── */
.NMBT-btn-action {
  position: relative;
  min-width: 128px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
}

.NMBT-btn-action:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--color-primary-500-rgb), 0.35);
}

.NMBT-btn-action:not(:disabled):active {
  transform: translateY(0);
}

.NMBT-btn-action:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.NMBT-btn-action.is-loading .NMBT-btn-text {
  opacity: 0.85;
}

.NMBT-btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: NMBT-spin 0.65s linear infinite;
  flex-shrink: 0;
}

.NMBT-btn-action.is-loading .NMBT-btn-spinner {
  display: block;
}

/* ── 底部提示 ── */
.next-tips {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #ef4444;
  flex: 1;
  min-width: 0;
  animation: NMBT-tip-in 0.3s ease;
}

@keyframes NMBT-tip-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.next-tips svg {
  flex-shrink: 0;
}

/* ── 全屏加载遮罩 ── */
.NMBT-page-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: NMBT-fade-in 0.25s ease;
}

.NMBT-overlay-card {
  background: #fff;
  border: 1px solid var(--NMBT-border);
  border-radius: 12px;
  padding: 28px 36px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  text-align: center;
  animation: NMBT-pop 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.NMBT-spinner-lg {
  width: 36px;
  height: 36px;
  border: 3px solid #e8e8e8;
  border-top-color: var(--color-primary-500);
  border-radius: 50%;
  animation: NMBT-spin 0.75s linear infinite;
  margin: 0 auto 14px;
}

.NMBT-overlay-text {
  margin: 0;
  font-size: 14px;
  color: var(--NMBT-text-secondary);
}

@keyframes NMBT-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── 完成页动画 ── */
.NMBT-complete-icon {
  animation: NMBT-success-pop 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.15s backwards;
}

@keyframes NMBT-success-pop {
  from { opacity: 0; transform: scale(0.5); }
  60% { transform: scale(1.08); }
  to { opacity: 1; transform: scale(1); }
}

.NMBT-link-card {
  animation: NMBT-check-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.NMBT-link-card:nth-child(1) { animation-delay: 0.2s; }
.NMBT-link-card:nth-child(2) { animation-delay: 0.28s; }
.NMBT-link-card:nth-child(3) { animation-delay: 0.36s; }

/* ── 侧栏版本标签 ── */
.NMBT-install-brand-tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--color-primary-600);
  background: rgba(var(--color-primary-500-rgb), 0.1);
  border: 1px solid rgba(var(--color-primary-500-rgb), 0.2);
  padding: 1px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.NMBT-install-brand-ver .mn-product {
  color: var(--NMBT-text);
}

.d-none {
  display: none !important;
}
