/* ============================================================
   OnlyDMARC – DMARC Configuration Report (public SSR)
   Screen + print styles. Progressive-enhancement only: the page
   is fully legible with this stylesheet and no JavaScript.
   ============================================================ */

/* ── Request form: optimistic progress ──────────────────────── */

.crr-progress {
    display: none;
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
}

/* Shown by JS on submit (the form adds .is-active). The no-JS path uses the
   page's <noscript> text note instead — a permanent spinner on a static form
   would be misleading, so there is no CSS-only spinner. */
.crr-progress.is-active {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.crr-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--brand-cyan);
    border-radius: 50%;
    flex-shrink: 0;
    animation: crr-spin 0.7s linear infinite;
}

@keyframes crr-spin {
    to { transform: rotate(360deg); }
}

.crr-phase {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Honeypot: kept out of the layout AND off the accessibility tree. */
.crr-hp {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.crr-field-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.35rem;
}

/* Reduced motion: drop the spin + any stepping, keep static text. */
@media (prefers-reduced-motion: reduce) {
    .crr-spinner { animation: none; }
}

/* ── Hosted report document ─────────────────────────────────── */

.crr-doc {
    max-width: 860px;
    margin: 0 auto;
}

.crr-section {
    margin-bottom: 2.5rem;
}

.crr-section-label {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* Section 1 — cover verdict banner (BR-13: text + label, never colour only) */
.crr-verdict {
    border: 1px solid var(--border);
    border-left-width: 5px;
    border-radius: var(--radius-lg);
    padding: 1.75rem 2rem;
}

.crr-verdict--healthy   { border-left-color: var(--success); }
.crr-verdict--needswork { border-left-color: var(--warning); }
.crr-verdict--atrisk    { border-left-color: var(--danger); }

.crr-verdict-level {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.4rem;
    font-weight: 800;
}

.crr-verdict-icon { font-size: 1.4rem; }
.crr-verdict--healthy   .crr-verdict-icon { color: var(--success); }
.crr-verdict--needswork .crr-verdict-icon { color: var(--warning); }
.crr-verdict--atrisk    .crr-verdict-icon { color: var(--danger); }

.crr-refcode {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Section 2 — record cards */
.crr-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    background: var(--bg-card);
}

.crr-card-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.crr-raw {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.7rem 0.95rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.82rem;
    word-break: break-all;
    color: var(--brand-cyan);
    overflow-x: auto;
}

/* Section 3 — glossary */
.crr-gloss-back {
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

/* Section 4 — readiness panel (full-bleed, de-emphasised in print, never hidden) */
.crr-readiness {
    border-radius: var(--radius-lg);
    padding: 2rem;
    background: var(--bg-card-2);
    border: 1px solid var(--border);
}

.crr-readiness-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0 1.5rem;
}

.crr-readiness-table th,
.crr-readiness-table td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    font-size: 0.9rem;
}

/* Section 6 — recommended record block */
.crr-reco {
    border: 1px dashed var(--brand-cyan);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    background: rgba(6, 182, 212, 0.05);
}

.crr-reco-omitted {
    border-style: solid;
    border-color: var(--border);
    background: var(--bg-card);
}

/* Copy buttons — interactive only, never printed */
.crr-copy {
    cursor: pointer;
}

.crr-copy[hidden] { display: none; }

/* ── Print ──────────────────────────────────────────────────── */

@media print {
    @page { size: A4; margin: 18mm 16mm; }

    .no-print { display: none !important; }

    body { background: #fff !important; color: #111 !important; }

    .crr-doc { max-width: none; }

    .crr-section { page-break-inside: avoid; }

    .crr-raw {
        color: #111 !important;
        background: #f5f5f5 !important;
        border-color: #ccc !important;
    }

    /* Section 4 de-emphasises but stays legible (UF-006: never display:none) */
    .crr-readiness {
        background: #fff !important;
        border-color: #ccc !important;
        opacity: 0.92;
    }

    /* Repeating table headers across page breaks */
    .crr-readiness-table thead { display: table-header-group; }

    .crr-verdict {
        border: 1px solid #333 !important;
        border-left-width: 5px !important;
    }
}
