:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: rgba(13, 24, 43, 0.76);
  --panel-strong: rgba(16, 31, 55, 0.92);
  --text: #edf6ff;
  --muted: #9fb3c8;
  --line: rgba(255, 255, 255, 0.12);
  --primary: #6ee7f9;
  --secondary: #a78bfa;
  --success: #34d399;
  --danger: #fb7185;
  --warning: #fbbf24;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 10%, rgba(103, 232, 249, 0.18), transparent 30rem),
    radial-gradient(circle at 80% 20%, rgba(167, 139, 250, 0.16), transparent 30rem),
    linear-gradient(135deg, #07111f 0%, #0d1728 48%, #08121f 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 76%);
}

.orb {
  position: fixed;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  filter: blur(48px);
  opacity: .32;
  pointer-events: none;
}

.orb-one { background: #22d3ee; left: -6rem; top: 14rem; }
.orb-two { background: #8b5cf6; right: -7rem; top: 4rem; }

a { color: inherit; text-decoration: none; }

.topbar,
.footer,
.page-shell {
  width: min(1180px, calc(100% - 36px));
  margin-inline: auto;
}

.topbar {
  position: sticky;
  top: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(7, 17, 31, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.brand,
.topbar nav,
.hero-actions,
.section-heading,
.form-section-title,
.submit-bar,
.log-header {
  display: flex;
  align-items: center;
}

.brand { gap: 12px; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: #06111f;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.topbar nav { gap: 12px; color: var(--muted); }
.page-shell { position: relative; padding: 56px 0 36px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  color: #06111f;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 16px 42px rgba(103, 232, 249, .18);
}

.button-small { min-height: 38px; padding: 0 14px; font-size: 14px; }
.button-ghost { color: var(--text); background: rgba(255,255,255,.08); box-shadow: none; border: 1px solid var(--line); }
.danger-button { color: #fff; background: var(--danger); box-shadow: none; }
.confirm-dialog { color: var(--text); background: var(--panel-strong); border: 1px solid var(--line); border-radius: 22px; padding: 26px; box-shadow: var(--shadow); }
.confirm-dialog::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
.confirm-dialog form > div { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.auth-card { max-width: 560px; margin: 8vh auto; padding: 42px; text-align: center; }
.auth-card h1 { font-size: clamp(38px, 7vw, 62px); }
.auth-card .brand-mark { margin: 0 auto 24px; }
.auth-actions { display: grid; gap: 12px; margin-top: 28px; }
.editor-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; }
.file-list { padding: 14px; align-self: start; }
.file-link { display: block; padding: 12px; border-radius: 12px; color: var(--muted); }
.file-link.active, .file-link:hover { color: var(--text); background: rgba(255,255,255,.08); }
.editor { padding: 18px; }
.editor textarea { width: 100%; min-height: 620px; resize: vertical; border: 1px solid var(--line); border-radius: 16px; padding: 18px; color: var(--text); background: #050b14; font: 13px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; }
.cmdb-grid { display: grid; gap: 18px; }
.cmdb-card { padding: 24px; }
.cmdb-card-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.cmdb-card details { margin: 18px 0; }
.cmdb-card pre { overflow: auto; padding: 16px; border-radius: 14px; background: #050b14; color: var(--muted); }
.cmdb-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.editor-tabs { display: flex; gap: 10px; margin: 20px 0; }
.job-edit-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 16px; padding: 16px; color: var(--text); background: #050b14; font: 13px/1.6 ui-monospace, monospace; }

.glass-card {
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr);
  gap: 28px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 12px;
  font-weight: 800;
}

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(42px, 8vw, 78px); line-height: .95; letter-spacing: -.06em; margin-bottom: 22px; }
h2 { font-size: 28px; letter-spacing: -.03em; }
h3 { font-size: 18px; }
.hero-text, .muted, .feature p, .summary-card p { color: var(--muted); line-height: 1.7; }
.hero-actions { gap: 14px; flex-wrap: wrap; }

.hero-panel { padding: 28px; }
.availability-ring {
  display: grid;
  place-items: center;
  width: 220px;
  height: 220px;
  margin: 0 auto 28px;
  border-radius: 50%;
  background: conic-gradient(var(--success), var(--primary), var(--secondary), rgba(255,255,255,.08) 82%);
  position: relative;
}
.availability-ring::after { content: ""; position: absolute; inset: 18px; border-radius: inherit; background: #0b1628; }
.availability-ring span, .availability-ring small { position: relative; z-index: 1; }
.availability-ring span { font-size: 44px; font-weight: 900; }
.availability-ring small { grid-row: 2; color: var(--muted); margin-top: -64px; }

.route-list { display: grid; gap: 12px; }
.route-list div, .target-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.05);
}
.route-list span, .target-row small { color: var(--muted); }

.grid { display: grid; gap: 18px; margin-top: 28px; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.feature, .summary-card { padding: 24px; }
.icon { font-size: 34px; display: inline-block; margin-bottom: 14px; }

.section-heading { justify-content: space-between; gap: 18px; margin: 46px 0 18px; }
.section-heading.compact { margin-top: 0; align-items: flex-start; }
.section-heading.compact h1 { font-size: clamp(34px, 6vw, 58px); }

.provider-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.provider-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 116px;
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 55%);
  border-radius: 24px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent), transparent 82%), rgba(255,255,255,.04));
}
.provider-card p { color: var(--muted); margin: 0; }

.pill, .status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.ready, .succeeded { color: #052e1e; background: var(--success); }
.planned, .queued { color: #3b2600; background: var(--warning); }
.running { color: #06111f; background: var(--primary); }
.failed { color: #3f0713; background: var(--danger); }

.table-card { overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 16px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.empty-state { text-align: center; padding: 52px 24px; }

.deploy-form { display: grid; gap: 18px; }
.form-section { padding: 24px; }
.form-section-title { gap: 14px; margin-bottom: 22px; align-items: flex-start; }
.form-section-title p { color: var(--muted); margin: 0; }
.step { display: grid; place-items: center; min-width: 36px; height: 36px; border-radius: 12px; background: rgba(110, 231, 249, .14); color: var(--primary); font-weight: 900; }
.form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
label { display: grid; gap: 8px; color: var(--muted); font-weight: 700; }
input, select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 13px;
  color: var(--text);
  background: rgba(2, 8, 23, .55);
  outline: none;
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(110, 231, 249, .12); }
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
  color: var(--text);
  background: rgba(2, 8, 23, .55);
  outline: none;
  resize: vertical;
}
textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(110, 231, 249, .12); }

.cloud-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cloud-option {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 56%);
  border-radius: 22px;
  background: color-mix(in srgb, var(--accent), transparent 90%);
}
.cloud-option input[type="checkbox"] { width: 18px; min-height: 18px; accent-color: var(--accent); }
.cloud-option small { display: block; color: var(--muted); margin-top: 3px; }
.cloud-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 14px; background: var(--accent); color: white; font-weight: 900; }
.region-input, .credential-input { grid-column: 1 / -1; }
.disabled { opacity: .58; }

.service-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.service-card { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.045); }
.toggle { display: flex; align-items: center; gap: 10px; color: var(--text); }
.toggle input, .mini-check input { width: 18px; min-height: 18px; accent-color: var(--primary); }
.mini-check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.submit-bar { justify-content: space-between; padding: 18px 22px; }
.submit-bar p { margin: 4px 0 0; color: var(--muted); }
.helper-text { margin: 16px 0 0; color: var(--muted); }
.helper-text a { color: var(--primary); font-weight: 800; }

.warning-card {
  padding: 18px 22px;
  margin-bottom: 18px;
  border-color: rgba(251, 191, 36, .36);
  background: rgba(251, 191, 36, .08);
}
.warning-card p { margin: 6px 0 0; color: var(--muted); line-height: 1.6; }
.credentials-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 18px; }
.credential-form { display: grid; gap: 18px; }
.credentials-top-grid { grid-template-columns: repeat(2, 1fr); }
.provider-fields { display: grid; gap: 12px; }
.provider-fields h3 { margin-bottom: 0; }
.login-stack, .profile-stack { display: grid; gap: 12px; }
.login-card, .profile-row {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent, var(--primary)), transparent 58%);
  border-radius: 18px;
  background: rgba(255,255,255,.045);
}
.login-card small, .profile-row small { display: block; color: var(--muted); margin-top: 4px; }
.login-card button:disabled { cursor: not-allowed; opacity: .55; }
.credentials-grid { grid-template-columns: repeat(2, 1fr); }
.credential-profile-card { display: grid; gap: 16px; align-items: stretch; }
.credential-card-header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.profile-row { grid-template-columns: 1fr auto; align-items: center; }

.flash-stack { display: grid; gap: 10px; margin-bottom: 18px; }
.flash { padding: 14px 16px; border-radius: 16px; background: rgba(255,255,255,.08); border: 1px solid var(--line); }
.flash.success { border-color: rgba(52, 211, 153, .45); }

.summary-card h2, .log-card h2 { margin-bottom: 14px; }
.target-stack { display: grid; gap: 12px; }
.cloud-badge { align-self: center; padding: 8px 10px; border-radius: 12px; background: rgba(110, 231, 249, .12); color: var(--primary); font-weight: 900; text-transform: uppercase; }
.log-card { margin-top: 18px; padding: 22px; }
pre {
  max-height: 620px;
  overflow: auto;
  margin: 0;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(2, 8, 23, .76);
  color: #d9f99d;
  white-space: pre-wrap;
}

.footer { display: flex; justify-content: space-between; gap: 16px; padding: 24px 0 40px; color: var(--muted); font-size: 13px; }

@media (max-width: 980px) {
  .hero, .grid.three, .grid.two, .provider-grid, .form-grid, .cloud-picker, .service-grid, .credentials-layout, .credentials-grid, .credentials-top-grid { grid-template-columns: 1fr; }
  .topbar, .footer { align-items: flex-start; flex-direction: column; }
  h1 { font-size: 42px; }
}
