:root {
  --ink: #0b1f3f;
  --muted: #64748b;
  --paper: #f7fbff;
  --card: rgba(255, 255, 255, 0.92);
  --line: rgba(29, 78, 216, 0.14);
  --forest: #0b3a82;
  --forest-2: #08245c;
  --mint: #d8ecff;
  --sun: #7cc4ff;
  --coral: #2563eb;
  --blue: #1d4ed8;
  --shadow: 0 24px 70px rgba(15, 76, 160, 0.16);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", Verdana, sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(59, 130, 246, 0.20), transparent 30rem),
    radial-gradient(circle at 92% 6%, rgba(125, 211, 252, 0.26), transparent 32rem),
    linear-gradient(135deg, #ffffff 0%, #f3f8ff 46%, #eaf4ff 100%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(37,99,235,0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(37,99,235,0.045) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
code { background: rgba(37,99,235,0.08); border-radius: 6px; padding: 0.1rem 0.35rem; }

.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; position: relative; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
}
.brand { display: inline-flex; gap: 12px; align-items: center; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  color: #fff8ec;
  background: linear-gradient(145deg, #08245c, #1d4ed8 58%, #60a5fa);
  box-shadow: 0 12px 28px rgba(37,99,235,0.22);
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.35rem;
  font-weight: 800;
}
.brand strong { display: block; font-weight: 850; letter-spacing: -0.03em; }
.brand small { color: var(--muted); font-size: 0.78rem; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-actions a, .ghost-button {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.44);
  color: var(--forest-2);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  cursor: pointer;
}
.nav-actions form { margin: 0; }

h1, h2, h3 { font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif; letter-spacing: -0.045em; margin: 0; }
h1 { font-size: clamp(2.2rem, 6vw, 5.2rem); line-height: 0.95; }
h2 { font-size: clamp(1.55rem, 3vw, 2.35rem); }
h3 { font-size: 1.25rem; }
p { line-height: 1.65; }
.eyebrow { color: var(--coral); font-weight: 850; text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem; margin: 0 0 10px; }
.muted, .hint { color: var(--muted); font-size: 0.92rem; }

.login-layout {
  min-height: calc(100vh - 92px);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: center;
  padding: 28px 0 70px;
}
.hero-panel, .login-card, .panel {
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.hero-panel {
  min-height: 560px;
  border-radius: 38px;
  padding: clamp(28px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  position: relative;
}
.hero-panel::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -110px;
  top: -80px;
  border-radius: 40% 60% 55% 45%;
  background: linear-gradient(145deg, rgba(191,219,254,0.95), rgba(96,165,250,0.64));
  animation: blob 9s ease-in-out infinite alternate;
}
.hero-copy { max-width: 650px; font-size: 1.12rem; color: #475569; }
.hero-metrics { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-metrics span { border: 1px solid var(--line); border-radius: 999px; padding: 0.75rem 1rem; background: rgba(255,255,255,0.45); }
.login-card { border-radius: 32px; padding: 34px; }
.login-card label, .stack-form label { display: grid; gap: 8px; margin: 18px 0; font-weight: 750; }
input[type="text"], input[type="password"], input:not([type]) {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.72);
  padding: 0.95rem 1rem;
  outline: none;
}
input:focus { border-color: var(--forest); box-shadow: 0 0 0 4px rgba(96,165,250,0.26); }
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  color: #fffaf0;
  background: linear-gradient(135deg, #08245c, #1d4ed8 52%, #60a5fa);
  padding: 0.95rem 1.25rem;
  box-shadow: 0 16px 34px rgba(37,99,235,0.24);
  cursor: pointer;
  font-weight: 850;
}
.primary-button:disabled { opacity: 0.55; cursor: wait; }
.alert { border-radius: 14px; padding: 0.85rem 1rem; margin: 14px 0; }
.alert.error, .job-status.error { color: #b42318; background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.25); }

.workspace-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  padding: 42px 0 24px;
}
.workspace-hero p { max-width: 760px; color: #475569; }
.status-orb {
  min-width: 180px;
  min-height: 180px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  color: #fff8ee;
  background: radial-gradient(circle at 30% 20%, #93c5fd, #1d4ed8 48%, #08245c);
  box-shadow: var(--shadow);
}
.status-orb span { display: block; opacity: 0.78; }
.status-orb strong { display: block; font-size: 1.2rem; }
.grid { display: grid; gap: 24px; }
.two-columns { grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr); }
.admin-grid { grid-template-columns: 0.8fr 1.4fr; align-items: start; }
.span-two { min-width: 0; }
.panel { border-radius: 30px; padding: 26px; }
.panel-heading { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 20px; }
.badge { border-radius: 999px; background: rgba(219,234,254,0.92); color: #1d4ed8; padding: 0.45rem 0.75rem; font-weight: 850; }
.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 2px dashed rgba(37,99,235,0.28);
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(255,255,255,0.56), rgba(219,234,254,0.62));
  transition: 180ms ease;
  cursor: pointer;
}
.dropzone:hover, .dropzone.dragging { transform: translateY(-2px); border-color: var(--forest); background: rgba(219,234,254,0.82); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-content { text-align: center; padding: 24px; }
.file-icon { display: inline-grid; place-items: center; width: 76px; height: 76px; border-radius: 22px; background: linear-gradient(145deg, #08245c, #2563eb); color: #f8fbff; font-weight: 950; margin-bottom: 14px; transform: rotate(-4deg); }
.action-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.job-status { margin-top: 16px; border-radius: 18px; padding: 1rem; background: rgba(219,234,254,0.72); border: 1px solid rgba(37,99,235,0.12); }
.hidden { display: none; }
.feature-list { list-style: none; padding: 0; margin: 22px 0; display: grid; gap: 14px; }
.feature-list li { display: flex; align-items: center; gap: 10px; }
.feature-list span { width: 12px; height: 12px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 6px rgba(37,99,235,0.12); }
.mini-terminal {
  min-height: 160px;
  border-radius: 20px;
  padding: 18px;
  color: #dbeafe;
  background: #071b3d;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.84rem;
  overflow: auto;
  white-space: pre-wrap;
}
.history-panel { margin: 24px 0 70px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.status-pill { display: inline-flex; border-radius: 999px; padding: 0.3rem 0.65rem; font-weight: 850; font-size: 0.78rem; }
.status-completed { background: rgba(44, 139, 91, 0.15); color: #1d7047; }
.status-running { background: rgba(219, 234, 254, 0.95); color: #1e40af; }
.status-failed { background: rgba(239,68,68,0.12); color: #b42318; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.small-link, .danger-button {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.42rem 0.68rem;
  background: rgba(255,255,255,0.56);
  cursor: pointer;
}
.danger-button { color: #b42318; border-color: rgba(239,68,68,0.32); }
.check-line { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 10px !important; }
.check-line input { width: auto; }
.error-panel { margin: 70px auto; max-width: 720px; }

@keyframes blob {
  from { transform: rotate(0deg) scale(1); border-radius: 40% 60% 55% 45%; }
  to { transform: rotate(18deg) scale(1.08); border-radius: 60% 40% 44% 56%; }
}

@media (max-width: 860px) {
  .login-layout, .two-columns, .admin-grid { grid-template-columns: 1fr; }
  .hero-panel { min-height: 420px; }
  .workspace-hero { display: block; }
  .status-orb { display: none; }
  .nav-actions { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .topbar { align-items: flex-start; }
}
