/* ─────────────────────────────────────────
   Tokens
───────────────────────────────────────── */
:root {
  --bg:           #060a14;
  --surface:      rgba(255,255,255,0.04);
  --border:       rgba(255,255,255,0.08);
  --primary:      #6366f1;
  --primary-d:    #4f46e5;
  --accent:       #22d3ee;
  --green:        #34d399;
  --red:          #f87171;
  --yellow:       #fbbf24;
  --text:         #f1f5f9;
  --muted:        #94a3b8;
  --mono:         'JetBrains Mono', monospace;
  --sans:         'Inter', system-ui, sans-serif;
  --r-md:         14px;
  --r-lg:         20px;
  --r-xl:         28px;
}

/* ─────────────────────────────────────────
   Reset
───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─────────────────────────────────────────
   Background blobs
───────────────────────────────────────── */
.bg-blob {
  position: fixed; border-radius: 50%;
  filter: blur(130px); pointer-events: none; z-index: 0;
  animation: drift 22s ease-in-out infinite alternate;
}
.blob-1 { width:500px;height:500px; background:radial-gradient(circle,rgba(99,102,241,.22) 0%,transparent 70%); top:-100px;left:-120px; }
.blob-2 { width:380px;height:380px; background:radial-gradient(circle,rgba(34,211,238,.15) 0%,transparent 70%); bottom:-80px;right:-80px; animation-delay:-10s; }
@keyframes drift {
  0%   { transform:translate(0,0) scale(1); }
  100% { transform:translate(25px,-20px) scale(1.04); }
}

/* ─────────────────────────────────────────
   Page layout
───────────────────────────────────────── */
.page {
  position: relative; z-index: 1;
  max-width: 1100px; margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: flex; flex-direction: column; gap: 1.5rem;
  animation: fadeUp .6s ease both;
}
@keyframes fadeUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }

/* ─────────────────────────────────────────
   Header
───────────────────────────────────────── */
.header {
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.header-left { display: flex; align-items: center; gap: 1rem; }
.logo { font-size: 2.2rem; line-height: 1; }
.title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; }
.subtitle { font-size: .82rem; color: var(--muted); margin-top: .1rem; }

/* Status pill */
.status-pill {
  font-size: .75rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; padding: .3rem .9rem;
  border-radius: 999px;
  background: rgba(148,163,184,.1); color: var(--muted);
  border: 1px solid rgba(148,163,184,.2);
  transition: background .3s, color .3s, border-color .3s;
}
.status-running { background:rgba(251,191,36,.12); color:var(--yellow); border-color:rgba(251,191,36,.35); animation: pulse 1.2s ease-in-out infinite; }
.status-ok      { background:rgba(52,211,153,.12);  color:var(--green);  border-color:rgba(52,211,153,.35); }
.status-error   { background:rgba(248,113,113,.12); color:var(--red);    border-color:rgba(248,113,113,.35); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.6} }

/* ─────────────────────────────────────────
   Grid
───────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media(max-width:780px){ .grid{ grid-template-columns:1fr; } }

/* ─────────────────────────────────────────
   Card
───────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 1.8rem;
  display: flex; flex-direction: column; gap: 1.2rem;
}
.card-title {
  font-size: .95rem; font-weight: 700;
  display: flex; align-items: center; gap: .5rem;
}

/* ─────────────────────────────────────────
   Form
───────────────────────────────────────── */
.form-grid { display: flex; flex-direction: column; gap: 1rem; }

.field { display: flex; flex-direction: column; gap: .4rem; }
.field label {
  font-size: .78rem; color: var(--muted); font-weight: 500;
  display: flex; align-items: center; gap: .5rem;
}

.val-badge {
  font-family: var(--mono); font-size: .75rem; font-weight: 600;
  background: rgba(99,102,241,.15); color: var(--primary);
  padding: .1rem .45rem; border-radius: 6px;
}

input[type="text"] {
  background: rgba(255,255,255,.06); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: .55rem .85rem;
  font-family: var(--mono); font-size: .85rem; color: var(--text);
  outline: none; transition: border-color .2s;
}
input[type="text"]:focus { border-color: var(--primary); }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px;
  background: rgba(255,255,255,.08); border-radius: 999px;
  outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--primary); box-shadow: 0 0 8px var(--primary);
  cursor: pointer; transition: box-shadow .2s;
}
input[type="range"]::-webkit-slider-thumb:hover { box-shadow: 0 0 14px var(--primary); }

/* ─────────────────────────────────────────
   Command preview
───────────────────────────────────────── */
.cmd-preview {
  background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--r-md); padding: .8rem 1rem;
  font-family: var(--mono); font-size: .75rem; color: var(--muted);
  word-break: break-all; line-height: 1.6;
}
.cmd-prompt { color: var(--green); margin-right: .4rem; }

/* ─────────────────────────────────────────
   Run button
───────────────────────────────────────── */
.run-btn {
  width: 100%; padding: .75rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-d));
  color: #fff; font-family: var(--sans); font-size: .9rem; font-weight: 700;
  border: none; border-radius: var(--r-lg); cursor: pointer;
  box-shadow: 0 4px 22px rgba(99,102,241,.35);
  transition: opacity .2s, transform .15s, box-shadow .2s;
}
.run-btn:hover:not(:disabled) { opacity:.9; transform:translateY(-2px); box-shadow:0 6px 28px rgba(99,102,241,.5); }
.run-btn:disabled { opacity:.45; cursor:not-allowed; transform:none; }

/* ─────────────────────────────────────────
   Log panel
───────────────────────────────────────── */
.log-card { min-height: 340px; }
.log-header {
  display: flex; align-items: center;
  justify-content: space-between;
}
.clear-btn {
  font-size: .72rem; font-weight: 600; color: var(--muted);
  background: transparent; border: 1px solid var(--border);
  border-radius: 8px; padding: .25rem .65rem; cursor: pointer;
  transition: color .2s, border-color .2s;
}
.clear-btn:hover { color: var(--text); border-color: var(--muted); }

.log-box {
  flex: 1; overflow-y: auto; max-height: 400px;
  background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--r-md); padding: .9rem 1rem;
  font-family: var(--mono); font-size: .72rem; line-height: 1.65;
  color: #a8c0d6; white-space: pre-wrap; word-break: break-word;
}
.log-placeholder { color: var(--muted); font-style: italic; }

/* ─────────────────────────────────────────
   Report section
───────────────────────────────────────── */
.report-section {
  background: var(--surface);
  border: 1px solid rgba(52,211,153,.25);
  border-radius: var(--r-xl);
  backdrop-filter: blur(18px);
  overflow: hidden;
  animation: fadeUp .5s ease both;
}
.report-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.report-title { font-size: .9rem; font-weight: 700; color: var(--green); }
.report-btn {
  font-size: .78rem; font-weight: 600; color: var(--primary);
  text-decoration: none; padding: .3rem .8rem;
  border: 1px solid rgba(99,102,241,.35); border-radius: 8px;
  transition: background .2s;
}
.report-btn:hover { background: rgba(99,102,241,.12); }
.report-frame {
  width: 100%; height: 600px; border: none;
  background: #fff;
}
