/* Jira Migration Tester — clean, high-contrast, large-type UI.
   Tuned for readability: 18px base, big targets (>=44px), color + text status. */

:root {
  --bg:        #eef2f7;
  --surface:   #ffffff;
  --ink:       #16202e;   /* primary text — high contrast on white */
  --ink-soft:  #51607a;   /* secondary text */
  --line:      #d7deea;
  --primary:   #1d4ed8;
  --primary-d: #1740b0;
  --focus:     #2563eb;

  --pass:  #1a7f43;  --pass-bg:  #e3f5ea;
  --warn:  #9a6400;  --warn-bg:  #fbf0d6;
  --fail:  #b42318;  --fail-bg:  #fde7e4;
  --block: #475467;  --block-bg: #e9edf3;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(16,32,46,.06), 0 6px 18px rgba(16,32,46,.08);
}

* { box-sizing: border-box; }

html { font-size: 18px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

/* ---- Top bar ---------------------------------------------------------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner {
  max-width: 1100px; margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 11px; flex: none;
  background: var(--primary); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; letter-spacing: .5px;
}
.brand h1 { margin: 0; font-size: 1.4rem; }
.tagline { margin: 2px 0 0; color: var(--ink-soft); font-size: .92rem; }

.badge {
  font-weight: 700; font-size: .9rem; padding: 8px 14px; border-radius: 999px;
  white-space: nowrap;
}
.badge-idle { background: var(--block-bg); color: var(--block); }
.badge-ok   { background: var(--pass-bg); color: var(--pass); }

/* ---- Profile / auth --------------------------------------------------- */
.topbar-right { display: flex; align-items: center; gap: 14px; }
.profile { display: flex; align-items: center; gap: 10px; }
.profile[hidden] { display: none; }
.profile-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--primary); color: #fff; font-weight: 800;
  display: grid; place-items: center; text-transform: uppercase;
}
.profile-name { font-weight: 700; }
.btn-sm { min-height: 38px; padding: 7px 14px; font-size: .9rem; }
.card-narrow { max-width: 480px; margin-left: auto; margin-right: auto; }
.auth-switch { margin-top: 14px; }
.auth-switch a { font-weight: 700; }

/* ---- Layout ----------------------------------------------------------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 28px 24px 80px; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 24px;
  overflow: hidden;
}
.card[hidden] { display: none; }
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 24px; border-bottom: 1px solid var(--line); background: #f8fafd;
}
.card-head h2 { margin: 0; font-size: 1.18rem; }
.step-num {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--primary); color: #fff; font-weight: 800;
  display: grid; place-items: center; font-size: 1rem;
}
.card-body { padding: 22px 24px; }

.help { color: var(--ink-soft); margin: 0 0 18px; }
.muted { color: var(--ink-soft); }
.pad { padding: 14px 4px; }

/* ---- Forms ------------------------------------------------------------ */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.inline-link { font-weight: 600; font-size: .85rem; margin-left: 8px; color: var(--primary); }

input[type=url], input[type=email], input[type=password], input[type=search], input[type=text] {
  width: 100%; padding: 13px 14px; font-size: 1rem; color: var(--ink);
  border: 2px solid var(--line); border-radius: 10px; background: #fff;
}
input:focus-visible, button:focus-visible, a.btn:focus-visible, .chip:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
}

