:root {
    /* Colors – Light Mode */
    --brand-color: rgb(127, 21, 23);
    --dark-header-bg: #f2f2f2;
    /* soft off-white */
    --header-text-color: #f8f3f3;
    --color-bg: #ffffff;
    --color-text: #1a1a1a;
    --color-muted: #5f6368;
    --color-border: #dcdcdc;
    --color-primary: #005fcc;
    --color-thumb: #1a1a1a;
    /* Surface */
    --color-surface: #f1f3f5;
    /* header / panels */
    --color-surface-strong: #e9ecef;
    /* Typography */
    --font-family-base: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-size-base: 1rem;
    --line-height-base: 1.5;
/*     Spacing (4pt scale) */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 1rem;
    --space-4: 1.5rem;
    --space-5: 2rem;
    --space-6: 2.5rem;
    --space-7: 3rem;
    /* Layout */
    --content-max-width: 75rem;
    /* ~960px */
    --content-padding: 1rem;
    /* Navigation */
    --nav-height: 64px;
    /* Focus */
    --focus-ring-dark-surface: 0px 0px 3px rgba(255, 255, 0, .95);
    --focus-ring-light-surface: 0 0 0 3px rgba(255, 69, 0, 0.95);
    --focus-outline-dark: 3px solid rgba(17, 17, 17, 0.95); /* for light surfaces */
    --focus-outline-light: 3px solid rgba(255, 255, 255, 0.95); /* for dark surfaces */
    --focus-color: #ffffff;
    --action-bg: var(--brand-color);
    --action-text: #ffffff;
}

/* baseline: applies everywhere unless overridden */
:where(a, button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])):focus-visible {
    outline: 2px solid transparent;
    outline-offset: 3px;
    box-shadow: var(--focus-ring-light-surface);
    border-radius: 6px;
}

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

html {
    font-size: 100%;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
}

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

#main-content {
    flex: 1;
    /*  top: 0;*/
}

    #main-content:has(.login-page) {
        max-width: none;
        margin: 0;
        padding: 0;
    }

html[data-theme="light"] {
    --color-bg: #ffffff;
    --color-surface: #f1f3f5;
    --header-text-color: #f8f3f3;
    --color-surface-strong: #e9ecef;
    --color-thumb: #1a1a1a;
    --color-text: #1a1a1a;
    --color-muted: #5f6368;
    --color-border: #dcdcdc;
    --color-primary: #005fcc;
    --focus-color: #111111;
    --focus-ring: #005fcc;
    --focus-ring-dark-surface: 0 0 0 3px rgba(255, 255, 0, 0.95);
    --focus-ring-light-surface: 0 0 0 3px rgba(255, 69, 0, 0.95);
}

    html[data-theme="light"] .site-header,
    html[data-theme="light"] .site-footer {
        border-color: rgba(0, 0, 0, 0.15);
    }

    html[data-theme="light"] .theme-switch-track {
        background-color: var(--color-border);
        border: solid 1px var(--color-muted);
    }

    html[data-theme="light"] .theme-switch-thumb {
        background-color: var(--color-thumb);
        left: 1.5px;
    }

    html[data-theme="light"] .sun {
        opacity: 1;
    }

    html[data-theme="light"] .moon {
        opacity: .3;
        color: var(--header-text-color);
    }

    html[data-theme="light"] .site-header a:focus-visible,
    html[data-theme="light"] .site-header button:focus-visible,
    html[data-theme="light"] .site-footer a:focus-visible,
    html[data-theme="light"] .site-footer button:focus-visible {
        outline: 2px solid transparent;
        outline-offset: 3px;
        box-shadow: var(--focus-ring-dark-surface);
    }

    html[data-theme="light"] .nav-menu a:focus-visible,
    html[data-theme="light"] .nav-menu button:focus-visible {
        outline: 2px solid transparent;
        outline-offset: 3px;
        box-shadow: var(--focus-ring-dark-surface);
    }

html[data-theme="light"] .faq-category:focus-visible,
html[data-theme="light"] .faq-question:focus-visible,
html[data-theme="light"] .input :focus-visible {
    box-shadow: inset var(--focus-ring-light-surface);
    border-radius: 10px;
}

html[data-theme="dark"] {
    --color-bg: #191919;
    --color-surface: #2d2925;
    --color-surface-strong: #2a2a2a;
    --header-text-color: #0b0909;
    --color-thumb: #f1f1f1;
    --color-text: #f1f1f1;
    --color-muted: #a1a1a1;
    --color-border: #2a2a2a;
    --color-primary: #4d9cff;
    --action-bg: #f2f2f2;
    --action-text: #f2f2f2;
    --focus-color: #f2f2f2;
    --focus-ring: 0 0 0 3px var(--focus-color);
    --focus-ring-dark-surface: 0 0 0 3px rgba(255, 255, 0, 0.95);
    --focus-ring-light-surface: 0 0 0 3px rgba(255, 69, 0, 0.95);
}

    html[data-theme="dark"] .site-header,
    html[data-theme="dark"] .site-footer {
        background: linear-gradient(to right, color-mix(in srgb, var(--dark-header-bg) 96%, black), var(--dark-header-bg), color-mix(in srgb, var(--dark-header-bg) 96%, white));
        color: var(--header-text-color);
        border-color: rgba(255, 255, 255, 0.15);
    }

    html[data-theme="dark"] .theme-switch-track {
        background-color: var(--color-surface);
        border: solid 1px var(--color-text);
    }

    html[data-theme="dark"] .theme-switch-thumb {
        transform: translateX(28px);
        background-color: var(--color-thumb);
    }


    html[data-theme="dark"] .sun {
        opacity: 0.3;
    }

    html[data-theme="dark"] .moon {
        opacity: 1;
    }

    html[data-theme="dark"] .site-header a:focus-visible,
    html[data-theme="dark"] .site-header button:focus-visible,
    html[data-theme="dark"] .site-footer a:focus-visible,
    html[data-theme="dark"] .site-footer button:focus-visible {
        outline: 2px solid transparent;
        outline-offset: 3px;
        box-shadow: var(--focus-ring-light-surface);
    }

    html[data-theme="dark"] .faq-category:focus-visible,
    html[data-theme="dark"] .faq-question:focus-visible,
    html[data-theme="dark"] .input :focus-visible {
        box-shadow: inset var(--focus-ring-light-surface);
        border-radius: 10px;
    }

    html[data-theme="dark"] .nav-menu a:focus-visible,
    html[data-theme="dark"] .nav-menu button:focus-visible {
        outline: 2px solid transparent;
        outline-offset: 3px;
        box-shadow: var(--focus-ring-light-surface);        
    }

.theme-switch {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}


.theme-switch-track {
    position: relative;
    width: 62px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid var(--color-text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px;
    transition: opacity 0.3s 0.3s ease;
}

.switch-icon {
    height: 14px;
    width: 14px;
    fill: none;
    line-height: 1;
    opacity: 0.5;
    transition: opacity 0.3s ease stroke 0.3s ease;
}


.theme-switch-thumb {
    width: 26px;
    height: 26px;
    background-color: var(--color-thumb);
    border-radius: 50%;
    position: absolute;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.switch-icon.sun {
    height: 18px;
    width: 18px;
}

.switch-icon.moon {
    fill: currentColor;
    stroke: currentColor;
    height: 18px;
    width: 18px;
}

body {
    margin: 0;
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text);
    background: var(--color-bg);
}

    body.menu-open {
        overflow: hidden;
    }

.site-header {
    position: fixed;
    width: 100%;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    background: linear-gradient(to right, color-mix(in srgb, var(--brand-color) 85%, black), var(--brand-color), color-mix(in srgb, var(--brand-color) 96%, white));
    color: var(--header-text-color);
    border-bottom: 1px solid var(--color-border);
    z-index: 1000;
    top: 0;
    left: 0;
    right: 0;
    padding-block: 0.5rem;

    height: var(--nav-height);
    padding-inline: var(--content-padding);
}

    .site-header,
    .site-header .nav,
    .site-header .nav-menu {
        overflow: visible;
    }

        .site-header .nav-menu a {
            padding: 0.5rem 0.75rem; /* increases click + focus area */
            border-radius: 8px; /* makes the focus ring look intentional */
        }

        .site-header a,
        .site-footer a {
            color: inherit;
        }

        .site-header svg,
        .site-footer svg {
            fill: currentColor;
        }

        .site-header a:focus-visible,
        .site-footer a:focus-visible,
        .site-header button:focus-visible,
        .site-footer button:focus-visible {
            outline: 2px solid transparent;
            outline-offset: 3px;
            box-shadow: var(--focus-ring-light-surface);
            border-radius: 6px;
        }

.nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--nav-height);
    padding: 0 1rem;
}

.site-title {
    color: var(--header-text-color);
    font-size: 1.25rem;
    font-weight: 600;
}


.nav-toggle {
    color: var(--header-text-color);
    right: 1rem;
    top: 0.75rem;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    gap: var(--space-4);
    display: none;
    flex-direction: column;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    background-color: var(--color-bg);
    overflow-y: auto;
    z-index: 999;
}

    .nav-menu.is-open {
        display: flex;
    }

