/*
 * AIReady's own styles. The look comes from the Zavanto design system: tokens in zavanto/css/tokens.css
 * and the zv- components in zavanto/css/components.css (both copied from Zavanto/Design, see design/zavanto/README.md).
 * This file only adds page layout, icons and what the mockup has that the components lack. The test's own
 * styles are in AIReady.Client/Test/ReadinessTest.razor.css. Token names only, never colour values.
 * No external fonts or CDNs: the CSP only allows files from this site.
 */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

h1, h2, h3 {
    margin: 0;
}

h1:focus, [tabindex="-1"]:focus {
    outline: none;
}

p {
    margin: 0;
}

a {
    color: var(--accent-ink);
}

    a:hover {
        text-decoration-thickness: 2px;
    }

a.zv-btn {
    text-decoration: none;
}

/* Page layout around the design system's header and footer (Shared/MainLayout.razor and Shared/TestLayout.razor). */

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    flex: 1 1 auto;
    width: 100%;
    padding: var(--space-7) 0 56px;
}

@media (max-width: 420px) {
    .site-main {
        padding-top: var(--space-6);
    }
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

code {
    font-family: var(--font-mono);
}

/* Icons (AIReady.Client/Shared/Icon.razor): 2px line, round ends, currentColor. */

.icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-sm {
    width: 16px;
    height: 16px;
}

.icon-bold {
    stroke-width: 2.4;
}

.zv-feature-icon .icon {
    width: 22px;
    height: 22px;
}

/* Error and 404 pages: one narrow column. */

.narrow {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--space-5);
}

.page-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.page-intro {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .page-intro h1 {
        font-size: 36px;
        line-height: 42px;
        font-weight: 700;
        letter-spacing: -0.01em;
    }

.lead {
    font-size: 18px;
    line-height: 28px;
    color: var(--ink-muted);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-4);
}

/* Home page: sections page-max wide, space-9 apart (the mockup's 56px top and 88px bottom). */

.home {
    display: flex;
    flex-direction: column;
    gap: var(--space-9);
    padding-top: calc(56px - var(--space-7));
    padding-bottom: calc(var(--space-9) - 56px);
}

.zv-hero, .zv-section {
    width: 100%;
}

/* Hero: the text on the left, an example result on the right (below on narrow screens). */
.ar-hero-text {
    flex: 1 1 420px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.ar-hero .zv-btn-primary .icon {
    width: 18px;
    height: 18px;
}

.ar-muted {
    color: var(--ink-muted);
    font-size: 15px;
}

.ar-example {
    flex: 1 1 360px;
    min-width: 0;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: var(--space-6);
    background: var(--surface-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.ar-eyebrow {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-muted);
}

.ar-score {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.ar-score-num {
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
}

.ar-score-of {
    font-size: 18px;
    color: var(--ink-muted);
}

.ar-example-rows {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .ar-example-rows li {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-3);
        font-size: 15px;
    }

.ar-example-foot {
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink-muted);
}

/* Status badges: the design system's status colours (never the category colours). Also used by the test. */
.ar-badge {
    flex: 0 0 auto;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

    .ar-badge.ar-level-Good {
        background: var(--success-soft);
        color: var(--success);
    }

    .ar-badge.ar-level-Review {
        background: var(--warning-soft);
        color: var(--warning);
    }

    .ar-badge.ar-level-Risk {
        background: var(--danger-soft);
        color: var(--danger);
    }

/* The test page: the question in a narrow column, the result page-wide (AIReady.Client/Test). */
.ar-test-page {
    padding-top: calc(56px - var(--space-7));
}

.ar-test-notice {
    max-width: var(--content-max);
    margin: var(--space-5) auto 0;
}

.ar-test-notice[hidden] {
    display: none;
}

.zv-notice .icon {
    width: 22px;
    height: 22px;
}

.zv-notice .zv-notice-body {
    font-size: 15px;
    line-height: 1.5;
}

.zv-cta .zv-btn-primary {
    flex: 0 0 auto;
}

@media (max-width: 600px) {
    .home {
        gap: var(--space-8);
        padding-top: 0;
    }

    .ar-hero .zv-hero-title {
        font-size: 36px;
    }

    .ar-test-page {
        padding-top: 0;
    }

    .page-intro h1 {
        font-size: 30px;
        line-height: 36px;
    }

    .zv-cta {
        padding: var(--space-6) var(--space-5);
    }
}

/* Home page: the guides under the questions (Pages/Index.razor). */
.home-guides {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

    .home-guides h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 700;
    }

    .home-guides ul {
        margin: 0;
        padding-left: 22px;
        display: flex;
        flex-direction: column;
        gap: var(--space-2);
        font-size: 16px;
        line-height: 1.5;
    }

    .home-guides a {
        font-weight: 600;
    }

/* Guides (Guides/GuideArticle.razor): one readable column with breadcrumbs, the text, the questions and the button. */
.guide-page {
    padding: var(--space-7) 0 var(--space-8);
}

.guide {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.guide-crumbs ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    font-size: 14px;
    color: var(--ink-muted);
}

    .guide-crumbs li + li::before {
        content: "\203A";
        margin-right: var(--space-2);
    }

.guide-title {
    margin: 0;
    font-size: 36px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
    overflow-wrap: break-word;
    hyphens: auto;
}

.guide-prose {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    font-size: 17px;
    line-height: 1.7;
}

    .guide-prose > * {
        margin: 0;
    }

    .guide-prose h2 {
        margin-top: var(--space-5);
        font-size: 24px;
        line-height: 1.25;
        font-weight: 700;
        letter-spacing: -0.01em;
    }

    .guide-prose ul,
    .guide-prose ol {
        padding-left: 22px;
        display: flex;
        flex-direction: column;
        gap: var(--space-2);
    }

.guide-faq {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

    .guide-faq h2 {
        margin: 0;
        font-size: 24px;
        line-height: 1.25;
        font-weight: 700;
    }

.guide-end {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    padding-top: var(--space-5);
    border-top: 1px solid var(--line);
}

.guide-button {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
}

    .guide-button p {
        margin: 0;
        font-size: 14px;
        color: var(--ink-muted);
    }

.guide-more {
    margin: 0;
    padding-left: 22px;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    font-size: 16px;
    font-weight: 600;
}

.guide-prose .guide-disclaimer {
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink-muted);
}

@media (max-width: 600px) {
    .guide-page {
        padding-top: var(--space-5);
    }

    .guide-title {
        font-size: 30px;
    }

    .guide-prose {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .zv-faq summary svg {
        transition: none;
    }
}

/* Blazor */

#blazor-error-ui {
    background: var(--warning-soft);
    color: var(--ink);
    border-top: 1px solid var(--warning-line);
    bottom: 0;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }
