/* ============================================================================
   WEBCHKR - Website Marketing Foundation Checker
   ============================================================================ */

:root {
    /* Brand Colors - Bold Red & Black (WCAG AA Compliant)
       --primary-red: 4.83:1 contrast on white (passes AA)
       --primary-red-dark: 6.47:1 contrast on white (passes AA) */
    --primary-red: #DC2626;
    --primary-red-dark: #B91C1C;
    --primary-black: #1A1A1A;
    --primary-white: #FFFFFF;
    
    /* Link color for use on colored backgrounds (5.30:1+ on all status bg) */
    --link-on-color: #B91C1C;
    
    /* Grays */
    --gray-50: #F8F9FA;
    --gray-100: #F1F3F5;
    --gray-200: #E9ECEF;
    --gray-300: #DEE2E6;
    --gray-400: #CED4DA;
    --gray-500: #ADB5BD;
    --gray-600: #6C757D;
    --gray-700: #495057;
    --gray-800: #343A40;
    --gray-900: #212529;
    
    /* Status Colors - text colors have 6.37:1+ contrast on their backgrounds */
    --success: #10B981;
    --success-bg: #D1FAE5;
    --success-text: #065F46;
    --warning: #F59E0B;
    --warning-bg: #FEF3C7;
    --warning-text: #92400E;
    --error: #EF4444;
    --error-bg: #FEE2E2;
    --error-text: #991B1B;
    --info: #3B82F6;
    --info-bg: #DBEAFE;
    --info-text: #1E40AF;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Typography */
    --font-main: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Self-hosted variable font — eliminates 3 external round-trips to Google Fonts.
   Single woff2 file covers weights 400-700 (22KB). */
@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/fonts/SpaceGrotesk-Variable.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Skip link — visually hidden until focused */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 1000;
    padding: 12px 24px;
    background: var(--primary-black);
    color: var(--primary-white);
    border-radius: 0 0 8px 8px;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================================================
   HERO / HEADER
   ============================================================================ */

.hero {
    text-align: center;
    padding: 64px 0 48px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.brand-name {
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--primary-black);
    margin: 0;
    font-family: 'Space Grotesk', sans-serif;
}

.logo svg {
    animation: checkBounce 8s ease-in-out infinite;
}

@keyframes checkBounce {
    /* Red phase - gentle float */
    0% { transform: translateY(0); }
    4% { transform: translateY(-8px); }
    8% { transform: translateY(0); }
    
    /* Start float before switching to orange */
    30% { transform: translateY(0); }
    34% { transform: translateY(-8px); }
    /* Color changes here at 35% while elevated */
    38% { transform: translateY(0); }
    
    /* Start float before switching to green */
    63% { transform: translateY(0); }
    67% { transform: translateY(-8px); }
    /* Color changes here at 68% while elevated */
    71% { transform: translateY(0); }
    
    100% { transform: translateY(0); }
}

/* Color animation - changes happen mid-float */
.logo svg rect {
    animation: colorProgress 8s step-end infinite;
}

@keyframes colorProgress {
    0% {
        fill: #DC2626; /* Red - WCAG AA compliant */
    }
    35% {
        fill: #F59E0B; /* Orange - switches while logo is up */
    }
    68% {
        fill: #10B981; /* Green - switches while logo is up */
    }
    100% {
        fill: #DC2626; /* Back to red */
    }
}

.tagline {
    font-size: 24px;
    color: var(--gray-700);
    margin-bottom: 32px;
    margin-top: 0;
    font-weight: 400;
    font-family: 'Space Grotesk', sans-serif;
}

.tagline strong {
    color: var(--primary-red);
    font-weight: 600;
}

.features-grid {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 24px;
}

.feature-pill {
    background: var(--primary-white);
    border: 2px solid var(--gray-200);
    border-radius: 24px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    box-shadow: var(--shadow-sm);
}

/* ============================================================================
   INPUT SECTION
   ============================================================================ */

.input-section {
    background: var(--primary-white);
    border-radius: 16px;
    padding: 48px;
    margin: 48px 0;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}

.input-group {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.input-wrapper {
    position: relative;
    flex: 1;
}

#domainInput {
    width: 100%;
    padding: 18px 20px;
    font-size: 18px;
    font-family: var(--font-main);
    border: 1px solid var(--gray-300);
    border-radius: 12px;
    background: var(--gray-50);
    transition: all 0.2s ease;
    font-weight: 500;
}

#domainInput:focus {
    outline: none;
    border-color: var(--primary-red);
    background: var(--primary-white);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.15);
}