.nav-menu[hidden] {
    display: none !important;
}

.nav-menu li {
    border-top: 1px solid var(--color-border);
    padding-top: .75rem;
}

.nav-menu a,
.nav-menu button {
    display: block;
    padding: var(--space-2) var(--space-3);
    min-height: 55px;
    text-decoration: none;
    color: var(--color-text);
    font-size: 1.50rem;
    font-weight: 600;
}

a,
button {
    font: inherit;
}

.primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    font-weight: 600;
    margin-top: var(--space-4);
    padding: 0.75rem 1.25rem;
    background-color: var(--color-primary);
    color: var(--action-text);
    text-decoration: none;
    border-radius: 10px;
    border: 1px solid transparent;
}

    .primary-action:hover {
        text-decoration: underline;
    }

@media (hover: hover) {

    .primary-action:hover,
    .login-button:hover {
        filter: brightness(1.25);
        text-decoration: none;
    }
}

.primary-action:focus-visible,
.login-button:focus-visible,
button.primary-action:focus-visible {
    outline: 2px solid transparent;
    outline-offset: 3px;
    box-shadow: var(--focus-ring-light-surface);
    border-color: currentColor;
}

.status-button {
    font-weight: 600;
    color: var(--color-primary);
}

.header-image {
    display: block;
    margin: 1.25rem auto;
    margin-bottom: var(--space-4);
    max-width: 220px;
    height: auto;
}

main {
    max-width: var(--content-max-width);
    margin: calc(var(--nav-height) + 1rem) auto 0;
    padding: 1rem var(--content-padding) 2rem;
    padding-top: 0;
}

    .main > * + * {
        margin-top: 2rem;
    }

.home-page-header,
.home-page-access {
    width: 100%;
    max-width: 75rem;
    margin: 0 auto;
    text-align: center;
}

    .home-page-header h1,
    .home-page-header h2,
    .home-page-access h2 {
        text-align: center;
    }
    .home-page-header .welcome-title {
        margin: 0 0 1rem 0;
    }

    .home-page-header .header-content {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .home-page-header .header-image {
        order: -1;
        justify-self: center;
        height: auto;
    }

    .home-page-header .header-text {
        text-align: center;
        
    }

        .home-page-header .header-text p {
            margin: 0.25rem 0;
            font-size: 1rem;
        }

#main-content h1[tabindex="-1"]:focus {
    outline: none !important;
    box-shadow: none !important;
}

.home #main-content h2 {
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
}

.home-page-header p,
.home-page-access p {
    text-align: left;
    max-width: 70ch;
    margin-left: auto;
    margin-right: auto;
    margin: 0.5rem auto;
}

section > * + * {
    margin-top: 1rem;
}

h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: var(--space-3);
}

h2 {
    font-size: 1.50rem;
    font-weight: 500;
    margin-bottom: var(--space-2);
}

h1,
h2,
h3 {
    color: var(--color-text);
}

p {
    margin-bottom: var(--space-3);
}

.site-footer {
    background: linear-gradient(to right, color-mix(in srgb, var(--brand-color) 85%, black), var(--brand-color), color-mix(in srgb, var(--brand-color) 96%, white));
    color: var(--header-text-color);
    padding: 0.85rem 1rem;
    margin: 0;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    border-top: 1px solid var(--color-border);
    z-index: 900;
}

main.login-page {
    max-width: none;
    margin: 0;
    padding: 0;
}

/* =========================
   Login Page
   ========================= */

.login-shell {
    margin-top: var(--nav-height);
    display: grid;
    grid-template-columns: 1fr;
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--color-bg);
}

.login-card {
    display: flex;
    flex-direction: column; 
    width: 100%;
    max-width: 520px;
    background: var(--color-surface-strong);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.login-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    margin-bottom: .75rem;
}

.login-logo {
    max-width: 150px;
    height: auto;
}

.client-name {
    font-size: 0.95rem;
    font-weight: 600;
}

.client-sub {
    font-size: 0.9rem;
    color: var(--color-muted);
}

.county-title {
    font-size: 1.25rem;
    font-weight: 600;
}

    .county-title p {
        margin: 0;
    }

.county-info {
    margin: 0;
    margin-top: 0;
}

.login-instructions {
    margin: 0;
}

.login-form {
    display: grid;
    gap: 0.75rem;
}

.field {
    display: grid;
    gap: 0.375rem;
}

#jurorIdHelp {
    display: none;
}

#eSignatureHelp {
    display: none;
}

.login-page label {
    font-size: 0.9rem;
    color: var(--color-muted);
}

.login-page .input,
.login-page select {
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
}

    .login-page .input:focus-visible,
    .login-page select:focus-visible {
        box-shadow: var(--focus-ring-light-surface);
    }

.help-text {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-top: 0.25rem;
}

.login-page .dob-selects {
    display: flex;
    gap: 0.75rem;
}

.login-page .dob-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.login-page .dob-label {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-align: center;
    color: var(--color-muted);
}

.login-alert {
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(180, 0, 0, 0.35);
    background: rgba(180, 0, 0, 0.1);
}

/* =========================
   FAQ Page
   ========================= */

.faq-page {
    max-width: var(--content-max-width);
    margin-inline: auto;
}

.faq-hero {
    text-align: center;
    padding-top: var(--space-3);
    padding-bottom: var(--space-3);
}

.faq-client-logo {
    display: block;
    margin: 0 auto var(--space-2);
    max-width: 160px;
    height: auto;
}

.faq-client-name {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--color-muted);
}

.faq-category-select {
    display: block;
    margin-bottom: var(--space-3);
}

.faq-category-select-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-text);
}

.faq-category-select-control {
    width: 100%;
    min-height: 44px;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
}

    .faq-category-select-control:focus-visible {
        outline: none;
        box-shadow: var(--focus-ring-light-surface);
    }

.faq-category-buttons {
    display: none;
}

.faq-categories {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-3);
    margin-bottom: var(--space-4);
}

.faq-category {
    min-height: 44px;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    text-align: left;
    cursor: pointer;
}

    .faq-category.is-active {
        border-color: var(--color-primary);
        border-color: color-mix( in srgb, var(--color-primary) 60%, var(--color-border) 40% );
        box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
        box-shadow: 0 0 0 2px color-mix( in srgb, var(--color-primary) 25%, transparent );
    }
    .faq-category:focus-visible {
        outline: 2px solid transparent;
        box-shadow: var(--focus-ring-light-surface);
    }

.faq-question:focus-visible {
    outline: none;
}

.faq-section-title {
    margin-top: var(--space-4);
}

.faq-accordion {
    border: 1px solid var(--color-border);
    border-radius: 16px;
    overflow: hidden;
    background: var(--color-bg);
}

.faq-item {
    border-top: 1px solid var(--color-border);
}

    .faq-item:first-child {
        border-top: none;
    }

.faq-question {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-3);
    align-items: center;
    padding: 1rem;
    background: var(--color-bg);
    color: var(--color-text);
    border: 0;
    cursor: pointer;
    text-align: left;
}

.faq-question-text {
    font-weight: 600;
}

/* Hover highlight on desktop only (and only where hover exists) */
@media (hover: hover) and (min-width: 768px) {
    .faq-question:hover {
        background: color-mix(in srgb, var(--color-surface) 65%, transparent);
    }
}

.faq-answer {
    background: var(--color-surface);
}

    .faq-answer:focus-visible {
        outline: 2px solid transparent;
        outline-offset:3px;
/*        box-shadow: var(--focus-ring-light-surface); */
    }

.faq-answer-inner {
    padding: 1rem 1rem 1rem 1rem;
    color: var(--color-text);
}

    .faq-answer-inner a {
        color: var(--color-primary);
    }

    .faq-answer-inner p:first-child {
        margin-top: 0;
    }

    .faq-answer-inner ul {
        margin-left: 1.25rem;
    }

.faq-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .faq-icon svg {
        width: 28px;
        height: 28px;
        display: block;
    }

.faq-question[aria-expanded="false"] .faq-icon-circle {
    fill: var(--color-text);
}

.faq-question[aria-expanded="false"] .faq-icon-line {
    stroke: var(--color-bg);
}

.faq-icon-line {
    stroke-linecap: round;
}

.faq-question[aria-expanded="true"] .faq-icon-circle {
    fill: var(--color-bg);
    stroke: var(--color-text);
}

.faq-question[aria-expanded="true"] .faq-icon-line {
    stroke: var(--color-text);
}

.faq-question[aria-expanded="true"] .faq-icon-v {
    opacity: 0;
}

/*Mobile Media Query*/
@media (max-width: 767px) {
    .nav-menu.is-open {
        display: flex;
        flex-direction: column;
    }

    .nav-login {    
        margin-top:0;
        padding-top: var(--space-4);
        display:flex;
        justify-content: center;
    }

    .nav-login-link {
        display: inline-flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        width:100%;
        max-width: 24rem;
        padding: 0.85rem 1rem;
        border-radius: 12px;
        background: var(--color-primary);
        color: var(--action-text) !important;
        text-decoration: none;
        font-weight: 700;
        box-shadow: 0 8px 18px rgba(0,0,0,0.12);
    }

        .nav-login-link:hover {
            text-decoration: none;
        }

        .nav-login-link:focus-visible {
            outline: 2px solid transparent;
            outline-offset: 3px;
            box-shadow: var(--focus-ring-l  -surface);
        }
}

