/* =====================================================================
 * acquire-ip.css — 「新取得 IP」精靈 modal 樣式
 * 沿用 main.css 的 CSS 變數與深色 NOC 風；版面比照 mockups/02-acquire-ip-wizard.html
 * ===================================================================== */

/* 遮罩層（置中） */
.aq-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 12, .6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}
.aq-overlay[hidden] { display: none; }

/* 精靈卡片 */
.aq-wizard {
  width: 760px;
  max-width: 100%;
  max-height: calc(100vh - 48px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 標題列 */
.aq-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}
.aq-head h2 { margin: 0; font-size: 17px; }
.aq-head .aq-x {
  margin-left: auto;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  background: none;
  border: none;
  line-height: 1;
}
.aq-head .aq-x:hover { color: var(--txt); }

/* 步驟條 */
.aq-steps {
  display: flex;
  gap: 0;
  padding: 16px 22px 6px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.aq-step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  flex: 1;
}
.aq-step .n {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  background: var(--panel2);
  flex: none;
}
.aq-step.done .n { background: var(--green); border-color: var(--green); color: #08130c; }
.aq-step.active { color: var(--txt); }
.aq-step.active .n { background: var(--accent); border-color: var(--accent); color: #fff; }
.aq-step .bar { flex: 1; height: 1px; background: var(--line); margin: 0 6px; }
.aq-step:last-child .bar { display: none; }

/* 內文 */
.aq-body { padding: 22px; overflow: auto; flex: 1; }
.aq-sec { font-size: 13px; color: var(--muted); margin: 2px 0 14px; font-weight: 600; line-height: 1.7; }
.aq-label { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 0 0 6px; }
.aq-field { margin-bottom: 16px; }
.aq-row { display: flex; gap: 14px; }
.aq-row > * { flex: 1; }

.aq-body input,
.aq-body select,
.aq-body textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--txt);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
}
.aq-body input:focus,
.aq-body select:focus,
.aq-body textarea:focus { border-color: var(--accent); }
.aq-body textarea { resize: vertical; min-height: 60px; }
.aq-mono { font-family: "Consolas", "Courier New", monospace; }

/* 唯讀帶入欄位 */
.aq-ro {
  background: var(--panel2);
  border: 1px dashed var(--line);
  color: var(--muted);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 13px;
}

/* 建議 IP 卡片 */
.aq-ipcard {
  background: linear-gradient(180deg, #0f2419, #10241c);
  border: 1px solid var(--green);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.aq-ipcard .big { font-size: 26px; font-weight: 700; letter-spacing: .5px; }
.aq-ipcard .tag {
  font-size: 11px; color: #86efac;
  border: 1px solid #2f6b46; border-radius: 20px; padding: 2px 10px;
}
.aq-ipcard .re {
  margin-left: auto;
  background: transparent;
  border: 1px solid #2f6b46;
  color: #86efac;
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 12.5px;
}
.aq-ipcard .re:hover { background: rgba(47, 107, 70, .25); }
.aq-ipcard.empty-ip { background: #1c2230; border-color: var(--line); }
.aq-ipcard.empty-ip .big { color: var(--muted); font-size: 16px; }

.aq-alt { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }
.aq-alt a { color: var(--accent); text-decoration: none; cursor: pointer; }

/* 分頁切換 */
.aq-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.aq-tabs button {
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 8px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 13px;
}
.aq-tabs button.on { border-color: var(--accent); color: var(--txt); background: #16203a; }

/* 即時驗證提示 */
.aq-msg {
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 4px;
}
.aq-msg.ok { background: #0f2419; border: 1px solid #2f6b46; color: #86efac; }
.aq-msg.warn { background: rgba(245, 158, 11, .1); border: 1px solid rgba(245, 158, 11, .4); color: #fcd34d; }
.aq-msg.err { background: #2a1010; border: 1px solid #7a2f2f; color: #fda4a4; }

/* 格點挑選 */
.aq-grid {
  display: grid;
  grid-template-columns: repeat(32, 1fr);
  gap: 2px;
  margin-top: 6px;
}
.aq-grid i {
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--panel2);
  border: 1px solid rgba(255, 255, 255, .04);
  cursor: pointer;
}
.aq-grid i.use { background: var(--green); cursor: not-allowed; }
.aq-grid i.dep { background: var(--gray); cursor: not-allowed; }
.aq-grid i.res { background: var(--amber); }
.aq-grid i.na { background: #11161f; opacity: .4; cursor: not-allowed; } /* 網路/廣播位址 */
.aq-grid i.pick { background: #fff; box-shadow: 0 0 0 2px var(--accent); }
.aq-grid i:not(.use):not(.dep):not(.na):hover { box-shadow: 0 0 0 2px var(--accent); }
.aq-grid-legend { display: flex; gap: 14px; flex-wrap: wrap; margin: 12px 0 4px; color: var(--muted); font-size: 11px; }
.aq-grid-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

/* 摘要表 */
.aq-sum {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.aq-sum .r {
  display: flex;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.aq-sum .r:last-child { border-bottom: none; }
.aq-sum .k { width: 140px; color: var(--muted); flex: none; }

.aq-note {
  margin: 16px 0 0;
  padding: 14px 16px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

/* 底部按鈕列 */
.aq-foot {
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  align-items: center;
  flex: none;
}
.aq-foot .ctx { color: var(--muted); font-size: 12.5px; }
.aq-foot .spacer { flex: 1; }
.aq-btn {
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--txt);
  border-radius: 8px;
  padding: 9px 18px;
  cursor: pointer;
  font-size: 13.5px;
}
.aq-btn:hover { border-color: var(--accent); }
.aq-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.aq-btn.ghost { background: transparent; }
.aq-btn:disabled { opacity: .45; cursor: not-allowed; }
.aq-btn:disabled:hover { border-color: var(--line); }

/* 網段選擇下拉清單（可搜尋） */
.aq-pfx-search { margin-bottom: 10px; }
.aq-pfx-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 320px;
  overflow: auto;
}
.aq-pfx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.aq-pfx-item:last-child { border-bottom: none; }
.aq-pfx-item:hover { background: var(--panel2); }
.aq-pfx-item.sel { background: #16203a; }
.aq-pfx-item .cidr { font-family: "Consolas", "Courier New", monospace; font-weight: 600; min-width: 130px; }
.aq-pfx-item .meta { color: var(--muted); font-size: 12px; flex: 1; }
.aq-pfx-item .use { width: 150px; flex: none; }

/* VM 取得入口按鈕（注入 devices 詳情面板） */
.aq-vm-entry { margin: 14px 0 4px; }
.aq-vm-entry .aq-btn { width: 100%; }

/* 成功提示 toast */
.aq-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--panel);
  border: 1px solid var(--green);
  color: var(--txt);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 13.5px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 14px;
}
.aq-toast a { color: var(--accent); cursor: pointer; }