#domainInput::placeholder {
    color: var(--gray-600);
}

.check-button {
    padding: 18px 40px;
    font-size: 18px;
    font-weight: 600;
    font-family: var(--font-main);
    background: var(--primary-red);
    color: var(--primary-white);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
}

.check-button:hover {
    background: var(--primary-red-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.check-button:active {
    transform: translateY(0);
}

.check-button:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    transform: none;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.input-hint {
    text-align: center;
    font-size: 14px;
    color: var(--gray-600);
    margin-top: 16px;
    line-height: 1.4;
}

@media (max-width: 480px) {
    .input-hint {
        font-size: 13px;
    }
}

/* ============================================================================
   RESULTS SECTION
   ============================================================================ */

.results-section {
    margin: 48px 0;
}

.results-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 32px;
    padding: 24px 32px;
    background: var(--primary-white);
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
    gap: 0;
    text-align: center;
}

.results-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-black);
    word-break: break-word;
}

@media (max-width: 600px) {
    .results-header {
        padding: 20px;
    }
    
    .results-header h2 {
        font-size: 22px;
        width: 100%;
    }
}

.domain-highlight {
    color: var(--primary-red);
}

/* Results summary — integrated into results header */

.summary-counts {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 10px 0 14px;
    font-size: 1.05rem;
    font-weight: 500;
}

.summary-count {
    white-space: nowrap;
}

.summary-number {
    font-weight: 700;
    font-size: 1.3rem;
}

.summary-separator {
    color: var(--gray-500);
    margin: 0 6px;
}

.summary-count { color: var(--gray-600); }
.summary-pass .summary-number { color: var(--success); }
.summary-fail .summary-number { color: var(--error); }
.summary-warning .summary-number { color: var(--warning); }
.summary-info .summary-number { color: var(--info); }

.summary-loading-note {
    text-align: center;
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-top: 2px;
}

.summary-loading-note.is-loading {
    animation: loadingPulse 1.2s ease-in-out infinite;
    font-weight: 500;
}

.summary-loading-note.is-loading::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid var(--gray-300);
    border-top-color: var(--gray-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

@keyframes loadingPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.summary-progress {
    height: 6px;
    border-radius: 3px;
    background: var(--gray-100);
    overflow: hidden;
    display: flex;
    margin-top: 8px;
}

.summary-progress-segment {
    height: 100%;
    transition: width 0.3s ease;
}

/* In-progress fill — neutral gray with shimmer overlay so the bar reads as
   "actively working" without using any result-status color. Replaced by the
   colored segmented breakdown when all checks complete. */
.summary-progress-loading {
    background: var(--gray-400);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.45) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    background-repeat: no-repeat;
    animation: summaryShimmer 1.4s linear infinite;
}

@keyframes summaryShimmer {
    0%   { background-position: -100% 0; }
    100% { background-position: 200% 0; }
}

@media (max-width: 480px) {
    .summary-counts { flex-wrap: wrap; justify-content: center; gap: 4px; }
    .summary-number { font-size: 1.15rem; }
    .summary-separator { margin: 0 3px; }
}

/* Category summary cards */
.category-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

@media (max-width: 768px) {
    .category-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .category-cards { grid-template-columns: 1fr; }
}

.category-card {
    background: var(--primary-white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    display: block;
    color: inherit;
}

.category-card:focus-visible {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
}

.category-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 8px;
}

.card-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--gray-600);
}

.card-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
}

.card-score {
    font-size: 14px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--gray-100);
    color: var(--gray-600);
    white-space: nowrap;
    flex-shrink: 0;
}

.card-score.score-pass { background: var(--success-bg); color: var(--success-text); }
.card-score.score-warning { background: var(--warning-bg); color: var(--warning-text); }
.card-score.score-fail { background: var(--error-bg); color: var(--error-text); }
.card-score.score-info { background: var(--info-bg); color: var(--info-text); }
.card-score.score-skipped { background: var(--gray-200); color: var(--gray-600); }

.card-findings {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.5;
}