/*Desktop Media Query*/
@media (min-width: 768px) {
    /* =========================
   Header/Navigation
   ========================= */
    .nav-toggle {
        display: none;
    }

    .nav-menu[hidden] {
        display: flex !important;
    }

    .nav-menu {
        position: static;
        display: flex !important;
        flex-direction: row;
        align-items: center;
        height: 100%;
        width: auto;
        padding: 0%;
        margin-left: 0;
        background: none;
    }

        .nav-menu li {
            padding: 0;
        }

        .nav-menu a {
            color: var(--header-text-color);
            text-decoration: none;
            font-size: 1.125rem;
        }

            .nav-menu a[aria-current="page"] {
                font-weight: 600;
                background-color: var(--color-bg);
                color: var(--color-text);           
                border-radius: 15px;
                
            }

            .nav-menu a:focus-visible,
            .nav-menu button:focus-visible {
                outline: 2px solid transparent;
                outline-offset: 3px;
                box-shadow: var(--focus-ring-dark-surface);
            }

        .nav-menu a,
        .nav-menu button {
            display: flex;
            align-items: center;
            height: 100%;
            padding: 0 var(--space-3);
        }

        .nav-menu li {
            border: none;
        }

    /* =========================
   HomePage
   ========================= */
    .header-content {
        max-width: 43rem;
    }

    .home-page-header .header-content {
        grid-template-columns: 1fr auto;
        align-items: start;
        gap: 1rem;
        align-items:center;
    }

    .home-page-header .header-image {
        order: 0;
        justify-self: end; 
    }

    .home-page-header .header-text {
        text-align: left;
    }

        .home-page-header .header-text p {
            font-size: 1.20rem;
        }

        /* =========================
   Desktop Login Page
   ========================= */
        .login-shell {
            grid-template-columns: minmax(320px, 25%) 1fr;
        }

    .login-card {
        max-width: 420px;
        padding: 1.125rem;
    }

    .login-visual {
        display: block;
        filter: blur(2px);
        position: relative;
        background-size: cover;
        background-position: center;
        border-left: 1px solid var(--color-border);
    }

    .visual-overlay {
        position: absolute;
        inset: 0;
        background: linear-gradient( to left, rgba(0,0,0,0.1), rgba(0,0,0,0.35) );
    }

    /* =========================
   Desktop FAQ Page
   ========================= */

    .faq-category-select {
        display: none;
    }

    .faq-category-buttons {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--space-2);
    }

    .faq-categories {
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--space-2);
    }

    .faq-category {
        text-align: center;
    }
}

@media(prefers-color-scheme: dark) {
    :root {
        /* Colors: – Dark Mode*/
        --color-bg: #191919;
        --color-surface: #2d2925;
        --color-surface-strong: #2a2a2a;
        --header-text-color: #0b0909;
        --color-thumb: #f1f1f1;
        --color-text: #f1f1f1;
        --color-muted: #a1a1a1;
        --color-border: #2a2a2a;
        --color-primary: #4d9cff;
        --action-bg: #f2f2f2;
        --action-text: #f2f2f2;
        --focus-color: #f2f2f2;
        --focus-ring: 0 0 0 3px var(--focus-color);
        --focus-ring-dark-surface: 0 0 0 3px rgba(255, 69, 0, 0.95);
        --focus-ring-light-surface: 0 0 0 3px rgba(255, 69, 0, 0.95);
    }
}

/* =========================
   Register / Verify-Email Pages (Phase 1)
   ========================= */

main.register-page,
main.verify-email-page {
    max-width: none;
    margin: 0;
    padding: 0;
}

.register-shell,
.verify-shell {
    margin-top: var(--nav-height);
    display: grid;
    grid-template-columns: 1fr;
    padding: 1.25rem 1rem 3rem;
    background: var(--color-bg);
}

