:root {
  color-scheme: dark;
  --bg-top: #09111e;
  --bg-bottom: #0f1a30;
  --panel: rgba(11, 19, 34, 0.76);
  --panel-strong: rgba(6, 12, 24, 0.88);
  --panel-soft: rgba(15, 23, 42, 0.7);
  --border: rgba(148, 163, 184, 0.18);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #e2e8f0;
  --muted: #9fb0c6;
  --accent: #38bdf8;
  --accent-strong: #2563eb;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --success: #34d399;
  --warning: #f59e0b;
  --danger: #fb7185;
  --shadow: 0 20px 48px rgba(2, 6, 23, 0.34);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", "PingFang SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(249, 115, 22, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.15), transparent 22%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(255, 255, 255, 0.8), transparent 85%);
}

.page-shell {
  width: min(1440px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero-card,
.card {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  padding: 26px 28px 30px;
  margin-bottom: 20px;
}

.hero-card::after,
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 40%);
}

.card {
  padding: 24px 28px 28px;
  margin-bottom: 18px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(125, 211, 252, 0.2);
  color: #bae6fd;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 24px;
  margin-top: 18px;
  align-items: start;
}

.hero-copy h1 {
  margin: 0 0 14px;
  font-size: clamp(32px, 3vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.hero-copy p,
.section-head p,
.section-note,
.inline-status,
.output-head p,
.info-card span {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.hero-copy code,
.section-note code,
.inline-status code,
.info-card code,
.metric-card strong {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-card,
.info-card,
.timestamp-card {
  min-width: 0;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: rgba(5, 10, 20, 0.52);
  border: 1px solid var(--border);
}

.metric-label,
.timestamp-card span {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: #93a4bb;
}

.metric-card strong,
.timestamp-card strong {
  display: block;
  font-size: 15px;
  line-height: 1.45;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 20px;
}

.section-head h2,
.output-head h3 {
  margin: 0;
}

.section-head h2 {
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.1;
}

.section-kicker {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.credentials-grid,
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.credentials-grid {
  grid-template-columns: minmax(0, 1fr);
}

.field {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.field-wide,
.field-span-2 {
  grid-column: 1 / -1;
}

.field span {
  font-size: 14px;
  font-weight: 600;
  color: #d7e3f3;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  min-width: 0;
  height: 50px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--panel-strong);
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input::placeholder {
  color: #70819a;
}

input:focus,
select:focus {
  border-color: rgba(56, 189, 248, 0.58);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.12);
}

select:disabled,
input:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.stepper {
  display: grid;
  grid-template-columns: 52px minmax(0, 120px) 52px;
  gap: 10px;
  align-items: center;
}

.stepper input {
  text-align: center;
}

.stepper-button,
.copy-button {
  height: 48px;
  border-radius: 14px;
  border: 1px solid transparent;
  color: white;
  transition: transform 120ms ease, background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.stepper-button {
  background: rgba(37, 99, 235, 0.18);
  border-color: rgba(96, 165, 250, 0.24);
}

.stepper-button:hover,
.copy-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.copy-button {
  min-width: 120px;
  padding: 0 18px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.copy-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.generator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.82fr);
  gap: 18px;
  align-items: start;
}

.flow-layout {
  grid-template-columns: minmax(0, 0.92fr) minmax(380px, 1.08fr);
}

.panel {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.panel-form {
  align-content: start;
}

.panel-output {
  gap: 14px;
}

.output-card {
  min-width: 0;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(5, 10, 20, 0.58);
  border: 1px solid var(--border);
}

.output-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 14px;
}

.output-head p {
  margin-top: 6px;
  font-size: 13px;
}

.code-block {
  margin: 0;
  min-width: 0;
  padding: 16px;
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.96) 0%, rgba(3, 7, 18, 0.92) 100%);
  color: #c6e5ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.code-block code {
  display: block;
  min-width: max-content;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre;
}

.code-block.compact code {
  line-height: 1.55;
}

.info-grid,
.timestamp-grid {
  display: grid;
  gap: 12px;
}

.info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.timestamp-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #f8fafc;
}

.inline-status {
  margin-top: 2px;
  font-size: 13px;
}

.inline-status.is-error {
  color: var(--danger);
}

.inline-status.is-success {
  color: var(--success);
}

.section-note {
  margin-top: 14px;
  font-size: 14px;
}

@media (max-width: 1100px) {
  .hero-top,
  .generator-layout,
  .flow-layout {
    grid-template-columns: 1fr;
  }

  .panel-output {
    order: 2;
  }
}

@media (max-width: 768px) {
  .page-shell {
    width: min(100vw - 32px, 1440px);
    padding: 18px 0 40px;
  }

  .hero-card,
  .card {
    padding: 20px 18px 22px;
    border-radius: 20px;
  }

  .hero-metrics,
  .credentials-grid,
  .form-grid,
  .info-grid,
  .timestamp-grid {
    grid-template-columns: 1fr;
  }

  .section-head,
  .output-head {
    flex-direction: column;
    align-items: stretch;
  }

  .stepper {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
  }

  .copy-button {
    width: 100%;
  }
}