.card-finding {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 2px 0;
}

.card-finding-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

.card-more {
    font-size: 12px;
    color: var(--gray-600);
    padding-top: 4px;
}

.a11y-disclaimer {
    padding: 16px 20px;
    margin-bottom: 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--gray-600);
}

.a11y-disclaimer p {
    margin: 0;
}

.card-disclaimer {
    font-size: 11px;
    color: var(--gray-500);
    font-style: italic;
    padding-top: 4px;
}

.card-progress {
    height: 4px;
    background: var(--gray-100);
    border-radius: 2px;
    margin: 10px 0;
    overflow: hidden;
    display: flex;
}

.card-progress-fill {
    height: 100%;
    transition: width 0.3s ease;
}

/* Status Banner */
#statusBanner {
    margin-bottom: 32px;
    padding: 20px 24px;
    border-radius: 12px;
    border: 1px solid;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-md);
    word-break: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 600px) {
    #statusBanner {
        padding: 16px;
        font-size: 14px;
        flex-direction: column;
        align-items: flex-start;
    }
}

#statusBanner.success {
    background: var(--success-bg);
    border-color: var(--success);
    color: #065F46;
}

#statusBanner.warning {
    background: var(--warning-bg);
    border-color: var(--warning);
    color: #92400E;
}

#statusBanner.error {
    background: var(--error-bg);
    border-color: var(--error);
    color: #991B1B;
}

/* Protocol warning banner (HTTP-only sites) */
.protocol-warning {
    margin-bottom: 32px;
    padding: 20px 24px;
    border-radius: 12px;
    border: 1px solid var(--warning);
    background: var(--warning-bg);
    color: #92400E;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.6;
    box-shadow: var(--shadow-md);
}

.protocol-warning p {
    margin: 0;
}

/* Inline form validation error */
.input-error {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.error-hint {
    color: var(--error-text) !important;
    font-weight: 500;
}

/* ============================================================================
   RESULT CATEGORIES
   ============================================================================ */

.result-category {
    margin-bottom: 32px;
}

.category-title {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--gray-800);
    color: var(--primary-white);
    font-size: 18px;
    font-weight: 700;
    flex-wrap: wrap;
    border-radius: 12px;
    margin-bottom: 12px;
}

@media (max-width: 600px) {
    .category-title {
        font-size: 18px;
        padding: 14px 16px;
    }
}


/* ============================================================================
   RESULT ITEMS
   ============================================================================ */

.result-item {
    background: var(--primary-white);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
}


@media (max-width: 600px) {
    .result-item {
        padding: 16px;
    }

    .result-content {
        padding-left: 16px;
    }
}

.result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.result-icon {
    min-width: 28px;
    text-align: center;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.status-icon-svg {
    width: 20px;
    height: 20px;
    color: var(--gray-400);
}
.status-icon-svg.status-pass { color: var(--success); }
.status-icon-svg.status-warning { color: var(--warning); }
.status-icon-svg.status-fail { color: var(--error); }
.status-icon-svg.status-info { color: var(--info); }

.result-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-black);
}

@media (max-width: 600px) {
    .result-title {
        font-size: 16px;
    }
}

.result-content {
    padding-left: 40px;
}

.result-description {
    color: var(--gray-900);
    margin-bottom: 8px;
    line-height: 1.6;
    font-weight: 400;
}

/* Ensure good contrast in all states */
.result-item .result-title {
    color: var(--primary-black);
}

/* Result States - subtle tint + inset gradient accent bar */
.result-item.pass,
.result-item.warning,
.result-item.fail,
.result-item.info {
    position: relative;
    overflow: hidden;
}

.result-item.pass::before,
.result-item.warning::before,
.result-item.fail::before,
.result-item.info::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    border-radius: 10px 0 0 10px;
}

.result-item.pass {
    background: #F0FDF4;
}
.result-item.pass::before {
    background: linear-gradient(180deg, #34D399, #059669);
}
.result-item.pass .result-description {
    color: #065F46;
}

.result-item.warning {
    background: #FFFBEB;
}
.result-item.warning::before {
    background: linear-gradient(180deg, #FBBF24, #D97706);
}
.result-item.warning .result-description {
    color: #92400E;
}

.result-item.fail {
    background: #FEF2F2;
}
.result-item.fail::before {
    background: linear-gradient(180deg, #F87171, #DC2626);
}
.result-item.fail .result-description {
    color: #991B1B;
}

.result-item.info {
    background: #EFF6FF;
}
.result-item.info::before {
    background: linear-gradient(180deg, #60A5FA, #2563EB);
}
.result-item.info .result-description {
    color: #1E40AF;
}

/* Enhanced Content */
.result-services,
.result-verify {
    margin-top: 12px;
    padding: 14px 16px;
    background: var(--primary-white);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-700);
}

.result-services-title,
.result-verify-title,
.result-why-title {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.result-why-title {
    font-style: italic;
}

.result-services-list,
.result-verify ul {
    list-style: none;
    padding: 0;
}

.result-services-list > li,
.result-verify-list > li {
    padding: 6px 0;
    color: var(--gray-900);
    line-height: 1.5;
}

/* Inline SVG icons used in list items and status indicators */
.inline-icon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
    position: relative;
    top: -1px;
}

.result-verify-list > li:before {
    content: "→ ";
    color: var(--gray-600);
    font-weight: bold;
    margin-right: 8px;
}

.result-why {
    margin-top: 12px;
    padding: 4px 0;
    background: none;
    border-radius: 0;
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.6;
}

/* Inline code - subtle dark pill */
code, pre {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-size: 13px;
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--gray-800);
}

pre {
    padding: 12px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
}

/* Record/data display blocks */
.result-record {
    margin-top: 12px;
    margin-bottom: 12px;
    padding: 14px 16px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    font-size: 14px;
    color: var(--gray-800);
    overflow-x: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.6;
}

@media (max-width: 600px) {
    .result-record {
        font-size: 12px;
        padding: 10px 12px;
    }
}

.result-record strong {
    color: var(--primary-black);
    font-weight: 600;
}

/* Lists inside result-record boxes */
.result-record ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.result-record li {
    padding: 2px 0;
}

.result-record > ul:not([class]) > li::before,
.result-record > ol > li::before {
    content: '• ';
    color: var(--gray-500);
}

/* Accessibility check list - no bullets, icons already present */
.accessibility-check-list {
    list-style: none !important;
    padding-left: 0 !important;
    margin: 0 !important;
}

.accessibility-check-list > li {
    padding: 4px 0;
}

.accessibility-check-list > li::before {
    content: none !important;
}

/* Nested lists in verify sections */
.result-verify-list .nested-list {
    list-style: none;
    padding-left: 2.5em;
    margin: 8px 0 4px 0;
}

.result-verify-list .nested-list li {
    padding: 2px 0;
    font-size: 0.95em;
}

.result-verify-list .nested-list li::before {
    content: '• ';
    color: var(--gray-500);
    margin-right: 0.5em;
    font-weight: normal;
}

/* Sub-detail list inside a check indicator (e.g., image alt details) */
.check-sub-details {
    list-style: none;
    padding-left: 2em;
    margin: 4px 0 0 0;
}

.check-sub-details li {
    padding: 2px 0;
    color: var(--gray-700);
    font-size: 0.9em;
}

.answerability-detail {
    margin-top: 8px;
}

.answerability-detail summary {
    cursor: pointer;
    color: var(--gray-600);
    font-size: 0.9em;
}

.answerability-detail summary:hover {
    color: var(--gray-800);
}

.answerability-detail ul {
    margin: 8px 0 0;
    padding-left: 20px;
    list-style: disc;
    font-size: 0.9em;
    color: var(--gray-700);
}

.answerability-detail li {
    padding: 2px 0;
}

.llms-preview {
    margin: 8px 0 0;
    padding: 12px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow-y: auto;
}

.check-sub-details li::before {
    content: '↳ ';
    color: var(--gray-600);
}

/* Links in result-record */
.result-record a {
    color: var(--primary-red);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease;
}

.result-record a:hover {
    border-bottom-color: var(--primary-red);
}

.result-record a::after {
    content: ' ↗';
    font-size: 0.85em;
    opacity: 0.7;
}

/* Links in results - use darker red for AA compliance on colored backgrounds */
.result-content a {
    color: var(--link-on-color);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid var(--link-on-color);
}

.result-content a:hover {
    border-bottom: 2px solid var(--link-on-color);
}

/* ============================================================================
   ACTION BUTTONS
   ============================================================================ */

/* Full Report section header — centered title with print button on the side */
.full-report-header {
    position: relative;
    margin-top: 64px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.full-report-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.01em;
}

.full-report-header .secondary-button-sm {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 768px) {
    .full-report-header {
        flex-direction: column;
        gap: 14px;
        margin-top: 48px;
    }
    .full-report-header .secondary-button-sm {
        position: static;
        transform: none;
    }
}


.action-buttons {
    display: flex;
    gap: 16px;
    margin-top: 48px;
    justify-content: center;
}

.primary-button,
.secondary-button {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-main);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--gray-200);
}

