/* Generator + shared form/results styles.
   Also loaded by /distributor (which adds distributor.css on top). */

.lede { margin-bottom: var(--sp-4); }

/* ============================================================
   Network badge (pill)
   ============================================================ */
.net-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  margin: 0 0 var(--sp-5) 0;
  background: var(--surface);
  color: var(--fg-muted);
}
.net-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fg-dim);
  display: inline-block;
}
.net-ok {
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.3);
  background: var(--success-soft);
}
.net-ok::before {
  background: var(--success);
  animation: dt-pulse 2s ease-in-out infinite;
}
.net-bad {
  color: var(--error);
  border-color: rgba(239, 68, 68, 0.35);
  background: var(--error-soft);
}
.net-bad::before { background: var(--error); }

/* ============================================================
   Form card
   ============================================================ */
.form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
}

.field {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: var(--sp-3);
  align-items: center;
}
.field-toggle { grid-template-columns: 1fr; }

.field label {
  color: var(--fg);
  font-size: 0.875rem;
  font-weight: 500;
}

.field input[type="number"],
.field input[type="text"],
.field input[type="password"] {
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
  min-height: 40px;
}
/* crypto data inputs get mono */
.field input#vanity-prefix,
.field input#vanity-suffix,
.field input#passphrase,
.field input#passphrase-confirm,
.field input#decrypt-passphrase {
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.field input:disabled { opacity: 0.5; cursor: not-allowed; }

.field input::placeholder { color: var(--fg-dim); }

.field .hint {
  color: var(--fg-muted);
  font-size: 0.8125rem;
}

.estimate {
  margin: 0;
  padding-left: 172px;
  color: var(--fg-muted);
  font-size: 0.8125rem;
}
.warn {
  color: var(--warning);
  font-size: 0.8125rem;
  margin: 0;
  padding-left: 172px;
  min-height: 1em;
}
.warn-strong { color: var(--error); font-weight: 600; }

.toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  cursor: pointer;
  color: var(--fg);
  font-size: 0.9375rem;
  font-weight: 500;
}
.toggle input {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.enc-fields {
  border-left: 2px solid var(--primary-soft);
  padding-left: var(--sp-4);
  margin-left: var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* ============================================================
   Buttons — actions row
   ============================================================ */
.actions {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}
.actions button {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9375rem;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 10px 18px;
  cursor: pointer;
  min-height: 44px;
  transition: border-color 120ms ease, background 120ms ease, transform 80ms ease, color 120ms ease;
}
.actions button:not(:disabled):hover {
  border-color: var(--fg-muted);
  background: var(--surface-2);
}
.actions button:not(:disabled):active { transform: translateY(1px); }

.actions button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.actions button.primary:not(:disabled):hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.actions button:disabled {
  color: var(--fg-dim);
  cursor: not-allowed;
  opacity: 0.55;
}
.actions button.primary:disabled {
  background: var(--surface-2);
  border-color: var(--border);
  opacity: 0.7;
}

/* ============================================================
   Results list
   ============================================================ */
.results-section { margin-bottom: var(--sp-5); }

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--sp-1) var(--sp-3);
  font-size: 0.9375rem;
  color: var(--fg);
  font-weight: 600;
}
.results-header > span:first-child { color: var(--fg); font-weight: 600; }
.results-header button {
  font-family: var(--font-sans);
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--fg);
  border-radius: var(--r-sm);
  font-size: 0.8125rem;
  padding: 6px 12px;
  cursor: pointer;
  min-height: 32px;
  transition: border-color 120ms ease, background 120ms ease;
}
.results-header button:not(:disabled):hover {
  border-color: var(--fg-muted);
  background: var(--surface-2);
}

.results {
  max-height: 460px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}

.row {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  gap: var(--sp-2);
  padding: 10px var(--sp-4);
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  align-items: center;
}
.row:last-child { border-bottom: 0; }
.row .idx {
  color: var(--fg-dim);
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 0.8125rem;
}
.row .addr {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--fg);
}

.row button {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.75rem;
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 4px 10px;
  cursor: pointer;
  min-height: 28px;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.row button:hover {
  border-color: var(--fg-muted);
  color: var(--fg);
}
.row button[aria-pressed="true"] {
  color: var(--primary-hover);
  border-color: var(--primary);
  background: var(--primary-soft);
}

.row .key {
  grid-column: 1 / -1;
  margin: var(--sp-2) 0 var(--sp-1) 0;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--warning);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-all;
  user-select: all;
}

/* ============================================================
   Downloads
   ============================================================ */
.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.downloads button {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9375rem;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 10px 18px;
  cursor: pointer;
  min-height: 44px;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}
.downloads button:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-hover);
}

/* ============================================================
   Decrypt panel
   ============================================================ */
.rule {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--sp-5) 0;
}
.decrypt-toggle {
  color: var(--fg);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: color 120ms ease;
}
.decrypt-toggle:hover { color: var(--primary-hover); }

.decrypt-panel {
  margin-top: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
}
.decrypt-panel .muted {
  color: var(--fg-muted);
  font-size: 0.875rem;
  margin: 0;
}
.decrypt-panel code {
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.8125rem;
  color: var(--fg);
}

.decrypt-zone {
  display: block;
  position: relative;
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-md);
  padding: var(--sp-5);
  text-align: center;
  color: var(--fg-muted);
  cursor: pointer;
  font-size: 0.875rem;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}
.decrypt-zone:hover,
.decrypt-zone.dragging {
  border-color: var(--primary);
  color: var(--primary-hover);
  background: var(--primary-soft);
}
.decrypt-zone input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

#decrypt-go {
  align-self: flex-start;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9375rem;
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  border-radius: var(--r-sm);
  padding: 10px 18px;
  cursor: pointer;
  min-height: 44px;
  transition: background 120ms ease, border-color 120ms ease;
}
#decrypt-go:disabled {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--fg-dim);
  cursor: not-allowed;
  opacity: 0.7;
}
#decrypt-go:not(:disabled):hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 640px) {
  .form { padding: var(--sp-4); }
  .field {
    grid-template-columns: 1fr;
    gap: var(--sp-2);
  }
  .field label { font-size: 0.8125rem; }
  .field .hint { grid-column: 1; }
  .estimate, .warn { padding-left: 0; }
  .actions { flex-direction: column; }
  .actions button { width: 100%; }
  .row {
    grid-template-columns: 28px 1fr auto auto;
    font-size: 0.8125rem;
    padding: 10px 12px;
  }
  .row .addr { font-size: 0.75rem; }
  .decrypt-panel { padding: var(--sp-4); }
}