.register-card,
.verify-card {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    background: var(--color-surface-strong);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: clamp(1.25rem, 4vw, 2.25rem);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.register-header h1,
.verify-card h1 {
    margin: 0 0 .35rem;
    font-size: clamp(1.4rem, 2.4vw, 1.75rem);
    font-weight: 600;
    line-height: 1.2;
    color: var(--brand-color);
}

.register-subtitle {
    margin: 0;
    color: var(--color-muted);
    line-height: 1.5;
}

.register-card .field { display: grid; gap: .35rem; }
.register-card label  { font-size: .9rem; font-weight: 600; color: var(--color-text); }

.register-card .input {
    padding: .75rem .85rem;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 1rem;
    line-height: 1.4;
    width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
.register-card .input:hover { border-color: #b9b9b9; }
.register-card .input:focus-visible {
    outline: none;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(127, 21, 23, .18);
}
.register-card .help-text { font-size: .8rem; color: var(--color-muted); }
.register-card .validation-message { color: #b30019; font-size: .85rem; margin-top: .15rem; }

.legal-section {
    margin: .5rem 0 0;
    padding: 1rem 1.1rem 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.legal-section legend { padding: 0 .4rem; font-weight: 600; color: var(--brand-color); font-size: .95rem; }
.legal-section-intro { margin: 0 0 .5rem; color: var(--color-muted); font-size: .9rem; }

.legal-doc-block {
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
    overflow: hidden;
    transition: border-color .15s;
}
.legal-doc-block:has(.legal-doc-accept input:checked) {
    border-color: var(--brand-color);
    box-shadow: 0 0 0 1px var(--brand-color) inset;
}
.legal-doc-summary {
    list-style: none; cursor: pointer;
    padding: .75rem 1rem;
    display: flex; align-items: center; gap: .6rem;
    font-weight: 500; user-select: none;
}
.legal-doc-summary::-webkit-details-marker { display: none; }
.legal-doc-summary::before {
    content: ""; width: 0; height: 0;
    border-left: 6px solid var(--brand-color);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    transition: transform .15s ease;
    flex-shrink: 0;
}
.legal-doc-collapsible[open] .legal-doc-summary::before { transform: rotate(90deg); }
.legal-doc-title { font-weight: 600; }
.legal-doc-version { color: var(--color-muted); font-size: .8rem; font-weight: 400; }
.legal-doc-toggle-hint { margin-left: auto; color: var(--color-muted); font-size: .8rem; font-weight: 400; }
.legal-doc-body {
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
    max-height: 320px; overflow-y: auto;
    font-size: .95rem; line-height: 1.55;
}
.legal-doc-body h2, .legal-doc-body h3, .legal-doc-body h4 {
    color: var(--brand-color); margin-top: 1rem; margin-bottom: .35rem;
}
.legal-doc-body h2 { font-size: 1.1rem; }
.legal-doc-body h3 { font-size: 1rem; }
.legal-doc-body h4 { font-size: .92rem; }
.legal-doc-body p { margin: .5rem 0; color: var(--color-text); }
.legal-doc-loading { padding: .9rem 1rem; color: var(--color-muted); font-style: italic; }
.legal-doc-accept {
    display: flex; align-items: flex-start; gap: .55rem;
    padding: .7rem 1rem .85rem;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    cursor: pointer; font-size: .92rem; line-height: 1.4;
}
.legal-doc-accept input[type="checkbox"] {
    margin-top: 2px; accent-color: var(--brand-color);
    width: 1.05rem; height: 1.05rem; flex-shrink: 0;
}

.form-actions {
    display: flex; gap: .75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-top: .5rem;
}

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: .4rem;
    padding: .7rem 1.25rem;
    border-radius: 10px;
    font-size: .95rem; font-weight: 600; line-height: 1.2;
    border: 1px solid transparent;
    cursor: pointer; text-decoration: none;
    transition: background .15s, border-color .15s, color .15s, transform .05s;
    min-width: 120px;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
    background: var(--brand-color);
    color: #fff;
    border-color: var(--brand-color);
}
.btn-primary:hover:not(:disabled) {
    background: rgb(108, 17, 19);
    border-color: rgb(108, 17, 19);
}
.btn-secondary {
    background: transparent;
    color: var(--brand-color);
    border-color: var(--brand-color);
}
.btn-secondary:hover:not(:disabled) {
    background: rgba(127, 21, 23, .07);
}
.btn-block { width: 100%; }
.btn-link {
    background: none; border: none;
    color: var(--brand-color);
    text-decoration: underline;
    cursor: pointer; padding: 0;
    font-size: .9rem; font-weight: 500;
}
.btn-link:disabled { color: var(--color-muted); cursor: not-allowed; }
.btn-link:hover:not(:disabled) { color: rgb(108, 17, 19); }

.alert {
    padding: 1.1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
}
.alert h3 { margin: 0 0 .5rem; color: var(--brand-color); font-size: 1.15rem; }
.alert p  { margin: .5rem 0; line-height: 1.5; }
.alert-success {
    border-color: rgba(34, 113, 53, .35);
    background: rgba(34, 113, 53, .07);
}
.alert-success h3 {
    color: rgb(28, 95, 44);
    display: flex; align-items: center; gap: .5rem;
}
.alert-success h3::before {
    content: "✓";
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.6rem; height: 1.6rem;
    border-radius: 50%;
    background: rgb(34, 113, 53);
    color: #fff; font-size: 1rem;
    flex-shrink: 0;
}
.error-text { color: #b30019; margin: 0 0 1rem; }

.loader {
    width: 36px; height: 36px;
    border: 4px solid var(--color-border);
    border-top-color: var(--brand-color);
    border-radius: 50%;
    margin: 1.25rem auto 0;
    animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
    .form-actions { flex-direction: column-reverse; }
    .form-actions .btn,
    .form-actions a.btn { width: 100%; }
}

/* =========================
   Login Page extras (Phase 2)
   ========================= */

.login-aux-links {
    margin: .25rem 0 .75rem;
    font-size: .9rem;
}
.login-aux-links a {
    color: var(--brand-color);
    text-decoration: none;
}
.login-aux-links a:hover { text-decoration: underline; }

.login-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1rem 0;
    color: var(--color-muted);
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.login-card .btn-block {
    width: 100%;
    margin-top: .5rem;
}

/* =========================
   MFA Pages (Phase 3)
   ========================= */

/* The 6-digit code field — large monospace, generous spacing */
.mfa-code-field { display: grid; gap: .35rem; }

.mfa-code-input {
    font-family: ui-monospace, "SF Mono", "Courier New", monospace !important;
    font-size: 1.6rem !important;
    letter-spacing: .5rem;
    text-align: center;
    padding: .85rem 1rem !important;
    /* Visually communicate "6 digits" by widening */
    max-width: 14rem;
    margin: 0 auto;
}

.mfa-aux-actions {
    display: flex;
    gap: .5rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: .25rem;
    font-size: .9rem;
}
.mfa-aux-sep {
    color: var(--color-muted);
}

/* Method selection cards on /mfa-setup */
.mfa-method-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-bg);
    margin: .75rem 0;
    transition: border-color .15s, box-shadow .15s;
}
.mfa-method-card:hover {
    border-color: var(--brand-color);
    box-shadow: 0 0 0 1px var(--brand-color) inset;
}
.mfa-method-card-body {
    flex: 1;
    min-width: 0;
}
.mfa-method-card-body strong {
    display: block;
    font-size: 1rem;
    margin-bottom: .25rem;
}
.mfa-method-card-body p {
    margin: 0;
    color: var(--color-muted);
    font-size: .9rem;
    line-height: 1.4;
}
.mfa-method-card .btn { min-width: 110px; }

@media (max-width: 480px) {
    .mfa-method-card {
        flex-direction: column;
        align-items: stretch;
    }
    .mfa-method-card .btn { width: 100%; }
    .mfa-code-input {
        font-size: 1.4rem !important;
        letter-spacing: .35rem;
        max-width: 100%;
    }
}

/* Recovery code display block — fixed-width, easy to read */
.recovery-codes {
    list-style: none;
    margin: .75rem 0 1.25rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-bg);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: .5rem 1.25rem;
}
.recovery-codes li {
    margin: 0;
    text-align: center;
}
.recovery-codes code {
    font-family: ui-monospace, "SF Mono", "Courier New", monospace;
    font-size: 1.05rem;
    letter-spacing: .12em;
    color: var(--color-text);
}


/* =========================
   Dashboard (Phase 4)
   ========================= */

main.dashboard-page {
    max-width: none;
    margin: 0;
    padding: 0;
}

.dashboard-shell {
    margin-top: var(--nav-height);
    padding: 1.5rem 1rem 3rem;
    background: var(--color-bg);
    min-height: calc(100vh - var(--nav-height));
}

.dashboard-header {
    max-width: 960px;
    margin: 0 auto 1.5rem;
}

.dashboard-header h1 {
    margin: 0 0 .25rem;
    font-size: clamp(1.6rem, 3vw, 2rem);
    font-weight: 600;
    color: var(--brand-color);
}

.dashboard-subtitle {
    margin: 0;
    color: var(--color-muted);
    line-height: 1.5;
}

.dashboard-grid {
    max-width: 960px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.dashboard-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-surface-strong);
    text-decoration: none;
    color: var(--color-text);
    transition: border-color .15s, box-shadow .15s, transform .05s;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.dashboard-card:hover:not(.dashboard-card-disabled) {
    border-color: var(--brand-color);
    box-shadow: 0 6px 18px rgba(127, 21, 23, .12);
}

.dashboard-card:active:not(.dashboard-card-disabled) {
    transform: translateY(1px);
}

.dashboard-card-disabled {
    opacity: .55;
    cursor: not-allowed;
}

.dashboard-card h3 {
    margin: 0 0 .25rem;
    font-size: 1.05rem;
    color: var(--brand-color);
}

.dashboard-card p {
    margin: 0;
    color: var(--color-muted);
    font-size: .9rem;
    line-height: 1.5;
}

.dashboard-card em {
    color: var(--color-muted);
    font-style: italic;
    font-size: .85rem;
}

.dashboard-card-icon {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.dashboard-footer {
    max-width: 960px;
    margin: 2rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
}


/* =========================

/* ===========================================================
   Phase 5a — Questionnaire page
   Layout matches the legacy Montgomery County Online Juror Profile
   screens — section headers in navy, two-column rows with question
   text on the left and Yes/No radios on the right, gray instruction
   blocks between questions.
   =========================================================== */

main.questionnaire-page {
    max-width: none;
    margin: 0;
    padding: 0;
}

.questionnaire-shell {
    margin-top: var(--nav-height);
    padding: 1.25rem 1rem 3rem;
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
    background: var(--color-bg);
    min-height: calc(100vh - var(--nav-height));
}

/* ---- header card ---- */
.qheader-card {
    background: var(--color-surface-strong);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.qheader-card h1 {
    margin: 0 0 .25rem;
    font-size: clamp(1.4rem, 2.5vw, 1.75rem);
    color: var(--brand-color);
}
.qheader-intro {
    margin: 0;
    color: var(--color-muted);
    font-size: .92rem;
}
.qheader-saveindicator {
    margin: .5rem 0 0;
    color: var(--color-muted);
    font-size: .85rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.saveindicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.saveindicator-dot.idle   { background: var(--color-border); }
.saveindicator-dot.saving { background: #f5a623; animation: qpulse 1.2s infinite; }
.saveindicator-dot.saved  { background: #2ec27e; }
.saveindicator-dot.error  { background: var(--color-danger, #c0392b); }
@keyframes qpulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .4; }
}

/* ---- section card ---- */
.qsection {
    background: var(--color-surface-strong);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.qsection-header {
    background: #2c3e50;          /* dark navy from screenshot */
    color: #fff;
    padding: .85rem 1rem;
    text-align: center;
}
.qsection-title {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: 1rem;
}

.qsection-instructions {
    padding: .85rem 1rem;
    color: #2b2b2b;
    font-size: .9rem;
    line-height: 1.55;
    background: #fafafa;
    border-bottom: 1px solid var(--color-border);
}

/* ---- question rows ---- */
.qrow {
    border-bottom: 1px solid var(--color-border);
    padding: .85rem 1rem;
}
.qrow:last-child { border-bottom: 0; }

.qrow-error {
    background: rgba(192, 57, 43, .04);
}

/* INLINE rows: question text left, radios right (matches screenshots) */
.qrow-inline {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
.qrow-inline .qrow-label {
    flex: 1 1 auto;
    line-height: 1.45;
    font-weight: 600;
    color: #2b2b2b;
    font-size: .95rem;
}
.qrow-inline .qrow-input {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* STACK rows: long-form inputs (textarea, dropdown, text) wrap below label */
.qrow-stack .qrow-label {
    line-height: 1.45;
    font-weight: 600;
    color: #2b2b2b;
    font-size: .95rem;
    margin-bottom: .5rem;
    display: block;
}
.qrow-stack .qrow-input {
    display: block;
}

.qrow-label strong {
    color: #2b2b2b;
    margin-right: .35rem;
}
.qrow-req {
    color: var(--color-danger, #c0392b);
    font-weight: 700;
    margin-right: .15rem;
}
.qrow-help {
    color: var(--color-muted);
    font-size: .82rem;
    line-height: 1.5;
    margin-top: .35rem;
    font-weight: 400;
}
.qrow-errortext {
    color: var(--color-danger, #c0392b);
    font-size: .82rem;
    margin-top: .35rem;
}

/* ---- gray instruction block (Section 2 Q8/Q9 and Q10-16 preambles) ---- */
.qrow-info {
    background: #6b7280;
    color: #fff;
    padding: 1rem 1.25rem;
    margin: 0;
    font-style: italic;
    font-size: .88rem;
    line-height: 1.6;
    border-bottom: 1px solid var(--color-border);
}

/* ---- Yes/No row ---- */
.yesno-row {
    display: inline-flex;
    gap: 1.25rem;
    align-items: center;
}
.yesno-option, .radio-option {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    cursor: pointer;
    font-size: .95rem;
    color: #2b2b2b;
    user-select: none;
}
.yesno-option input,
.radio-option input {
    margin: 0;
    accent-color: var(--brand-color);
    width: 16px;
    height: 16px;
}

/* ---- General radio group ---- */
.radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1.25rem;
}

/* ---- form controls ---- */
.qrow-input .form-control {
    width: 100%;
    padding: .5rem .65rem;
    border: 1px solid #aaa;
    border-radius: 4px;
    font-size: .95rem;
    font-family: inherit;
    background: #fff;
}
.qrow-input textarea.form-control {
    resize: vertical;
    min-height: 90px;
}
.qrow-input select.form-control {
    width: 240px;
    max-width: 100%;
    padding: .4rem .5rem;
}
.qrow-input .date-input,
.qrow-input .number-input {
    width: 200px;
}
.char-counter {
    color: var(--color-muted);
    font-size: .78rem;
    margin-top: .35rem;
}

/* ---- signature block ---- */
.qsignature {
    background: var(--color-surface-strong);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.signature-label {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    cursor: pointer;
    line-height: 1.5;
    color: var(--color-danger, #b32b1f);
    font-weight: 600;
    font-size: .92rem;
}
.signature-label input[type="checkbox"] {
    margin-top: .15rem;
    width: 16px;
    height: 16px;
    accent-color: var(--brand-color);
}

/* ---- action bar ---- */
.qactions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: .5rem;
}
.qactions .btn {
    min-width: 160px;
}

/* ---- inline alert (submit errors) ---- */
.alert {
    padding: .75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: .92rem;
}
.alert-error {
    background: #fdecea;
    border: 1px solid #f5c2bd;
    color: #8b1a13;
}

/* ===========================================================
   Dashboard status card additions (live questionnaire badge)
   =========================================================== */

.dashboard-card-action {
    border-color: var(--brand-color);
}
.dashboard-card-done {
    border-color: #2ec27e;
    background: linear-gradient(180deg, rgba(46, 194, 126, .04) 0%, transparent 100%);
}
.dashboard-card-done h3 {
    color: #1a8e5a;
}
.dashboard-badge {
    display: inline-block;
    margin-left: .5rem;
    padding: .15rem .5rem;
    font-size: .72rem;
    font-weight: 600;
    border-radius: 999px;
    vertical-align: middle;
    letter-spacing: .02em;
    text-transform: uppercase;
}
.dashboard-badge-todo {
    background: var(--brand-color);
    color: white;
}
.dashboard-badge-progress {
    background: #f5a623;
    color: #5a3a05;
}

/* ---- Mobile narrow layout ---- */
@media (max-width: 600px) {
    .qrow-inline {
        flex-direction: column;
        align-items: flex-start;
        gap: .5rem;
    }
    .qrow-input,
    .qrow-input .form-control,
    .qrow-input select.form-control,
    .qrow-input .date-input,
    .qrow-input .number-input {
        width: 100%;
    }
    .qactions {
        flex-direction: column-reverse;
    }
    .qactions .btn {
        width: 100%;
    }
}


/* ===========================================================
   Phase 5a — Privacy Policy / Terms of Use page (/terms)
   Required-acknowledgments block on questionnaire submit
   =========================================================== */

main.terms-page,
section.terms-page {
    max-width: none;
    margin: 0;
    padding: 0;
}

.terms-shell {
    margin-top: var(--nav-height);
    padding: 1.5rem 1rem 3rem;
    max-width: 880px;
    margin-left: auto;
    margin-right: auto;
    background: var(--color-bg);
    min-height: calc(100vh - var(--nav-height));
}

.terms-header {
    margin-bottom: 1rem;
}
.terms-header h1 {
    margin: 0 0 .25rem;
    font-size: clamp(1.5rem, 2.5vw, 1.9rem);
    color: var(--brand-color);
}
.terms-effective {
    margin: 0;
    color: var(--color-muted);
    font-size: .85rem;
}

.terms-card {
    background: var(--color-surface-strong);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    line-height: 1.6;
    color: #2b2b2b;
    font-size: .95rem;
}
.terms-card h2 {
    color: var(--brand-color);
    border-bottom: 2px solid var(--color-border);
    padding-bottom: .35rem;
    margin: 1.5rem 0 1rem;
    font-size: 1.3rem;
}
.terms-card h2.terms-section-divider {
    margin-top: 2.5rem;
}
.terms-card h2:first-child {
    margin-top: 0;
}
.terms-card h3 {
    color: #2b2b2b;
    margin: 1.25rem 0 .5rem;
    font-size: 1.05rem;
    font-weight: 700;
}
.terms-card p {
    margin: 0 0 .75rem;
}
.terms-card ul {
    margin: 0 0 .75rem;
    padding-left: 1.5rem;
}
.terms-card ul ul {
    margin: .25rem 0 .25rem;
}
.terms-card li {
    margin-bottom: .25rem;
}
.terms-allcaps {
    font-weight: 600;
    letter-spacing: .01em;
}
.terms-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.25rem;
}

/* ---- multi-checkbox acknowledgment block on questionnaire submit ---- */

.qsignature {
    background: #fff8e1;            /* soft yellow to draw attention */
    border: 1px solid #f0d375;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 14px rgba(0,0,0,0.04);
}
.qsignature-title {
    margin: 0 0 .85rem;
    font-size: 1rem;
    color: #6b4f00;
    font-weight: 700;
}

.signature-check {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    cursor: pointer;
    line-height: 1.5;
    color: #2b2b2b;
    font-size: .92rem;
    margin-bottom: .75rem;
    padding: .35rem 0;
    border-radius: 4px;
    transition: background .12s;
}
.signature-check:last-child { margin-bottom: 0; }
.signature-check:hover { background: rgba(0,0,0,.025); }
.signature-check input[type="checkbox"] {
    margin-top: .15rem;
    width: 16px;
    height: 16px;
    accent-color: var(--brand-color);
    flex: 0 0 auto;
}
.signature-check span {
    flex: 1 1 auto;
}
.signature-check a {
    color: var(--brand-color);
    text-decoration: underline;
}

.signature-check-error {
    background: #fdecea;
    color: var(--color-danger, #8b1a13);
}
.signature-check-error a { color: var(--color-danger, #8b1a13); }


/* ===========================================================
   Phase 5a — Summons banner + reporting info on dashboard
   =========================================================== */

/* ---- summons banner (date/time/panel) ---- */

.summons-banner {
    background: linear-gradient(180deg, #fff8d8 0%, #ffefb3 100%);
    border: 2px solid #d4a017;
    border-radius: 12px;
    padding: 1.5rem 1.5rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 6px 20px rgba(212,160,23,0.25);
    text-align: center;
}

.summons-banner-loading {
    background: var(--color-surface-strong);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1rem;
    color: var(--color-muted);
    text-align: center;
    margin-bottom: 1.5rem;
}

.summons-banner-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #5a3a05;
    margin-bottom: .35rem;
    letter-spacing: .01em;
}

.summons-banner-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: #2b2b2b;
    letter-spacing: .04em;
    margin-bottom: 1rem;
}

.summons-banner-lede {
    margin: 0 0 1rem;
    color: #2b2b2b;
    font-size: 1rem;
}

.summons-datetime-box {
    display: inline-flex;
    background: #fff;
    border: 2px solid #b32b1f;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.summons-datetime-cell {
    padding: 1rem 1.5rem;
    color: #b32b1f;
    font-weight: 700;
    font-size: 1.4rem;
    line-height: 1.2;
}

.summons-date {
    border-right: 2px solid #b32b1f;
}

.summons-banner-panel {
    margin: 0 0 1rem;
    color: #b32b1f;
    font-weight: 600;
    font-size: 1rem;
}

.summons-location {
    background: #fff;
    border-radius: 6px;
    padding: .85rem 1rem;
    margin-top: .5rem;
    text-align: left;
    border: 1px solid #d4a017;
}

.summons-location-label {
    font-weight: 700;
    color: #5a3a05;
    text-transform: uppercase;
    font-size: .8rem;
    letter-spacing: .04em;
    margin-bottom: .35rem;
}

.summons-location-body {
    color: #2b2b2b;
    line-height: 1.5;
    font-size: .95rem;
}

.summons-special {
    background: #fff;
    border-left: 4px solid #d4a017;
    padding: .65rem .85rem;
    margin-top: .85rem;
    text-align: left;
    color: #5a3a05;
    font-size: .9rem;
    border-radius: 4px;
}

/* ---- reporting info section ---- */

.reporting-info {
    background: var(--color-surface-strong);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.reporting-info-title {
    margin: 0 0 1rem;
    color: var(--brand-color);
    font-size: 1.25rem;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: .5rem;
}

.reporting-info h3 {
    margin: 1.25rem 0 .35rem;
    color: #2b2b2b;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    font-weight: 700;
}

.reporting-info p {
    margin: 0 0 .65rem;
    line-height: 1.55;
    color: #2b2b2b;
    font-size: .92rem;
}

.reporting-info ol,
.reporting-info ul {
    margin: 0 0 .65rem;
    padding-left: 1.5rem;
}

.reporting-info li {
    line-height: 1.55;
    color: #2b2b2b;
    margin-bottom: .25rem;
    font-size: .92rem;
}

.reporting-alert {
    background: #fdecea;
    border: 1px solid #f5c2bd;
    border-radius: 6px;
    padding: .85rem 1rem;
    color: #8b1a13;
    font-weight: 600;
    margin: 0 0 1rem;
}

.prohibited-list li {
    color: #b32b1f;
    font-weight: 600;
}

/* ---- mobile ---- */
@media (max-width: 640px) {
    .summons-datetime-box {
        flex-direction: column;
    }
    .summons-date {
        border-right: 0;
        border-bottom: 2px solid #b32b1f;
    }
    .summons-datetime-cell {
        font-size: 1.2rem;
        padding: .75rem 1rem;
    }
    .summons-banner-name {
        font-size: 1.2rem;
    }
}


/* ===========================================================
   Phase 5a Stage 2.3 — SUMMONS CARD (front and center)
   Bigger, bolder, unmissable. The juror sees this first when
   they sign in if they have a SummonsPanelID + AppearanceDateTime.
   =========================================================== */

.summonscard {
    background: #fff;
    border: 3px solid #b32b1f;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 28px rgba(179, 43, 31, 0.22);
}

.summonscard-band {
    background: #b32b1f;
    color: #fff;
    text-align: center;
    padding: .85rem 1rem;
    letter-spacing: .04em;
    font-size: clamp(.95rem, 1.6vw, 1.1rem);
    font-weight: 800;
    text-transform: uppercase;
}

.summonscard-band-text {
    display: inline-block;
}

.summonscard-body {
    padding: 1.5rem 1.5rem 1.75rem;
    text-align: center;
}

.summonscard-name {
    font-size: clamp(1.15rem, 2vw, 1.4rem);
    font-weight: 800;
    color: #2b2b2b;
    letter-spacing: .03em;
    margin-bottom: .65rem;
}

.summonscard-statusrow {
    margin-bottom: 1.25rem;
}

.summonscard-status-badge {
    display: inline-block;
    padding: .35rem .85rem;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ---- WHEN ---- */

.summonscard-section {
    margin: 0 auto 1.5rem;
    max-width: 560px;
}

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

.summonscard-section-label {
    font-size: .8rem;
    font-weight: 800;
    color: #5a6a7a;
    letter-spacing: .15em;
    margin-bottom: .65rem;
}

.summonscard-when {
    background: #fff8d8;
    border: 2px solid #d4a017;
    border-radius: 10px;
    padding: 1.25rem 1rem 1rem;
}

.summonscard-date {
    font-size: clamp(1.5rem, 3.6vw, 2.4rem);
    font-weight: 800;
    color: #b32b1f;
    line-height: 1.1;
    margin-bottom: .25rem;
    letter-spacing: -.01em;
}

.summonscard-time {
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    font-weight: 800;
    color: #b32b1f;
    line-height: 1.1;
    margin-bottom: .85rem;
    letter-spacing: -.01em;
}

.summonscard-countdown {
    display: inline-block;
    padding: .4rem 1rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: .9rem;
    letter-spacing: .05em;
}

.summonscard-countdown-today {
    background: #b32b1f;
    color: #fff;
    animation: summons-pulse 1.6s infinite;
}

.summonscard-countdown-soon {
    background: #d4a017;
    color: #4a3500;
}

.summonscard-countdown-far {
    background: #fff;
    border: 1px solid #d4a017;
    color: #6b4f00;
    font-weight: 600;
}

.summonscard-countdown-past {
    background: #efe6e4;
    color: #6b3a35;
    font-weight: 600;
}

@keyframes summons-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.04); }
}

/* ---- WHERE ---- */

.summonscard-where {
    background: #fafafa;
    border: 2px solid #2c3e50;
    border-radius: 10px;
    padding: 1.25rem 1rem;
}

.summonscard-location-name {
    font-size: clamp(1.1rem, 2.2vw, 1.4rem);
    font-weight: 800;
    color: #1f2d3d;
    margin-bottom: .35rem;
}

.summonscard-location-address {
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.5;
    color: #2b2b2b;
    font-weight: 500;
}

.summonscard-location-phone {
    margin-top: .65rem;
    font-size: .92rem;
    color: #2b2b2b;
}

/* ---- panel + special instructions ---- */

.summonscard-panelrow {
    margin: 0 auto;
    padding: .65rem 1rem;
    background: #f0f3f7;
    border-radius: 8px;
    color: #1f2d3d;
    font-size: .95rem;
    max-width: 560px;
    margin-bottom: .85rem;
}

.summonscard-panelrow strong {
    color: #b32b1f;
}

.summonscard-special {
    margin: 0 auto;
    max-width: 560px;
    padding: .75rem 1rem;
    background: #fff8e1;
    border-left: 4px solid #d4a017;
    border-radius: 4px;
    color: #5a3a05;
    text-align: left;
    font-size: .92rem;
}

/* ---- compact welcome header (when summonscard is at top) ---- */

.dashboard-header-compact {
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--color-border);
}

.dashboard-header-compact h2 {
    margin: 0 0 .15rem;
    font-size: 1.15rem;
    color: #2b2b2b;
    font-weight: 600;
}

.dashboard-header-compact .dashboard-subtitle {
    margin: 0;
    color: var(--color-muted);
    font-size: .9rem;
}

/* ---- mobile ---- */

@media (max-width: 640px) {
    .summonscard-body {
        padding: 1.25rem 1rem 1.5rem;
    }
    .summonscard-when,
    .summonscard-where {
        padding: 1rem .75rem;
    }
}


/* ===========================================================
   Phase 5a Stage 3 — Hero welcome, Get Directions button,
   action cards, request/contact form pages
   =========================================================== */

/* ---- Hero welcome ---- */
.dashboard-hero {
    background: linear-gradient(135deg, #1f2d3d 0%, #2c3e50 60%, #4a5d72 100%);
    color: #fff;
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 24px rgba(31,45,61,0.18);
}

.dashboard-hero-greeting h1 {
    margin: 0 0 .35rem;
    font-size: clamp(1.65rem, 3vw, 2.25rem);
    font-weight: 600;
    color: #fff;
    letter-spacing: -.005em;
}

.dashboard-hero-name {
    color: #ffd166;
    font-weight: 800;
    letter-spacing: .02em;
}

.dashboard-hero-subtitle {
    margin: 0;
    font-size: 1.05rem;
    color: rgba(255,255,255,0.85);
}

.dashboard-hero-subtitle strong { color: #fff; }

/* ---- Section title above the card grid ---- */
.dashboard-section-title {
    margin: 1.5rem 0 .85rem;
    font-size: 1.15rem;
    color: #2b2b2b;
    font-weight: 700;
    letter-spacing: -.005em;
}

/* ---- Action card grid (3-up on desktop) ---- */
.dashboard-grid-3 {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
    .dashboard-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .dashboard-grid-3 { grid-template-columns: 1fr; }
}

.dashboard-card {
    text-decoration: none;
}

.dashboard-card-pending {
    border-color: #f5a623;
    background: linear-gradient(180deg, rgba(245, 166, 35, .04) 0%, transparent 100%);
}

/* ---- Get Directions button on the summons card ---- */
.summonscard-directions {
    display: inline-block;
    margin-top: .85rem;
    padding: .55rem 1rem;
    background: #1a73e8;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: .95rem;
    box-shadow: 0 2px 6px rgba(26,115,232,0.25);
    transition: transform .12s, box-shadow .12s, background .12s;
}

.summonscard-directions:hover {
    background: #1558b0;
    box-shadow: 0 4px 10px rgba(26,115,232,0.32);
    transform: translateY(-1px);
}

/* ===========================================================
   Form pages (excuse / deferral / contact update)
   =========================================================== */

main.formpage,
section.formpage {
    max-width: none;
    margin: 0;
    padding: 0;
}

.formpage-shell {
    margin-top: var(--nav-height);
    padding: 1.5rem 1rem 3rem;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    background: var(--color-bg);
    min-height: calc(100vh - var(--nav-height));
}

.formpage-back {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--brand-color);
    text-decoration: none;
    font-size: .92rem;
    font-weight: 600;
}
.formpage-back:hover { text-decoration: underline; }

.formpage-header h1 {
    margin: 0 0 .35rem;
    color: var(--brand-color);
    font-size: clamp(1.4rem, 2.5vw, 1.75rem);
}

.formpage-subtitle {
    margin: 0 0 1.25rem;
    color: var(--color-muted);
    font-size: .95rem;
    line-height: 1.55;
}

.formpage-card {
    padding: 1.5rem 1.5rem 1.25rem;
}

.formpage-section-title {
    margin: 1.5rem 0 .75rem;
    font-size: 1rem;
    color: #2b2b2b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: .35rem;
}
.formpage-card .formpage-section-title:first-child { margin-top: 0; }

.form-row {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #2b2b2b;
    margin-bottom: .35rem;
    font-size: .92rem;
}

.form-row-grid2 {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form-row-grid3 {
    display: grid;
    gap: 1rem;
    grid-template-columns: 2fr 1fr 1fr;
}
@media (max-width: 600px) {
    .form-row-grid2,
    .form-row-grid3 { grid-template-columns: 1fr; }
}

.formpage-hint {
    color: var(--color-muted);
    font-size: .82rem;
    margin-top: .25rem;
    line-height: 1.45;
}

.formpage-note {
    background: #fff8e1;
    border-left: 4px solid #d4a017;
    padding: .75rem .9rem;
    margin: 1rem 0;
    color: #5a3a05;
    font-size: .9rem;
    border-radius: 4px;
}

.formpage-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}
.formpage-actions .btn {
    min-width: 180px;
}
@media (max-width: 600px) {
    .formpage-actions {
        flex-direction: column-reverse;
    }
    .formpage-actions .btn {
        width: 100%;
    }
}

.formpage-success {
    text-align: center;
    padding: 2rem 1.5rem;
}

.formpage-success h2 {
    margin: .5rem 0;
    color: #1a8e5a;
}


/* ===========================================================
   Phase 5a Stage 3.1 — Modern form control redesign
   Overrides the older compact .form-control / .btn rules.
   Targets every input, textarea, and select that uses
   .form-control across the portal — questionnaire, contact
   update, excuse, deferral, registration, sign-in.
   =========================================================== */

:root {
    --field-bg: #ffffff;
    --field-border: #d4d9e1;
    --field-border-hover: #a6afbd;
    --field-border-focus: var(--brand-color);
    --field-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    --field-shadow-focus: 0 0 0 4px color-mix(in srgb, var(--brand-color) 18%, transparent);
    --field-radius: 10px;
    --field-pad-y: .75rem;
    --field-pad-x: 1rem;
}

/* ---------- Labels ---------- */
.form-label,
.qrow-label > strong,
.qsection-instructions strong {
    color: #1f2937;
}

.form-label {
    display: block;
    margin-bottom: .45rem;
    font-weight: 600;
    font-size: .95rem;
    color: #1f2937;
    letter-spacing: -.005em;
}

/* ---------- Form row spacing ---------- */
.form-row {
    margin-bottom: 1.25rem;
}

/* ---------- Inputs / textareas / selects ---------- */
input.form-control,
select.form-control,
textarea.form-control,
.qrow-input input[type='text'],
.qrow-input input[type='email'],
.qrow-input input[type='tel'],
.qrow-input input[type='number'],
.qrow-input input[type='date'],
.qrow-input select,
.qrow-input textarea {
    width: 100%;
    min-height: 48px;
    padding: var(--field-pad-y) var(--field-pad-x);
    background: var(--field-bg);
    border: 1.5px solid var(--field-border);
    border-radius: var(--field-radius);
    font-size: 1rem;
    font-family: inherit;
    color: #1f2937;
    line-height: 1.4;
    box-shadow: var(--field-shadow);
    transition: border-color .18s ease,
                box-shadow .18s ease,
                background-color .18s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

textarea.form-control,
.qrow-input textarea {
    min-height: 120px;
    line-height: 1.55;
    resize: vertical;
}

/* Custom dropdown arrow for selects */
select.form-control,
.qrow-input select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'><path d='M5 7.5L10 12.5L15 7.5' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right .9rem center;
    background-size: 18px 18px;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* Placeholder color */
input.form-control::placeholder,
textarea.form-control::placeholder,
.qrow-input input::placeholder,
.qrow-input textarea::placeholder {
    color: #9aa3b2;
    opacity: 1;
}

/* Hover */
input.form-control:hover:not(:focus):not(:disabled):not([readonly]),
select.form-control:hover:not(:focus):not(:disabled),
textarea.form-control:hover:not(:focus):not(:disabled):not([readonly]),
.qrow-input input:hover:not(:focus):not(:disabled):not([readonly]),
.qrow-input select:hover:not(:focus):not(:disabled),
.qrow-input textarea:hover:not(:focus):not(:disabled):not([readonly]) {
    border-color: var(--field-border-hover);
}

/* Focus */
input.form-control:focus,
select.form-control:focus,
textarea.form-control:focus,
.qrow-input input:focus,
.qrow-input select:focus,
.qrow-input textarea:focus {
    outline: none;
    border-color: var(--field-border-focus);
    box-shadow: var(--field-shadow-focus);
    background: #fff;
}

/* Read-only & disabled */
input.form-control[readonly],
.qrow-input input[readonly] {
    background: #f3f4f7;
    color: #6b7280;
    cursor: not-allowed;
    box-shadow: none;
}

input.form-control:disabled,
select.form-control:disabled,
textarea.form-control:disabled {
    background: #f3f4f7;
    color: #9aa3b2;
    cursor: not-allowed;
    border-color: #e5e7eb;
    box-shadow: none;
}

/* Date / number sized constraint inputs — still respect the new height */
.qrow-input .date-input,
.qrow-input .number-input,
input[type='date'].form-control,
input[type='number'].form-control {
    min-height: 48px;
}

/* Sized variants used on the questionnaire (date / number show in-line) */
.qrow-input .date-input { width: 240px; max-width: 100%; }
.qrow-input .number-input { width: 220px; max-width: 100%; }
.qrow-inline .qrow-input .date-input,
.qrow-inline .qrow-input .number-input { width: 240px; }

/* Char counter spacing */
.char-counter {
    color: #6b7280;
    font-size: .8rem;
    margin-top: .4rem;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 48px;
    padding: .8rem 1.5rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -.005em;
    border: 1.5px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform .12s ease,
                box-shadow .18s ease,
                background-color .18s ease,
                border-color .18s ease,
                color .18s ease;
    user-select: none;
    box-shadow: 0 1px 2px rgba(15,23,42,0.06);
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-color) 22%, transparent),
                0 1px 2px rgba(15,23,42,0.06);
}

.btn:disabled,
.btn[disabled] {
    opacity: .55;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Primary */
.btn-primary {
    background: linear-gradient(180deg,
                color-mix(in srgb, var(--brand-color) 96%, white) 0%,
                var(--brand-color) 60%,
                color-mix(in srgb, var(--brand-color) 88%, black) 100%);
    color: #fff;
    border-color: color-mix(in srgb, var(--brand-color) 92%, black);
    box-shadow: 0 2px 6px color-mix(in srgb, var(--brand-color) 28%, transparent),
                inset 0 1px 0 rgba(255,255,255,0.18);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px color-mix(in srgb, var(--brand-color) 32%, transparent),
                inset 0 1px 0 rgba(255,255,255,0.20);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 3px color-mix(in srgb, var(--brand-color) 22%, transparent);
}

/* Secondary */
.btn-secondary {
    background: #ffffff;
    color: #1f2937;
    border-color: var(--field-border);
}

.btn-secondary:hover:not(:disabled) {
    background: #f9fafb;
    border-color: var(--field-border-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(15,23,42,0.08);
}

.btn-secondary:active:not(:disabled) {
    transform: translateY(0);
    background: #f3f4f7;
}

/* Make form action buttons fill more comfortably */
.formpage-actions .btn,
.qactions .btn {
    min-width: 200px;
    padding-left: 1.75rem;
    padding-right: 1.75rem;
}

/* ---------- Checkboxes (signature acknowledgments) ---------- */
.signature-check input[type='checkbox'],
input[type='checkbox'].form-check {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    accent-color: var(--brand-color);
    flex-shrink: 0;
}

/* ---------- Radios on the questionnaire ---------- */
.yesno-option input[type='radio'],
.radio-option input[type='radio'] {
    width: 20px;
    height: 20px;
    accent-color: var(--brand-color);
}

.yesno-option,
.radio-option {
    padding: .35rem .65rem;
    border-radius: 8px;
    transition: background-color .15s ease;
    cursor: pointer;
}

.yesno-option:hover,
.radio-option:hover {
    background: rgba(15,23,42,0.04);
}

/* ---------- Card padding bump on form pages ---------- */
.formpage-card {
    padding: 1.75rem 1.75rem 1.5rem;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(15,23,42,0.06),
                0 1px 2px rgba(15,23,42,0.04);
    border: 1px solid #eef0f4;
}

.formpage-section-title {
    margin-top: 1.75rem;
    font-size: .85rem;
    color: #6b7280;
    letter-spacing: .09em;
    text-transform: uppercase;
    font-weight: 700;
    border-bottom: 1px solid #eef0f4;
    padding-bottom: .55rem;
    margin-bottom: 1rem;
}

/* ---------- Notes / hints ---------- */
.formpage-hint {
    color: #6b7280;
    font-size: .85rem;
    margin-top: .4rem;
    line-height: 1.5;
}

.formpage-note {
    background: linear-gradient(180deg, #fffaeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    border-left-width: 4px;
    border-left-color: #d97706;
    border-radius: 10px;
    padding: .9rem 1.1rem;
    margin: 1.25rem 0;
    color: #78350f;
    font-size: .9rem;
    line-height: 1.55;
}

/* ---------- Alerts ---------- */
.alert {
    padding: .85rem 1.1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: .95rem;
    line-height: 1.5;
    border: 1px solid transparent;
}

.alert-error {
    background: linear-gradient(180deg, #fff1f0 0%, #fee2e2 100%);
    border-color: #fecaca;
    color: #7f1d1d;
}


/* "Confirmation will be sent to" fact strip on excuse / deferral forms */
.formpage-emailfact {
    background: linear-gradient(180deg, #f6f9ff 0%, #eef4ff 100%);
    border: 1px solid #d6e1f5;
    border-radius: 10px;
    padding: .75rem 1rem;
}
.formpage-emailfact-label {
    font-size: .78rem;
    color: #4b5b78;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-weight: 700;
    margin-bottom: .15rem;
}
.formpage-emailfact-value {
    color: #1f2937;
    font-weight: 600;
    font-size: 1rem;
    word-break: break-all;
}


/* ============================================================
   File upload widget — used on RequestExcuse / RequestDeferral
   ============================================================ */

.filedrop {
    position: relative;
    display: block;
    border: 2px dashed #c8d2e5;
    border-radius: 12px;
    padding: 1.5rem 1rem;
    background: linear-gradient(180deg, #fafbff 0%, #f3f6fc 100%);
    transition: border-color .15s ease, background .15s ease;
    cursor: pointer;
}
.filedrop:hover {
    border-color: #5b6fd6;
    background: #f0f4ff;
}
.filedrop-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.filedrop-cue {
    display: flex;
    align-items: center;
    gap: .85rem;
    pointer-events: none;
}
.filedrop-cue-icon {
    font-size: 1.85rem;
    line-height: 1;
}
.filedrop-cue-text {
    flex: 1;
    color: #1f2937;
    font-size: .95rem;
}

/* List of selected/scanned files */
.filelist {
    list-style: none;
    margin: .65rem 0 0 0;
    padding: 0;
}
.filelist-row {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .55rem .75rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: .4rem;
    font-size: .92rem;
}
.filelist-row-clean    { border-color: #bbf7d0; background: #f0fdf4; }
.filelist-row-infected { border-color: #fecaca; background: #fef2f2; }
.filelist-row-error    { border-color: #fed7aa; background: #fffbeb; }

.filelist-icon {
    font-size: 1.1rem;
    line-height: 1;
}
.filelist-name {
    flex: 1;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.filelist-size {
    color: #6b7280;
    font-size: .85rem;
    font-variant-numeric: tabular-nums;
}
.filelist-status {
    color: #4b5563;
    font-size: .85rem;
    font-style: italic;
}
.filelist-row-clean    .filelist-status { color: #166534; font-style: normal; font-weight: 600; }
.filelist-row-infected .filelist-status { color: #991b1b; font-style: normal; font-weight: 600; }
.filelist-row-error    .filelist-status { color: #b45309; font-style: normal; font-weight: 600; }

.filelist-remove {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 1.35rem;
    line-height: 1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.filelist-remove:hover {
    background: #fee2e2;
    color: #b91c1c;
}

/* Result block on the success page */
.filelist-result {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    text-align: left;
}
.filelist-result-title {
    font-weight: 700;
    color: #1f2937;
    margin-bottom: .5rem;
    font-size: .95rem;
}


/* ============================================================
   First-time visitor CTA on Login page
   Primary card above the email/password form
   ============================================================ */
.first-time-cta {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.25rem;
    margin: 0 0 1rem;
    text-decoration: none;
    border-radius: 12px;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--brand-color) 92%, black) 0%,
        var(--brand-color) 60%,
        color-mix(in srgb, var(--brand-color) 88%, white) 100%);
    color: var(--header-text-color, #fff);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    border: 2px solid transparent;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
    position: relative;
    overflow: hidden;
}

.first-time-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top right,
        rgba(255, 255, 255, 0.18) 0%,
        transparent 60%);
    pointer-events: none;
}

.first-time-cta:hover,
.first-time-cta:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
    border-color: rgba(255, 255, 255, 0.35);
    text-decoration: none;
    color: var(--header-text-color, #fff);
    outline: none;
}

.first-time-cta:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.first-time-cta-text {
    flex: 1 1 auto;
    min-width: 0;
}

.first-time-cta-eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.85;
    margin-bottom: 0.15rem;
}

.first-time-cta-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.2rem;
}

.first-time-cta-sub {
    font-size: 0.85rem;
    opacity: 0.92;
    line-height: 1.4;
}

.first-time-cta-arrow {
    flex: 0 0 auto;
    font-size: 1.75rem;
    line-height: 1;
    font-weight: 700;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    transition: transform .15s ease, background .15s ease;
}

.first-time-cta:hover .first-time-cta-arrow,
.first-time-cta:focus-visible .first-time-cta-arrow {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.28);
}

/* Make the "or" divider on login more like a section break now */
.login-divider {
    margin: 1.25rem 0 1rem;
}
.login-divider span {
    font-size: 0.78rem;
    color: var(--color-muted, #777);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}


/* ============================================================================
   Reporting instruction card (dashboard)

   This REPLACES the summons card when staff have published an instruction, so
   it has to carry the whole message on its own. Designed for a stressed person
   reading once, on a phone:
     - the verdict (report / do not report) is the largest thing on screen
     - one date, stated in full, no relative "in 2 days" wording to misread
     - no address or directions on a DO NOT REPORT card -- nothing that hints
       at travelling
   Colour is never the only signal; the wording says it too, for colour-blind
   users and anyone printing in mono.
   ============================================================================ */
.ri-card {
    padding: 0;
    overflow: hidden;
    margin-bottom: var(--space-4);
    border: 2px solid var(--ri-accent);
}

.ri-card-report {
    --ri-accent: #1a7f37;
    --ri-tint: rgba(26, 127, 55, 0.06);
}

.ri-card-dnr {
    --ri-accent: #b3261e;
    --ri-tint: rgba(179, 38, 30, 0.06);
}

html[data-theme="dark"] .ri-card-report {
    --ri-accent: #2f9e4f;
    --ri-tint: rgba(74, 222, 128, 0.10);
}

html[data-theme="dark"] .ri-card-dnr {
    --ri-accent: #c0392f;
    --ri-tint: rgba(248, 113, 113, 0.10);
}

/* The verdict. Deliberately the loudest element on the page. */
.ri-card-banner {
    background: var(--ri-accent);
    color: #fff;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 0.85rem 1rem;
}

.ri-card-body { padding: var(--space-4); }

.ri-card-verdict {
    text-align: center;
    font-size: 1.15rem;
    color: var(--color-text);
    margin-bottom: var(--space-4);
}

.ri-card-block {
    background: var(--ri-tint);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: var(--space-3);
    margin-bottom: var(--space-3);
    text-align: center;
}

.ri-card-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--color-muted);
    margin-bottom: var(--space-1);
}

.ri-card-date {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--color-text);
}

.ri-card-time {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--ri-accent);
}

.ri-card-place {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text);
}

.ri-card-addr { color: var(--color-text); }

.ri-card-phone {
    margin-top: var(--space-2);
    color: var(--color-text);
}

/* Tap target sized for a thumb, not a mouse. */
.ri-card-directions {
    display: inline-block;
    margin-top: var(--space-3);
    padding: 0.7rem 1.4rem;
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    min-height: 44px;
    line-height: 1.6;
}

.ri-card-directions:hover,
.ri-card-directions:focus { filter: brightness(0.92); color: #fff; }

.ri-card-message {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: var(--space-3);
    margin-bottom: var(--space-3);
    background: var(--color-surface);
    color: var(--color-text);
}

.ri-card-foot {
    font-size: 0.85rem;
    color: var(--color-muted);
    text-align: center;
    padding-top: var(--space-2);
    border-top: 1px solid var(--color-border);
}

@media (max-width: 30rem) {
    .ri-card-banner { font-size: 1rem; letter-spacing: 0.04em; }
    .ri-card-date   { font-size: 1.3rem; }
    .ri-card-time   { font-size: 1.9rem; }
}

/* ============================================================================
   Print

   Jurors get asked by employers to prove what the court told them. Without this
   the browser prints the nav, the action cards and the footer, and drops the
   colour that carries the whole message -- producing something that proves
   nothing. This makes the instruction card the printed page.
   ============================================================================ */
@media print {
    /* Chrome the juror doesn't need on paper. */
    header, nav, footer,
    .dashboard-hero,
    .dashboard-section-title,
    .dashboard-grid,
    .ri-noprint {
        display: none !important;
    }

    /* Browsers strip backgrounds by default -- but the red/green banner IS the
       message here, so force it. Without this a DO NOT REPORT prints as plain
       text and loses its urgency entirely. */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 12pt;
    }

    /* Keep the card whole -- a verdict split across two sheets is worse than
       useless. */
    #ri-card {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none !important;
        margin: 0 !important;
    }

    /* A URL after every link is noise on a printed instruction. */
    a[href]::after { content: "" !important; }

    @page { margin: 1.5cm; }
}

/* ============================================================================
   Reduced motion — respect the OS setting.
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
