:root {
  color-scheme: dark;
  --bg: #06101a;
  --bg-2: #0b1726;
  --panel: rgba(10, 20, 34, 0.9);
  --panel-strong: rgba(8, 16, 28, 0.96);
  --line: rgba(148, 163, 184, 0.16);
  --text: #e6eef9;
  --muted: #9cb0c8;
  --accent: #8ad9ff;
  --accent-2: #3ddc97;
  --warn: #f6c177;
  --danger: #fca5a5;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(61, 220, 151, 0.18), transparent 28%),
    radial-gradient(circle at 80% 10%, rgba(138, 217, 255, 0.16), transparent 26%),
    linear-gradient(160deg, var(--bg), var(--bg-2));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
  opacity: 0.4;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  color: #05101a;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.shell {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
  display: grid;
  gap: 20px;
}

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

.hero {
  padding: 28px;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -40% auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61, 220, 151, 0.18), transparent 68%);
  pointer-events: none;
}

.panel {
  position: relative;
  padding: 28px;
}

.panel-auth {
  width: min(100%, 460px);
  justify-self: center;
}

.brand,
.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.75rem;
  color: var(--accent);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  margin-top: 12px;
  max-width: 12ch;
  font-size: clamp(2.1rem, 6vw, 3.9rem);
  line-height: 1.02;
}

h2 {
  margin-top: 10px;
  font-size: 1.55rem;
  line-height: 1.1;
}

h3 {
  margin-top: 10px;
  font-size: 1.05rem;
  line-height: 1.3;
  color: #dfe8f5;
}

.subtitle {
  margin-top: 14px;
  max-width: 44ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

.notice-stack {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.notice,
.feedback,
.legacy-copy,
.legacy-details,
.session-summary {
  color: var(--muted);
  line-height: 1.6;
}

.notice {
  font-size: 0.95rem;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  max-width: 420px;
}

.auth-form label {
  display: grid;
  gap: 7px;
}

.auth-form span {
  color: var(--muted);
  font-size: 0.92rem;
}

input {
  width: 100%;
  color: var(--text);
  background: rgba(3, 8, 18, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}

input:focus {
  border-color: rgba(138, 217, 255, 0.75);
  box-shadow: 0 0 0 4px rgba(138, 217, 255, 0.12);
}

.feedback {
  min-height: 1.5em;
  margin-top: 12px;
  font-size: 0.92rem;
}

.session-header {
  display: grid;
  gap: 16px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(7, 15, 26, 0.6);
  color: var(--muted);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--warn);
  box-shadow: 0 0 16px currentColor;
}

.status-dot.ok {
  background: var(--accent-2);
}

.status-dot.bad {
  background: var(--danger);
}

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.legacy-card {
  margin-top: 22px;
  padding: 20px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: var(--panel-strong);
}

.legacy-card h3 {
  margin-top: 10px;
}

.legacy-copy {
  margin-top: 12px;
  color: #d3deec;
}

.legacy-details {
  margin-top: 10px;
  font-size: 0.95rem;
}

.generated-wrap {
  margin-top: 16px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(138, 217, 255, 0.28);
  background: rgba(6, 18, 32, 0.82);
}

.generated-label {
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.generated-value {
  margin-top: 10px;
  font-size: clamp(1.15rem, 3vw, 1.6rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffffff;
  word-break: break-word;
}

.is-hidden {
  display: none !important;
}

pre {
  margin: 16px 0 0;
  padding: 16px;
  border-radius: 16px;
  overflow: auto;
  background: rgba(2, 6, 23, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: #dbeafe;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 760px);
    padding: 20px 0 36px;
  }

  .hero,
  .panel,
  .legacy-card {
    padding: 20px;
  }

  .auth-form {
    max-width: none;
  }

  .toolbar {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}
