/*
 * Security pages (ADR 0045): the report form at /security and the advisories
 * register at /security/advisories.
 *
 * Loaded on top of css/site.css with a cache buster of its own, like
 * css/legal-page.css. The form is long and read by people who write reports
 * for a living: one column, labels above fields, hints in a quieter grey,
 * errors in words under the field they belong to, never colour alone.
 *
 * The submit button owns every state (ADR 0037): it starts at the darker
 * blue, goes darker on hover and when pressed, and a busy button turns
 * neutral with a dark label.
 */

/* ── Hero ── */

.security-hero .section-title {
  max-width: 22ch;
  text-wrap: balance;
}

.security-quick {
  align-self: start;
  border: 1px solid #e4e2e1;
  border-radius: 12px;
  background: #ffffff;
  padding: 1.5rem;
}

.security-quick__title {
  margin: 0 0 0.75rem;
  font-family: var(--heading);
  font-size: 1.05rem;
  font-weight: 600;
}

.security-quick__list,
.security-list {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.65;
}

.security-quick__list li,
.security-list li {
  margin: 0.4rem 0;
}

.security-quick__register {
  margin: 1rem 0 0;
  font-size: 0.95rem;
}

.security-quick a,
.security-rules a,
.security-register a,
.security-check a {
  color: #0058be;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.security-meta {
  margin: 0.5rem 0 1.5rem;
  color: #5b6170;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.security-h2 {
  margin: 0 0 0.5rem;
  font-family: var(--heading);
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 600;
}

.security-h3 {
  margin: 1.75rem 0 0.75rem;
  font-family: var(--heading);
  font-size: 1.1rem;
  font-weight: 600;
}

.security-lead {
  margin: 0 0 1.5rem;
  max-width: 68ch;
  color: #424754;
  line-height: 1.6;
}

/* ── The form ── */

.security-card {
  max-width: 52rem;
  border: 1px solid #e4e2e1;
  border-radius: 14px;
  background: #ffffff;
  padding: clamp(1.25rem, 4vw, 2.5rem);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.06);
}

.security-form {
  display: grid;
  gap: 1.1rem;
}

.security-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
  /* Two fields side by side keep their inputs level when only one has a hint. */
  align-items: end;
}

.security-field {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.security-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.security-hint {
  margin: 0;
  color: #5b6170;
  font-size: 0.85rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.security-input {
  width: 100%;
  min-width: 0;
  border: 1px solid #c9ccd3;
  border-radius: 8px;
  background: #ffffff;
  color: #1b1c1c;
  font: inherit;
  font-size: 1rem;
  padding: 0.65rem 0.75rem;
}

.security-input--area {
  min-height: 8rem;
  resize: vertical;
  line-height: 1.5;
}

.security-input:focus-visible {
  outline: 3px solid rgba(33, 112, 228, 0.35);
  outline-offset: 1px;
  border-color: #2170e4;
}

.security-input[aria-invalid="true"] {
  border-color: #b3261e;
}

.security-error {
  margin: 0;
  color: #b3261e;
  font-size: 0.85rem;
  font-weight: 600;
}

.security-summary {
  margin: 0 0 1.25rem;
  border-left: 4px solid #b3261e;
  border-radius: 6px;
  background: #fdecea;
  color: #7a1c15;
  padding: 0.75rem 1rem;
  font-weight: 600;
}

.security-check {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  line-height: 1.5;
}

.security-check input {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
  accent-color: #2170e4;
}

/* The field a person never sees and a form-filling bot fills. */
.security-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.security-privacy {
  margin: 0.25rem 0 0;
  color: #5b6170;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ── Buttons ── */

.security-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 2.9rem;
  border: 0;
  border-radius: 10px;
  padding: 0.75rem 1.5rem;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.security-submit {
  background: #2170e4;
  color: #ffffff;
}

.security-submit:hover:not(:disabled) {
  background: #0058be;
  color: #ffffff;
}

.security-submit:active:not(:disabled) {
  background: #00469a;
  color: #ffffff;
}

.security-submit:focus-visible {
  outline: 3px solid rgba(33, 112, 228, 0.45);
  outline-offset: 2px;
}

.security-submit:disabled {
  background: #e4e2e1;
  color: #424754;
  cursor: progress;
}

.security-secondary {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  margin: 0.75rem 0.75rem 0 0;
  border: 1px solid #c9ccd3;
  border-radius: 10px;
  padding: 0.5rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.security-secondary {
  background: #ffffff;
  color: #0058be;
}

.security-secondary:hover {
  background: #f0eded;
  color: #00469a;
}

.security-mail {
  display: inline-block;
  margin-top: 0.75rem;
  color: #0058be;
  font-weight: 600;
}

/* ── Result ── */

.security-result {
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
}

.security-result--ok {
  border-left: 4px solid #1e7a46;
  background: #e8f5ed;
}

.security-result--failed {
  border-left: 4px solid #b3261e;
  background: #fdecea;
}

.security-result__title {
  margin: 0 0 0.5rem;
  font-family: var(--heading);
  font-size: 1.2rem;
}

.security-result__reference {
  font-family: var(--mono);
  font-weight: 600;
}

/* ── The rules ── */

.security-rules__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 2.5rem;
}

.security-rules__block .security-h3 {
  margin-top: 0;
}

/* ── The register ── */

.security-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin: 1.5rem 0 0;
}

.security-feed {
  color: #0058be;
  font-size: 0.95rem;
}

.security-empty {
  margin: 0;
  border: 1px dashed #c9ccd3;
  border-radius: 10px;
  padding: 1.25rem;
  color: #424754;
}

.security-entry {
  max-width: 60rem;
  margin: 0 0 1.25rem;
  border: 1px solid #e4e2e1;
  border-radius: 12px;
  background: #ffffff;
  padding: 1.5rem;
}

.security-entry__id {
  margin: 0;
  color: #5b6170;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.security-entry__title {
  margin: 0.25rem 0 0.5rem;
  font-family: var(--heading);
  font-size: 1.2rem;
}

.security-entry__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 0;
}

.security-badge {
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  background: #eae7e7;
  color: #1b1c1c;
}

.security-badge--resolved { background: #e8f5ed; color: #14532d; }
.security-badge--mitigated { background: #e7effc; color: #0b3f8c; }
.security-badge--investigating { background: #fff4e5; color: #7a3e00; }
.security-badge--severity-critical { background: #fdecea; color: #7a1c15; }
.security-badge--severity-high { background: #fff1e6; color: #7a3300; }

.security-entry__cvss {
  font-family: var(--mono);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.security-entry__summary {
  margin: 1rem 0;
  line-height: 1.65;
}

.security-entry__facts {
  display: grid;
  grid-template-columns: minmax(9rem, 14rem) minmax(0, 1fr);
  gap: 0.5rem 1.25rem;
  margin: 0;
}

.security-entry__facts dt {
  font-weight: 600;
}

.security-entry__facts dd {
  margin: 0;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.security-acks__name {
  font-weight: 600;
}

/* ── Narrow screens ── */

@media (max-width: 760px) {
  .security-row,
  .security-rules__grid,
  .security-entry__facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .security-submit {
    justify-self: stretch;
  }
}
