/* Certificate Decoder program — X.509 PEM decoder styles scoped to the cert window. */

.window--cert {
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --good: #2f8a4b;
  --bad: #c0392b;
  --warn: #d98a2b;
  max-width: 640px;
}

.window--cert .window-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 28px 28px;
}

.cert-input {
  width: 100%;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--ink);
  background: #f2f3f5;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 12px 14px;
}

.cert-input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}

.cert-actions {
  display: flex;
  gap: 10px;
}

.cert-btn {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  background: #f2f3f5;
  color: var(--ink);
  transition: transform 120ms ease;
}

.cert-btn:hover {
  transform: scale(1.03);
}

.cert-error {
  font-size: 0.85rem;
  color: var(--bad);
}

.cert-error--warn {
  color: var(--warn);
  background: rgba(217, 138, 43, 0.1);
  border: 1px solid rgba(217, 138, 43, 0.35);
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 600;
}

.cert-result {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cert-result[hidden] {
  display: none;
}

.cert-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.cert-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}

.cert-status-dot--good { background: var(--good); }
.cert-status-dot--bad { background: var(--bad); }
.cert-status-dot--warn { background: var(--warn); }

.cert-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 18px;
  border-top: 1px solid #ececee;
  padding-top: 16px;
}

.cert-facts dt {
  font-size: 0.8rem;
  color: var(--muted);
  padding-top: 2px;
  white-space: nowrap;
}

.cert-facts dd {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink);
  word-break: break-word;
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 6px;
  margin: 0;
}

.cert-facts dd:hover {
  background: #f2f3f5;
}

.cert-facts dd.is-copied::after {
  content: 'copied!';
  position: absolute;
  right: 6px;
  top: -1.3em;
  font-size: 0.7rem;
  font-family: var(--font-ui);
  color: #fff;
  background: var(--ink);
  border-radius: 5px;
  padding: 2px 7px;
}

.cert-hint {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 480px) {
  .window--cert .window-body {
    padding: 18px 16px 22px;
  }

  .cert-facts {
    grid-template-columns: 1fr;
    gap: 2px 0;
  }

  .cert-facts dt {
    padding-top: 8px;
  }
}
