:root {
  --canvas: #090a10;
  --surface: #10121a;
  --raised: #171a25;
  --line: #252a3a;
  --line-strong: #333a50;
  --ink: #f3f5fa;
  --muted: #a4aac0;
  --subtle: #6c7290;
  --accent: #8b7bff;
  --accent-strong: #7563ff;
  --accent-soft: #1d1a3f;
  --cyan: #38c8f0;
  --warning: #fbbf4b;
  --danger: #f87171;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--canvas);
  color: var(--ink);
  font:
    15px/1.55 -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Inter,
    Roboto,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background:
    radial-gradient(60% 40% at 20% 0%, rgba(117, 99, 255, 0.18), transparent),
    radial-gradient(50% 40% at 100% 100%, rgba(56, 200, 240, 0.1), transparent), var(--canvas);
}

.top {
  padding: 22px 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
}

.brand__mark {
  width: 22px;
  height: 27px;
}

.main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 16px 40px;
}

.card {
  width: 100%;
  max-width: 560px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
}

@media (max-width: 480px) {
  .card {
    padding: 22px;
  }
}

h1 {
  margin: 14px 0 8px;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 16px;
}

.muted {
  color: var(--muted);
}

.warn {
  color: var(--warning);
  font-size: 14px;
}

.error {
  min-height: 1px;
  margin: 8px 0;
  color: var(--danger);
  font-size: 14px;
}

.badge {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.badge--warn {
  background: rgba(251, 191, 75, 0.12);
  color: var(--warning);
}

.badge--bad {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
}

.label {
  display: block;
  margin: 8px 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--canvas);
  color: var(--ink);
  font:
    16px/1 ui-monospace,
    'SF Mono',
    Menlo,
    monospace;
  letter-spacing: 0.06em;
}

.input--area {
  height: auto;
  min-height: 140px;
  padding: 12px 14px;
  font-size: 14px;
  letter-spacing: 0;
  line-height: 1.5;
  resize: vertical;
}

.input--text {
  font: inherit;
  letter-spacing: 0;
}

.quote {
  margin: 4px 0 16px;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 123, 255, 0.3);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.button--primary {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  background: var(--accent-strong);
  color: #fff;
}

.button--primary:hover {
  background: var(--accent);
}

.button--primary:disabled {
  opacity: 0.6;
  cursor: progress;
}

.button--ghost {
  height: 32px;
  padding: 0 12px;
  border-color: var(--line-strong);
  background: var(--raised);
  color: var(--ink);
  font-size: 13px;
}

.button--ghost:hover {
  border-color: var(--accent);
}

.link {
  color: var(--accent);
  word-break: break-all;
}

.notice {
  margin-bottom: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(251, 191, 75, 0.3);
  border-radius: 12px;
  background: rgba(251, 191, 75, 0.08);
  color: var(--warning);
  font-size: 14px;
}

.fields {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--canvas);
}

.field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.field:last-child {
  border-bottom: 0;
}

.field__label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.value {
  align-self: center;
  min-width: 0;
  font:
    15px/1.5 ui-monospace,
    'SF Mono',
    Menlo,
    monospace;
  word-break: break-all;
  /* A value can hold several lines (a private key, a pasted block). */
  white-space: pre-wrap;
  user-select: text;
}

.value--note {
  font-family: inherit;
  white-space: pre-wrap;
  word-break: break-word;
}

.value--hidden {
  letter-spacing: 0.15em;
  user-select: none;
}

.actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.foot {
  padding: 24px;
  color: var(--subtle);
  font-size: 12px;
  text-align: center;
}

/* Key–value pairs on the answer form, drawn like a secret item in the app:
   one box per field, the key typed straight into it, the value in its own box. */
.pairs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pair {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.pair__head,
.pair__body {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pair__body {
  align-items: flex-start;
}

.pair__key {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font:
    14px ui-monospace,
    'SF Mono',
    Menlo,
    monospace;
}

.pair__key::placeholder {
  color: var(--subtle);
}

.pair__key:focus {
  outline: none;
}

.pair__value {
  flex: 1;
  min-width: 0;
  height: auto;
  min-height: 44px;
  padding: 11px 12px;
  border-color: var(--line);
  border-radius: 8px;
  font-size: 14px;
  letter-spacing: 0;
  /* 11 + 20 + 11 + border = 44px, the password field's height: no jump. */
  line-height: 20px;
  overflow: hidden;
  resize: none;
  /* A value can hold several lines (a private key, a pasted block). */
  white-space: pre-wrap;
}

/* Hidden: dots even while typing, on every line, as Vercel does it. */
.pair__value--masked {
  -webkit-text-security: disc;
}

/* Browsers without it get a blur instead of plain text. */
@supports not (-webkit-text-security: disc) {
  .pair__value--masked {
    color: transparent;
    text-shadow: 0 0 9px var(--ink);
  }
}

.pair__icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.pair__icon:hover {
  background: var(--raised);
  color: var(--ink);
}

.pair__icon[hidden] {
  display: none;
}

.pair__eye {
  margin-top: 4px;
}

.pair__lock--on,
.pair__lock--on:hover {
  color: var(--accent);
}

.pairs__add {
  gap: 6px;
  margin-top: 8px;
}
