/* The test and its result (mockup: AIReady – startsida, test och resultat). Token names only. The badges and the
   score are shared with the home page and live in AIReady/wwwroot/css/site.css. */

.ar-question {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--space-5);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.ar-result {
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 0 var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

h1, h2, h3, p {
    margin: 0;
}

h1:focus {
    outline: none;
}

/* The bars of the result's areas. The test's progress is in the focus header (Shared/FocusHeader.razor,
   zv-header-focus in Zavanto/Design). */

.ar-bar {
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--line);
    overflow: hidden;
}

.ar-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--accent);
    transition: width 0.2s ease;
}

    .ar-bar-fill.ar-level-Good {
        background: var(--success);
    }

    .ar-bar-fill.ar-level-Review {
        background: var(--warning);
    }

    .ar-bar-fill.ar-level-Risk {
        background: var(--danger);
    }

/* Cards */

.ar-card {
    background: var(--surface-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.ar-card-raised {
    gap: var(--space-5);
    box-shadow: var(--shadow-md);
}

.ar-card-title {
    font-size: 21px;
    line-height: 28px;
    font-weight: 700;
}

.ar-h2 {
    font-size: 26px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.01em;
}

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

.ar-section-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 680px;
}

    .ar-section-text p {
        font-size: 15px;
        line-height: 1.6;
        color: var(--ink-muted);
    }

.ar-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: var(--space-5);
    align-items: start;
}

/* Question */

.ar-q-text {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

    .ar-q-text h1 {
        font-size: 26px;
        line-height: 1.25;
        font-weight: 700;
        letter-spacing: -0.01em;
    }

    .ar-q-text p {
        font-size: 15px;
        line-height: 1.6;
        color: var(--ink-muted);
    }

    /* The question's area above it: the focus header shows it too, but hides it on a phone. */
    .ar-q-text .ar-q-area {
        font-size: 13px;
        line-height: 18px;
    }

.ar-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ar-option {
    position: relative;
    font: inherit;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 56px;
    margin: 1px;
    padding: 12px 18px;
    border: 1px solid var(--line-control);
    border-radius: 10px;
    background: var(--surface-field);
    color: var(--ink);
    text-align: left;
    font-size: 16px;
    line-height: 1.4;
    cursor: pointer;
}

    .ar-option:hover:not(:has(input:disabled)) {
        border-color: var(--accent);
    }

    /* The radio button itself is hidden; the whole row is its label and shows the focus and the choice. */
    .ar-option-input {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: 0;
        opacity: 0;
    }

    .ar-option:has(.ar-option-input:focus-visible) {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
    }

    .ar-option:has(.ar-option-input:checked) {
        margin: 0;
        border: 2px solid var(--accent);
        background: var(--accent-soft);
        font-weight: 600;
    }

    .ar-option:has(input:disabled) {
        cursor: default;
    }

.ar-option-dot {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    box-sizing: border-box;
    border-radius: 50%;
    border: 2px solid var(--line-control);
}

.ar-option:has(.ar-option-input:checked) .ar-option-dot {
    border: 6px solid var(--accent);
    background: var(--surface-field);
}

.ar-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding-top: var(--space-1);
}

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

.zv-btn:disabled {
    background: var(--line);
    border-color: var(--line);
    color: var(--ink-muted);
    cursor: not-allowed;
}

.ar-note {
    display: flex;
    gap: var(--space-2);
    align-items: flex-start;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink-muted);
}

    .ar-note .icon {
        width: 18px;
        height: 18px;
        margin-top: 1px;
    }

/* Result */

.ar-result-head {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: var(--content-max);
}

    .ar-result-head h1 {
        font-size: 36px;
        line-height: 1.15;
        font-weight: 800;
        letter-spacing: -0.02em;
    }

    .ar-result-head p {
        font-size: 18px;
        line-height: 1.6;
        color: var(--ink-muted);
    }

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

.ar-score-num {
    font-size: 56px;
}

.ar-score-of {
    font-size: 20px;
}

