:root {
  --bg: #070b16;
  --bg2: #0c1324;
  --card: #121b2e;
  --card2: #162038;
  --border: rgba(100, 140, 200, .14);
  --border-strong: rgba(100, 140, 200, .28);
  --text: #f0f4fc;
  --text2: #a8b8d4;
  --muted: #6b7d9a;
  --blue: #4f8cff;
  --cyan: #2ee6ff;
  --green: #3dd68c;
  --yellow: #f5c542;
  --red: #ff6b6b;
  --radius: 18px;
  --radius-sm: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --focus: 0 0 0 3px rgba(79, 140, 255, .35);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(79, 140, 255, .12), transparent 60%),
    radial-gradient(900px 500px at 110% 0%, rgba(46, 230, 255, .08), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(12, 19, 36, .8);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; max-width: 880px; margin: 0 auto; }
.brand-logo { width: 40px; height: 40px; border-radius: 10px; }
.brand h1 { font-size: 1.15rem; margin: 0; letter-spacing: .2px; }
.sub { margin: 2px 0 0; color: var(--text2); font-size: .85rem; }

.wrap {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 20px 16px 8px;
  display: grid;
  gap: 16px;
  flex: 1;
}

.card {
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.card h2 { font-size: 1rem; margin: 0; }

.step-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.step-no {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(79, 140, 255, .18); color: var(--cyan);
  font-weight: 700; font-size: .85rem;
  border: 1px solid var(--border-strong);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}
.product-btn {
  text-align: left;
  background: var(--bg2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  font: inherit;
  transition: border-color .15s, background .15s, transform .15s;
}
.product-btn:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.product-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.product-btn.active { border-color: var(--blue); background: rgba(79, 140, 255, .12); }
.product-btn .pname { font-weight: 600; display: block; }
.product-btn .pchip { color: var(--muted); font-size: .78rem; font-family: var(--mono); }

select {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text2) 50%),
                    linear-gradient(135deg, var(--text2) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
select:focus { outline: none; box-shadow: var(--focus); }

.steps { margin: 0 0 16px; padding-left: 20px; color: var(--text2); line-height: 1.7; }
.steps strong { color: var(--text); }
code { font-family: var(--mono); background: var(--bg2); padding: 1px 6px; border-radius: 6px; font-size: .85em; }

.install-slot { display: flex; justify-content: flex-start; }

/* ESP Web Tools button, styled to match the theme */
esp-web-install-button button[slot="activate"] {
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #3a6fe0);
  border: 0;
  border-radius: var(--radius-sm);
  padding: 13px 26px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(79, 140, 255, .3);
}
esp-web-install-button button[slot="activate"]:hover { filter: brightness(1.08); }
esp-web-install-button button[slot="activate"]:focus-visible { outline: none; box-shadow: var(--focus); }

.banner {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: .92rem;
  line-height: 1.5;
}
.banner-warn {
  background: rgba(245, 197, 66, .1);
  border: 1px solid rgba(245, 197, 66, .35);
  color: var(--yellow);
}
.banner-error {
  background: rgba(255, 107, 107, .1);
  border: 1px solid rgba(255, 107, 107, .35);
  color: var(--red);
}

.help ul { margin: 12px 0 0; padding-left: 20px; color: var(--text2); line-height: 1.7; }

.muted { color: var(--muted); }
.small { font-size: .85rem; margin: 12px 0 0; }

.footer {
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
  padding: 20px 16px 28px;
}

@media (max-width: 480px) {
  .wrap { padding: 14px 12px 4px; }
  .card { padding: 16px; }
  .product-grid { grid-template-columns: 1fr 1fr; }
}
