/* ============================================================
   DRACOZONA // Post-Quantum TLS Check
   Builds on styles.css: same variables, terminal cards and buttons.
   ============================================================ */

.pqc { max-width: 900px; }

.pqc-title {
  font-family: var(--font-mono);
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: var(--heading);
  letter-spacing: 1px;
}

.pqc-h2 {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--heading);
  margin: 1rem 0 0.8rem;
}

/* ---------- Form ---------- */
.pqc-form { display: grid; gap: 0.7rem; }
.pqc-form label { display: block; }

.pqc-input-row { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.pqc-input-row input {
  flex: 1 1 260px;
  min-width: 0;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  transition: border-color .2s, box-shadow .2s;
}
.pqc-input-row input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}
.pqc-input-row .btn { flex: 0 0 auto; }
.pqc-input-row .btn:disabled { opacity: 0.6; cursor: progress; transform: none; }

.pqc-note-error { color: #ff5f57; }
.pqc-note-busy  { color: var(--cyan); }
.pqc-note-busy::after {
  content: "▋";
  margin-left: 4px;
  animation: pqc-blink 1s steps(1) infinite;
}
@keyframes pqc-blink { 50% { opacity: 0; } }

/* ---------- Result ---------- */
.pqc-result { margin-top: 1.6rem; animation: fade .45s ease both; }

.pqc-verdict {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: clamp(1.2rem, 4vw, 1.8rem);
  border-bottom: 1px solid var(--border);
}
.pqc-icon {
  flex: 0 0 auto;
  width: 52px; height: 52px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.03);
}
.pqc-icon svg { width: 24px; height: 24px; }
.pqc-target {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.pqc-verdict h2 {
  font-family: var(--font-mono);
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
  margin: 0.15rem 0 0.35rem;
}
.pqc-verdict p.pqc-body { color: var(--text); max-width: 62ch; }

/* tones */
.tone-good    { color: #28c840; }
.tone-warn    { color: #febc2e; }
.tone-bad     { color: #ff5f57; }
.tone-neutral { color: var(--muted); }
.pqc-verdict.tone-good .pqc-icon    { box-shadow: 0 0 18px rgba(40, 200, 64, 0.35); }
.pqc-verdict.tone-warn .pqc-icon    { box-shadow: 0 0 18px rgba(254, 188, 46, 0.3); }
.pqc-verdict.tone-bad .pqc-icon     { box-shadow: 0 0 18px rgba(255, 95, 87, 0.3); }
/* the tone colors the icon and title; the rest of the text keeps its own colors */
.pqc-verdict .pqc-target { color: var(--muted); }
.pqc-verdict .pqc-body   { color: var(--text); }

.pqc-section {
  padding: clamp(1rem, 3.5vw, 1.5rem) clamp(1.2rem, 4vw, 1.8rem);
  border-bottom: 1px solid var(--border);
}
.pqc-section:last-child { border-bottom: 0; }
.pqc-section h3 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--cyan);
  letter-spacing: 0.5px;
  margin-bottom: 0.8rem;
}

.pqc-groups { list-style: none; display: grid; gap: 0.9rem; }
.pqc-groups li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
}
.pqc-group-name { font-family: var(--font-mono); font-size: 0.9rem; color: var(--heading); }
.pqc-group-desc { font-size: 0.78rem; color: var(--muted); }
.pqc-status { font-family: var(--font-mono); font-size: 0.8rem; font-weight: 700; white-space: nowrap; }

.pqc-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
}
.pqc-facts dt { font-family: var(--font-mono); font-size: 0.74rem; color: var(--cyan); }
.pqc-facts dd { font-size: 0.88rem; color: var(--text); margin-top: 0.2rem; overflow-wrap: anywhere; }
.pqc-facts .pqc-warn { display: block; color: #ff5f57; font-size: 0.8rem; }

.pqc-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }

/* ---------- About ---------- */
.pqc-about { list-style: none; display: grid; gap: 0.8rem; color: var(--muted); font-size: 0.92rem; }
.pqc-about li { padding-left: 1.2rem; position: relative; }
.pqc-about li::before { content: "›"; position: absolute; left: 0; color: var(--purple-bright); font-family: var(--font-mono); }
.pqc-about strong { color: var(--text); font-weight: 600; }
.pqc code, .pqc-about code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  color: var(--purple-bright);
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
  overflow-wrap: anywhere;
}

/* ---------- TLS configuration ---------- */
.pqc-rating {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  padding: 0.2rem 0.55rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.pqc-summary-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}
.pqc-summary-title { font-family: var(--font-mono); font-size: 1.02rem; font-weight: 700; }

.pqc-counts { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }
.pqc-count {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}
.pqc-count strong { font-size: 0.86rem; }

.pqc-issues { list-style: none; margin-top: 0.8rem; display: grid; gap: 0.3rem; }
.pqc-issues li { font-size: 0.86rem; padding-left: 1.1rem; position: relative; }
.pqc-issues li::before { content: "›"; position: absolute; left: 0; font-family: var(--font-mono); }

.pqc-state {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.pqc-state-enabled    { color: var(--cyan); border: 1px solid var(--border-cyan); }
.pqc-state-disabled   { color: var(--muted); border: 1px solid rgba(139, 147, 167, 0.35); }
.pqc-state-not-tested { color: var(--muted); border: 1px dashed rgba(139, 147, 167, 0.35); }

.pqc-suites { border: 1px solid var(--border); border-radius: 10px; background: rgba(0, 0, 0, 0.2); }
.pqc-suites + .pqc-suites { margin-top: 0.8rem; }
.pqc-suites > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.9rem;
  padding: 0.7rem 0.9rem;
}
.pqc-suites > summary::-webkit-details-marker { display: none; }
.pqc-suites > summary::before { content: "▸"; color: var(--cyan); font-family: var(--font-mono); transition: transform .2s; }
.pqc-suites[open] > summary::before { transform: rotate(90deg); }
.pqc-suites > summary:focus-visible { outline: 1px solid var(--cyan); border-radius: 10px; }
.pqc-suites-proto { font-family: var(--font-mono); font-weight: 700; color: var(--heading); }
.pqc-suites-tally { font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); }