.ar-areas {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

    .ar-areas li {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

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

.ar-area-title {
    font-weight: 600;
}

.ar-fixes {
    margin: 0;
    padding: 0 0 0 22px;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    font-size: 15px;
    line-height: 1.55;
}

/* Policy */

.ar-policy-card {
    gap: 22px;
}

.ar-policy-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-4);
}

.ar-names {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
    gap: var(--space-4);
}

.ar-policy {
    padding: 32px 36px;
    background: var(--surface-field);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 22px;
    max-height: 720px;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.65;
}

.ar-policy-title {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .ar-policy-title span:first-child {
        font-size: 24px;
        line-height: 1.25;
        font-weight: 800;
        letter-spacing: -0.01em;
    }

    .ar-policy-title .ar-muted {
        font-size: 14px;
    }

.ar-policy-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

    .ar-policy-section h3 {
        font-size: 17px;
        font-weight: 700;
    }

    .ar-policy-section ul {
        margin: 0;
        padding: 0 0 0 20px;
        display: flex;
        flex-direction: column;
        gap: 6px;
        line-height: 1.6;
    }

/* Tools */

.ar-tools-block {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.ar-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: var(--space-4);
}

.ar-tool {
    background: var(--surface-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

    .ar-tool p {
        font-size: 15px;
        line-height: 1.55;
    }

.ar-tool-head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* AppIcon tile with the app's icon from Zavanto/Design, drawn in white through a mask so it needs no inline SVG. */
.ar-tool-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 11px;
}

    .ar-tool-icon i {
        display: block;
        width: 22px;
        height: 22px;
        background: currentColor;
        -webkit-mask: var(--icon) center / contain no-repeat;
        mask: var(--icon) center / contain no-repeat;
    }

.ar-tool-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
}

    .ar-tool-name strong {
        font-size: 17px;
    }

    .ar-tool-name span {
        font-size: 13px;
        line-height: 1.4;
        color: var(--ink-muted);
    }

.ar-soon {
    flex: 0 0 auto;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    background: var(--surface-sunken);
    color: var(--ink-muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

a.ar-tool-link, a.ar-notify {
    width: fit-content;
    text-decoration: none;
    font-size: 15px;
}

/* Email and read receipts */

.ar-mail {
    padding: var(--space-4) 18px;
    background: var(--surface-sunken);
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 15px;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ar-copy {
    width: fit-content;
}

.ar-receipt-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.ar-checks {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    font-size: 15px;
}

    .ar-checks li {
        display: flex;
        gap: 10px;
    }

    .ar-checks .icon {
        color: var(--accent-ink);
    }

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

    .ar-restart .ar-muted {
        font-size: 14px;
    }

@media (max-width: 600px) {
    .ar-card {
        padding: var(--space-5);
    }

    .ar-policy {
        padding: var(--space-5);
    }

    .ar-result-head h1 {
        font-size: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ar-bar-fill {
        transition: none;
    }
}

/* The script swaps the icon inside a button; the slot does not change the button's layout. */
.ar-icon-slot {
    display: contents;
}

/* "Leave the test?" (Shared/FocusHeader.razor): a modal dialog, centred by the browser. */

.ar-leave-dialog {
    width: min(420px, calc(100vw - 2 * var(--space-5)));
    margin: auto;
    padding: var(--space-6);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
    color: var(--ink);
    box-shadow: var(--shadow-lg);
}

    .ar-leave-dialog::backdrop {
        background: color-mix(in srgb, var(--chrome) 60%, transparent);
    }

    .ar-leave-dialog[open] {
        display: flex;
        flex-direction: column;
        gap: var(--space-3);
    }

.ar-leave-title {
    font-size: 21px;
    line-height: 28px;
    font-weight: 700;
}

.ar-leave-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink-muted);
}

.ar-leave-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--space-3);
    margin-top: var(--space-3);
}

    /* Both buttons as tall as the primary one. */
    .ar-leave-actions .zv-btn {
        min-height: var(--control-lg);
    }

@media (max-width: 420px) {
    .ar-leave-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }
}