.actions { display: flex; align-items: center; gap: 16px; margin-top: 8px; flex-wrap: wrap; }
.run-actions { margin-top: 18px; }

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  font: inherit; font-weight: 700; cursor: pointer;
  border-radius: 10px; padding: 13px 22px; min-height: 48px;
  border: 2px solid transparent; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: 8px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-primary:disabled { background: #aab6cc; cursor: not-allowed; }
.btn-lg { font-size: 1.08rem; padding: 15px 30px; min-height: 54px; }
.btn-ghost { background: #fff; color: var(--primary); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--primary); }
.btn-warn { background: #fff; color: var(--warn); border-color: var(--warn); }
.btn-warn:hover { background: var(--warn-bg); }
.btn-warn:disabled { opacity: .6; cursor: not-allowed; }

.inline-msg { font-weight: 600; }
.inline-msg.err { color: var(--fail); }
.inline-msg.ok  { color: var(--pass); }

/* ---- Connected banner ------------------------------------------------- */
.connected-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--pass-bg); color: var(--pass);
  border-radius: 10px; padding: 14px 18px; font-weight: 600;
}
.connected-banner .btn { min-height: 40px; padding: 8px 16px; }

/* ---- Project picker --------------------------------------------------- */
.toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.search { flex: 1 1 280px; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
.check-strong { white-space: nowrap; }

.project-list {
  border: 1px solid var(--line); border-radius: 10px; max-height: 340px;
  overflow-y: auto; background: #fff;
}
.project-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 16px;
  border-bottom: 1px solid #eef2f7; cursor: pointer;
}
.project-row:last-child { border-bottom: 0; }
.project-row:hover { background: #f6f9ff; }
.project-row input { width: 20px; height: 20px; accent-color: var(--primary); flex: none; }
.project-key {
  font-weight: 800; font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  background: #eef2f7; padding: 2px 8px; border-radius: 6px; font-size: .9rem;
}
.project-name { color: var(--ink); }
.project-type { color: var(--ink-soft); font-size: .82rem; margin-left: auto; }

.options { margin: 20px 0 4px; }
.toggle span { display: block; }
.toggle small { display: block; color: var(--ink-soft); font-weight: 400; font-size: .85rem; margin-top: 2px; }
.toggle input { margin-top: 3px; align-self: flex-start; }
.toggle { align-items: flex-start; }

/* ---- Progress --------------------------------------------------------- */
.spinner {
  width: 22px; height: 22px; border-radius: 50%; margin-left: auto;
  border: 3px solid #cdd7e8; border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
.spinner.done { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.progress-track { height: 12px; background: #e3e9f2; border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--primary); transition: width .3s ease; }
.progress-label { font-weight: 600; margin: 12px 0 8px; }
.save-path {
  margin: 0 0 18px; font-size: .85rem; word-break: break-all;
  background: #f6f8fc; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px;
}

.stat-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.stat {
  flex: 1 1 120px; background: #f6f8fc; border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; text-align: center;
}
.stat-num { display: block; font-size: 1.6rem; font-weight: 800; }
.stat-label { color: var(--ink-soft); font-size: .85rem; }
.stat-pass  .stat-num { color: var(--pass); }
.stat-warn  .stat-num { color: var(--warn); }
.stat-fail  .stat-num { color: var(--fail); }
.stat-block .stat-num { color: var(--block); }

.log-wrap summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.log {
  margin-top: 10px; max-height: 280px; overflow-y: auto;
  background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 14px 16px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .86rem; line-height: 1.7;
}
.log .l-info  { color: #cbd5e1; }
.log .l-good  { color: #6ee7a8; }
.log .l-warn  { color: #fcd676; }
.log .l-bad   { color: #fda4a0; }
.log .l-head  { color: #93c5fd; font-weight: 700; margin-top: 6px; }
.log .l-dim   { color: #8090a8; }

/* ---- Results table ---------------------------------------------------- */
.results-toolbar { justify-content: space-between; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.downloads { display: flex; gap: 10px; flex-wrap: wrap; }

.chip {
  font: inherit; font-weight: 700; font-size: .85rem; border-radius: 999px;
  padding: 8px 14px; border: 2px solid var(--line); background: #fff;
  color: var(--ink-soft); cursor: pointer;
}
.chip-filter.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table.results { width: 100%; border-collapse: collapse; min-width: 760px; }
table.results th, table.results td {
  text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top;
}
table.results thead th { background: #f8fafd; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
table.results tbody tr:hover { background: #f6f9ff; }
table.results td.notes { color: var(--ink-soft); font-size: .9rem; max-width: 320px; }
.issue-link { font-weight: 700; color: var(--primary); text-decoration: none; }
.issue-link:hover { text-decoration: underline; }

.verdict {
  display: inline-block; font-weight: 800; font-size: .8rem; letter-spacing: .03em;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.v-PASS            { background: var(--pass-bg);  color: var(--pass); }
.v-TRANSITION_WARN { background: var(--warn-bg);  color: var(--warn); }
.v-CREATE_FAIL     { background: var(--fail-bg);  color: var(--fail); }
.v-BLOCKED         { background: var(--block-bg); color: var(--block); }
/* legacy */
.v-PARTIAL         { background: var(--warn-bg);  color: var(--warn); }
.v-FAIL            { background: var(--warn-bg);  color: var(--warn); }

@media (max-width: 640px) {
  html { font-size: 17px; }
  .topbar-inner, .wrap { padding-left: 16px; padding-right: 16px; }
  .badge { display: none; }
}