.primary-button {
    background: var(--primary-red);
    color: var(--primary-white);
    border: none;
}

.primary-button:hover {
    background: var(--primary-red-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.secondary-button {
    background: var(--primary-white);
    color: var(--primary-black);
}

.secondary-button:hover {
    background: var(--gray-100);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.primary-button:focus-visible,
.secondary-button:focus-visible {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
}

button.secondary-button.secondary-button-sm {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 6px;
    gap: 4px;
}

/* ============================================================================
   FOOTER
   ============================================================================ */

footer {
    margin-top: 96px;
    padding: 48px 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo svg {
    flex-shrink: 0;
}

.footer-logo span {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-black);
}

.footer-disclaimer {
    font-size: 14px;
    color: var(--gray-700);
    line-height: 1.5;
    margin: 0;
}

.footer-links {
    font-size: 14px;
    color: var(--gray-700);
    margin: 0;
}

.footer-links a {
    color: var(--gray-700);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary-red);
}


/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    .hero {
        padding: 40px 0 24px;
    }

    .brand-name {
        font-size: 42px;
    }

    .tagline {
        font-size: 18px;
    }

    .input-section {
        padding: 32px 24px;
        margin: 24px 0;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    #domainInput {
        font-size: 16px;
    }
    
    .check-button {
        width: 100%;
        justify-content: center;
        font-size: 16px;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .primary-button,
    .secondary-button {
        width: 100%;
        justify-content: center;
    }
    
    
    /* Better mobile content wrapping */
    .result-content {
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    /* Mobile-friendly services/verify titles */
    .result-services-title,
    .result-verify-title {
        font-size: 15px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .hero {
        padding: 32px 0 16px;
    }

    .brand-name {
        font-size: 36px;
    }

    .tagline {
        font-size: 16px;
    }

    .feature-pill {
        font-size: 12px;
        padding: 6px 16px;
    }

    .input-section {
        padding: 24px 16px;
        margin: 16px 0;
    }

    #domainInput {
        padding: 14px;
    }

    .result-content {
        padding-left: 8px;
    }

    .card-findings {
        font-size: 12px;
    }
}

/* ============================================================================
   REDUCED MOTION
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
    /* Reset for clean print output */
    * {
        box-shadow: none !important;
        text-shadow: none !important;
    }

    body {
        background: white;
        color: black;
        font-size: 11pt;
        line-height: 1.4;
    }

    /* Hide non-essential elements */
    .hero,
    .input-section,
    .action-buttons,
    .full-report-header .secondary-button-sm,
    .content-sections,
    footer,
    .skip-link,
    #statusBanner,
    .summary-progress,
    .summary-loading-note,
    .card-progress,
    .card-loading-text {
        display: none !important;
    }

    /* Results container — remove decorative styling */
    .results-section {
        padding: 0;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    /* Results header — clean print header */
    .results-header {
        border: none;
        border-bottom: 2px solid #333;
        border-radius: 0;
        padding: 0 0 12px 0;
        margin-bottom: 16px;
        text-align: left;
    }

    .results-header h2 {
        font-size: 18pt;
        margin-bottom: 4px;
    }

    .domain-highlight {
        color: #333 !important;
    }

    .summary-counts {
        justify-content: flex-start;
        font-size: 10pt;
        margin: 4px 0 0;
    }

    /* Add report date via CSS generated content */
    .results-header::after {
        content: "Generated by WEBCHKR (webchkr.com)";
        display: block;
        font-size: 9pt;
        color: #666;
        margin-top: 8px;
    }

    /* Category cards — compact grid for print */
    .category-cards {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px;
        margin-bottom: 20px;
    }

    .category-card {
        border: 1px solid #ccc;
        border-radius: 4px;
        padding: 8px 10px;
        box-shadow: none;
    }

    .card-score {
        font-size: 12px;
        padding: 2px 6px;
    }

    .card-findings {
        font-size: 9pt;
    }

    .card-disclaimer {
        font-size: 8pt;
    }

    /* Category sections — page breaks */
    .result-category {
        break-before: auto;
        margin-top: 16px;
    }

    .category-title {
        background: #f0f0f0 !important;
        color: #333 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        border-radius: 4px;
        font-size: 13pt;
        padding: 8px 12px;
        margin-bottom: 8px;
    }

    /* Result items — compact, avoid page breaks within */
    .result-item {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #ddd;
        border-radius: 4px;
        padding: 12px 14px;
        margin-bottom: 6px;
        border-left-width: 3px;
    }

    .result-item.pass { border-left-color: #10B981; }
    .result-item.fail { border-left-color: #EF4444; }
    .result-item.warning { border-left-color: #F59E0B; }
    .result-item.info { border-left-color: #3B82F6; }

    .result-header {
        margin-bottom: 6px;
    }

    .result-title {
        font-size: 11pt;
    }

    .result-description {
        font-size: 10pt;
    }

    .result-content {
        font-size: 10pt;
    }

    /* Record blocks — clean for print */
    .result-record {
        background: #f8f8f8 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        border: 1px solid #e0e0e0;
        font-size: 9pt;
        padding: 8px 10px;
    }

    .result-record code {
        background: transparent;
        border: none;
        font-size: 9pt;
    }

    /* Verify/services blocks */
    .result-services,
    .result-verify {
        padding: 8px 10px;
        font-size: 10pt;
    }

    /* Why it matters — smaller for print */
    .result-why-title {
        font-size: 10pt;
    }

    .result-why-content {
        font-size: 9pt;
        color: #555;
    }

    /* Links — show URLs in print */
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 8pt;
        color: #666;
        word-break: break-all;
    }

    /* Don't expand URLs for internal links or very long ones */
    a[href^="/"]::after,
    .result-record a::after,
    .card-finding a::after {
        content: none;
    }

    /* Status icons — ensure colors print */
    .status-icon-svg {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .inline-icon {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ============================================================================
   LOADING STATE
   ============================================================================ */

/* Loading card: shimmer content area + pulsing border + spinning icon */
.result-item:not(.pass):not(.fail):not(.warning):not(.info) {
    border-left-color: var(--gray-300);
    animation: borderPulse 1.5s ease-in-out infinite;
}

.result-item:not(.pass):not(.fail):not(.warning):not(.info) .result-content {
    background: linear-gradient(90deg, var(--gray-50) 25%, var(--gray-100) 50%, var(--gray-50) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
    min-height: 24px;
}

.result-item:not(.pass):not(.fail):not(.warning):not(.info) .result-icon {
    display: inline-block;
    animation: spin 1.2s linear infinite;
}

@keyframes borderPulse {
    0%, 100% { border-left-color: var(--gray-300); }
    50% { border-left-color: var(--gray-400); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Make "Checking..." text more prominent */
.result-item:not(.pass):not(.fail):not(.warning):not(.info) .result-description {
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-600);
}

/* Loading state for category card scores — neutral (gray) instead of any
   status color, since green/red/yellow/blue all carry result semantics. The
   spinner + medium contrast + subtle pulse makes "still running" unmissable
   without colliding with the result palette. */
.card-score.score-loading {
    background: var(--gray-200);
    color: var(--gray-700);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    animation: cardPulse 1.5s ease-in-out infinite;
}

.card-score.score-loading::before {
    content: '';
    display: inline-block;
    width: 9px;
    height: 9px;
    border: 1.5px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: cardSpinner 0.8s linear infinite;
}

.card-loading-text {
    color: var(--gray-700);
    font-size: 13px;
    font-weight: 500;
    animation: cardPulse 1.5s ease-in-out infinite;
}

@keyframes cardSpinner {
    to { transform: rotate(360deg); }
}

.card-progress-fill.loading {
    width: 100% !important;
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-300) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes cardPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================================
   ERROR MESSAGE
   ============================================================================ */

.error-message {
    background: var(--error-bg);
    border: 3px solid var(--error);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
}

.error-message h2 {
    color: var(--error);
    margin-bottom: 16px;
}

.error-message p {
    color: #991B1B;
    margin-bottom: 24px;
}

/* ============================================================================
   BELOW-FOLD CONTENT SECTIONS
   ============================================================================ */

.content-sections {
    background: var(--gray-50, #F9FAFB);
    padding: 80px 0;
    border-top: 1px solid var(--border, #E5E7EB);
}

.content-section {
    margin-bottom: 64px;
}

.content-section:last-child {
    margin-bottom: 0;
}

.content-section h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text, #111827);
    margin-bottom: 20px;
    text-align: center;
}

.content-section h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text, #111827);
    margin-top: 28px;
    margin-bottom: 10px;
}

.content-section p {
    color: var(--text-secondary, #4B5563);
    line-height: 1.75;
    margin-bottom: 16px;
    font-size: 1rem;
}

/* Steps grid (How it works) */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 24px;
}

.step-card {
    background: #FFFFFF;
    border: 1px solid var(--border, #E5E7EB);
    border-radius: 12px;
    padding: 28px 24px;
    text-align: center;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary-red, #DC2626);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 18px;
    margin: 0 auto 16px;
}

.step-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text, #111827);
    margin: 0 0 10px 0;
}

.step-card p {
    color: var(--text-secondary, #4B5563);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
    text-wrap: pretty;
}

/* FAQ section */
.faq-section h2 {
    margin-bottom: 24px;
}

.faq-item {
    border: 1px solid var(--border, #E5E7EB);
    border-radius: 10px;
    margin-bottom: 12px;
    background: #FFFFFF;
    overflow: hidden;
}

.faq-item summary {
    padding: 18px 24px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text, #111827);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.faq-item summary h3 {
    margin: 0;
    font: inherit;
    color: inherit;
    flex: 1;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--gray-600);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 16px;
}

.faq-item summary:focus-visible {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item p,
.faq-item > div {
    padding: 0 24px 18px;
    color: var(--text-secondary, #4B5563);
    line-height: 1.7;
    font-size: 0.95rem;
    margin: 0;
}

.faq-item ul {
    margin: 8px 0 0;
    padding-left: 20px;
    list-style: disc;
}

.faq-item li {
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    .content-sections {
        padding: 48px 0;
    }

    .content-section {
        margin-bottom: 48px;
    }

    .content-section h2 {
        font-size: 1.5rem;
    }

    .steps-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .step-card {
        text-align: center;
        padding: 20px;
    }

    .step-number {
        margin: 0 auto 12px;
    }

    .faq-item summary {
        padding: 16px 18px;
        font-size: 0.95rem;
    }

    .faq-item p {
        padding: 0 18px 16px;
    }
}

/* ============================================================================
   LEGAL PAGES (Privacy Policy, Terms of Service)
   ============================================================================ */

.legal-page {
    max-width: 740px;
    padding-top: 40px;
    padding-bottom: 60px;
}

.legal-header {
    margin-bottom: 40px;
}

.legal-header .logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 20px;
}

.legal-header .logo-link:hover {
    opacity: 0.8;
}

.legal-content h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.legal-updated {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 32px;
}

.legal-content h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 32px;
    margin-bottom: 12px;
}

.legal-content h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-top: 20px;
    margin-bottom: 8px;
}

.legal-content p {
    color: var(--text-secondary, #4B5563);
    line-height: 1.7;
    margin-bottom: 16px;
}

.legal-content ul {
    color: var(--text-secondary, #4B5563);
    line-height: 1.7;
    margin-bottom: 16px;
    padding-left: 24px;
}

.legal-content li {
    margin-bottom: 6px;
}

.legal-content a {
    color: var(--primary, #DC2626);
    text-decoration: underline;
}

.legal-content a:hover {
    opacity: 0.8;
}

.legal-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border, #E5E7EB);
}

.legal-footer p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.legal-footer a {
    color: var(--text-light);
    text-decoration: none;
}

.legal-footer a:hover {
    color: var(--primary, #DC2626);
}

@media (max-width: 600px) {
    .legal-page {
        padding-top: 24px;
    }
    
    .legal-content h1 {
        font-size: 1.6rem;
    }
    
    .legal-content h2 {
        font-size: 1.15rem;
    }
}