.pqc-cipher-list { list-style: none; border-top: 1px solid var(--border); }
.pqc-cipher {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.4rem 1rem;
  padding: 0.65rem 0.9rem 0.65rem 0.8rem;
  border-left: 3px solid transparent;
}
.pqc-cipher + .pqc-cipher { border-top: 1px solid rgba(130, 90, 230, 0.12); }
.pqc-cipher.rating-secure   { border-left-color: rgba(40, 200, 64, 0.6); }
.pqc-cipher.rating-weak     { border-left-color: rgba(254, 188, 46, 0.7); }
.pqc-cipher.rating-insecure { border-left-color: rgba(255, 95, 87, 0.8); background: rgba(255, 95, 87, 0.04); }
.pqc-cipher-main { min-width: 0; }
.pqc-cipher-name { font-family: var(--font-mono); font-size: 0.82rem; color: var(--heading); overflow-wrap: anywhere; }
.pqc-cipher-meta { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); margin-top: 0.1rem; }
.pqc-cipher-notes { list-style: none; margin-top: 0.3rem; display: grid; gap: 0.15rem; }
.pqc-cipher-notes li { font-size: 0.78rem; color: var(--text); padding-left: 0.9rem; position: relative; }
.pqc-cipher-notes li::before { content: "!"; position: absolute; left: 0; font-family: var(--font-mono); font-weight: 700; }
.pqc-cipher.rating-weak .pqc-cipher-notes li::before     { color: #febc2e; }
.pqc-cipher.rating-insecure .pqc-cipher-notes li::before { color: #ff5f57; }
.pqc-incomplete { padding: 0 0.9rem 0.7rem; color: #febc2e; }
.pqc-order-note { margin-top: 0.8rem; }

@media (max-width: 560px) {
  .pqc-cipher { flex-direction: column; }
  .pqc-cipher .pqc-rating { align-self: flex-start; }
}

/* Keep the badge beside long notes on wider screens */
@media (min-width: 561px) {
  .pqc-groups li { flex-wrap: nowrap; }
  .pqc-groups li > div { flex: 1 1 auto; min-width: 0; }
}

/* ============================================================
   PDF REPORT  (Export PDF → print → "Save as PDF")
   A plain assessment document: letterhead, ruled tables, numbered
   sections and findings. Colour only where it carries meaning.
   ============================================================ */
.rpt { display: none; }

@media print {
  /* Zero page margin: leaves browsers no room for their own header/footer
     (title, URL, "1 of 3"). Margins come from .rpt padding + the page frame. */
  @page { size: A4; margin: 0; }
  html, body { margin: 0 !important; padding: 0 !important; }

  /* Print only the report once a result exists */
  body.pqc-has-report > *:not(#pqcReport) { display: none !important; }
  body.pqc-has-report {
    display: block;
    background: #fff !important;
    color: #1d2125;
    min-height: 0;
  }
  body.pqc-has-report::before { display: none !important; }
  body.pqc-has-report .rpt { display: block; }

  .rpt {
    --r-ink: #1d2125;
    --r-muted: #5f666d;
    --r-rule: #1d2125;
    --r-line: #d5d9dd;
    --r-accent: #0b5f73;
    --r-good: #1e6b3a;
    --r-warn: #9a5b00;
    --r-bad:  #a3221b;
    font-family: var(--font-sans);
    font-size: 9.5pt;
    line-height: 1.5;
    color: var(--r-ink);
    padding: 0 18mm;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .rpt * { box-shadow: none !important; text-shadow: none !important; }
  .rpt p { margin: 0 0 6pt; }

  /* Page frame: thead/tfoot repeat on every printed page */
  .rpt-page { width: 100%; border-collapse: collapse; }
  .rpt-page > thead { display: table-header-group; }
  .rpt-page > tfoot { display: table-footer-group; }
  .rpt-page > * > tr > td { padding: 0; }
  .rpt-page-top { height: 16mm; }
  .rpt-page-foot {
    height: 14mm;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 0.5pt solid var(--r-line);
    margin-top: 6mm;
    font-size: 7.5pt;
    color: var(--r-muted);
  }

  /* Letterhead */
  .rpt-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-bottom: 8pt;
    border-bottom: 1pt solid var(--r-rule);
  }
  .rpt-brand { display: flex; align-items: center; gap: 8pt; }
  .rpt-logo-tile { width: 30pt; height: 30pt; background: #0b0d12; display: grid; place-items: center; }
  .rpt-logo { width: 27pt; height: 27pt; object-fit: contain; }
  .rpt-brand-name { font-size: 12pt; font-weight: 700; line-height: 1.2; }
  .rpt-brand-sub { font-size: 7.5pt; color: var(--r-muted); }
  .rpt-head-meta { text-align: right; font-size: 7.5pt; color: var(--r-muted); line-height: 1.45; }

  /* Title */
  .rpt-title { margin: 26pt 0 14pt; }
  .rpt-title h1 { font-size: 20pt; font-weight: 700; line-height: 1.2; margin: 0; color: var(--r-ink); letter-spacing: -0.2pt; }
  .rpt-subject { font-size: 13pt; color: var(--r-accent); margin: 3pt 0 0 !important; overflow-wrap: anywhere; }

  /* Document details */
  .rpt-details { border-collapse: collapse; width: 100%; font-size: 8.5pt; break-inside: avoid; border-top: 0.5pt solid var(--r-line); }
  .rpt-details th, .rpt-details td { text-align: left; padding: 3pt 0; border-bottom: 0.5pt solid var(--r-line); vertical-align: top; }
  .rpt-details th { width: 34%; font-weight: 400; color: var(--r-muted); }
  .rpt-details td { overflow-wrap: anywhere; }

  /* Sections */
  .rpt-section { margin-top: 20pt; }
  .rpt-section h2 {
    font-size: 12.5pt;
    font-weight: 700;
    color: var(--r-ink);
    margin: 0 0 7pt;
    break-after: avoid;
  }
  .rpt-section h3 {
    font-size: 9.5pt;
    font-weight: 700;
    margin: 12pt 0 4pt;
    break-after: avoid;
    display: flex;
    align-items: baseline;
    gap: 6pt;
  }
  .rpt-fref { color: var(--r-muted); font-weight: 400; min-width: 18pt; }
  .rpt-lead { font-size: 8pt; color: var(--r-muted); }
  .rpt-mono { font-family: var(--font-mono); font-size: 0.88em; overflow-wrap: anywhere; }
  .rpt-keep { break-inside: avoid; }

  /* Status words: a small square + coloured text, no pills */
  .rpt-mark { font-weight: 600; white-space: nowrap; }
  .rpt-mark::before {
    content: "";
    display: inline-block;
    width: 5pt; height: 5pt;
    margin-right: 4pt;
    vertical-align: 0.5pt;
    background: currentColor;
  }
  .rpt-mark.rpt-good    { color: var(--r-good); }
  .rpt-mark.rpt-warn    { color: var(--r-warn); }
  .rpt-mark.rpt-bad     { color: var(--r-bad); }
  .rpt-mark.rpt-neutral { color: var(--r-muted); }
  .rpt-section h3 .rpt-mark { margin-left: auto; font-size: 8pt; }

  /* Findings */
  .rpt-finding { break-inside: avoid; padding-bottom: 4pt; }
  .rpt-finding + .rpt-finding { border-top: 0.5pt solid var(--r-line); }
  .rpt-finding p { font-size: 9pt; }

  /* Tables: ruled, no fills */
  .rpt-table { width: 100%; border-collapse: collapse; font-size: 8.3pt; margin: 4pt 0 8pt; }
  .rpt-table thead { display: table-header-group; }   /* repeat header on each page */
  .rpt-table th {
    text-align: left;
    font-weight: 600;
    font-size: 7.8pt;
    color: var(--r-ink);
    padding: 3pt 6pt 3pt 0;
    border-bottom: 1pt solid var(--r-rule);
  }
  .rpt-table td { padding: 4pt 6pt 4pt 0; border-bottom: 0.5pt solid var(--r-line); vertical-align: top; }
  .rpt-table tr { break-inside: avoid; }
  .rpt-overall td:first-child, .rpt-overall th:first-child { width: 34%; }
  .rpt-overall td:last-child, .rpt-overall th:last-child { width: 18%; }
  .rpt-findex td:first-child, .rpt-findex th:first-child { width: 8%; color: var(--r-muted); }
  .rpt-findex td:last-child, .rpt-findex th:last-child { width: 18%; }
  .rpt-groups td:nth-child(2), .rpt-protocols td:last-child, .rpt-criteria td:last-child { color: var(--r-muted); }
  .rpt-groups th:first-child { width: 30%; }
  .rpt-groups th:last-child { width: 18%; }
  .rpt-protocols th:nth-child(1) { width: 12%; }
  .rpt-protocols th:nth-child(2) { width: 12%; }
  .rpt-protocols th:nth-child(3) { width: 14%; }
  .rpt-criteria th:first-child { width: 16%; }

  .rpt-ciphers { table-layout: fixed; font-size: 7.4pt; }
  .rpt-ciphers th { font-size: 7.2pt; }
  .rpt-ciphers th:nth-child(1) { width: 4%; }
  .rpt-ciphers th:nth-child(2) { width: 36%; }
  .rpt-ciphers th:nth-child(3) { width: 13%; }
  .rpt-ciphers th:nth-child(4) { width: 14%; }
  .rpt-ciphers th:nth-child(5) { width: 5%; }
  .rpt-ciphers th:nth-child(6) { width: 11%; }
  .rpt-ciphers th:nth-child(7) { width: 17%; }
  .rpt-ciphers td:first-child { color: var(--r-muted); }
  .rpt-ciphers td:nth-child(2) .rpt-mono { font-size: 6.7pt; }
  .rpt-ciphers td:nth-child(3), .rpt-ciphers td:nth-child(4) { overflow-wrap: anywhere; }
  .rpt-ciphers td:last-child { color: var(--r-muted); font-size: 7pt; }
  .rpt-code { font-family: var(--font-mono); font-size: 6.5pt; color: var(--r-muted); }
}
