/* ===========================================================================
 * JUROR PORTAL EXTENSIONS
 *
 * Loaded after site.css. Everything here is either (a) a class the shared
 * design system references but never defines, or (b) a pattern specific to a
 * juror questionnaire that the payments and records apps have no use for.
 *
 * Rule of thumb: if a style would also make sense in CISARKANSAS PAY, it
 * belongs upstream in site.css — not here.
 * ===========================================================================
 */

/* ---------------------------------------------------------------------------
 * Gaps in the shared system.
 * The shared _Layout applies .main-shell but no stylesheet defines it.
 * Reported upstream — defined here so the portal behaves correctly meanwhile.
 * ------------------------------------------------------------------------ */
.main-shell {
    flex: 1 0 auto;
    padding-top: 1.5rem;
    padding-bottom: 2.5rem;
}

/* site.css sets `body { margin-bottom: 60px }` for a fixed footer. This portal
   pins the footer with flexbox instead, so that margin leaves a gap below it. */
body {
    min-height: 100vh;
    margin-bottom: 0;
}

.topbar-title {
    /* Longer than the payments app title; keep it from crowding the logo. */
    line-height: 1.25;
}

.section-title {
    text-align: center;
}

/* ---------------------------------------------------------------------------
 * Empty state
 * Lifted from admin.css, which this portal does not load (it is the back-office
 * design system and collides with site.css on badges, tokens and .btn-danger).
 * ------------------------------------------------------------------------ */
.empty-state {
    text-align: center;
    padding: 3rem 1.25rem;
    color: var(--gray-primary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.3;
}

.empty-state p {
    font-size: 0.9375rem;
    margin: 0;
}

.empty-state .empty-state-hint {
    font-size: 0.8125rem;
    margin-top: 0.5rem;
    opacity: 0.8;
}

/* ---------------------------------------------------------------------------
 * Home page choice cards
 * Two equal-weight entry points. .dashboard-card supplies the hover lift.
 * ------------------------------------------------------------------------ */
.choice-card {
    height: 100%;
    text-decoration: none;
    color: inherit;
    display: block;
}

.choice-card .card-body {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.choice-card i {
    font-size: 2.75rem;
    color: var(--navy-primary);
    display: block;
    margin-bottom: 1rem;
}

.choice-card h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--navy-primary);
    margin-bottom: 0.5rem;
}

.choice-card p {
    font-size: 0.9375rem;
    color: var(--gray-primary);
    margin: 0;
}

/* ---------------------------------------------------------------------------
 * Questionnaire form
 * The form is long. Sections are visually separated so a juror can keep their
 * place, and the section heading doubles as the accessible group label.
 * ------------------------------------------------------------------------ */
.form-section {
    margin-bottom: 1.5rem;
}

.form-section > .card-header {
    text-transform: uppercase;
    font-size: 0.8125rem;
    letter-spacing: 0.05em;
    color: var(--navy-primary);
}

.form-section fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0; /* fieldset defaults to min-content, which breaks flex children */
}

.section-intro {
    font-size: 0.875rem;
    color: var(--gray-dark);
    margin-bottom: 1rem;
}

/* A statutory notice the juror must be shown but does not act on. */
.legal-notice {
    background-color: #f8f9fa;
    border-left: 4px solid var(--navy-primary);
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    color: var(--gray-dark);
    margin-top: 1rem;
}

.legal-notice strong {
    color: var(--navy-primary);
}

/* ---------------------------------------------------------------------------
 * Yes/No qualification rows
 * The radio pair sits left of the statement on a wide screen and below it on a
 * narrow one. Grid rather than float so the columns stay aligned when a
 * statement wraps to three lines.
 * ------------------------------------------------------------------------ */
.qual-row {
    display: grid;
    grid-template-columns: 10rem 1fr;
    gap: 0.5rem 1rem;
    align-items: start;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-light);
}

.qual-row:last-child {
    border-bottom: 0;
}

.qual-row .qual-answers {
    display: flex;
    gap: 1rem;
}

.qual-row .qual-statement {
    font-size: 0.9375rem;
    padding-top: 0.125rem;
}

/* An unanswered required question after a failed submit. */
.qual-row.is-unanswered {
    background-color: rgba(220, 53, 69, 0.05);
}

@media (max-width: 575.98px) {
    .qual-row {
        grid-template-columns: 1fr;
    }

    .qual-row .qual-statement {
        order: -1; /* read the statement before the answers on a phone */
    }
}

/* ---------------------------------------------------------------------------
 * Date lists
 * The vacation and appointment pickers. One row is a date box and the button
 * that removes it; a message about that row spans both columns underneath, so
 * it sits under the box it belongs to rather than beside the button.
 * ------------------------------------------------------------------------ */
.date-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.375rem 0.5rem;
    margin-bottom: 0.5rem;
}

.date-row .date-row-message {
    grid-column: 1 / -1;
}

/* Matched to the input beside it rather than left at .btn's own height, so a
   row does not look like two controls of different sizes. */
.date-row .date-row-remove {
    white-space: nowrap;
}

.date-list-add {
    margin-bottom: 0.5rem;
}

/* ---------------------------------------------------------------------------
 * Report status
 * ------------------------------------------------------------------------ */

/* The expander on a report-date row. Styled as a link rather than a button so
   it does not inherit .btn min-height inside a table cell. */
.expand-toggle {
    background: none;
    border: 0;
    padding: 0.25rem 0.5rem;
    color: var(--accent-blue);
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
}

.expand-toggle:hover {
    color: var(--navy-primary);
    text-decoration: underline;
}

.expand-toggle .bi {
    transition: transform 0.15s ease;
}

.expand-toggle[aria-expanded="true"] .bi {
    transform: rotate(90deg);
}

/* The juror numbers. A wrapped list of fixed-width monospace chips scans far
   faster than a comma-separated paragraph when you are hunting for your own
   number, because the eye can track columns. */
.juror-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
}

.juror-chip {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    min-width: 3.25rem;
    text-align: center;
    padding: 0.25rem 0.5rem;
    background-color: var(--gray-light);
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    color: var(--gray-dark);
}

.juror-panel {
    background-color: #f8f9fa;
}

.juror-panel td {
    padding: 1rem;
}

/* Result count / summary line above a table. */
.result-summary {
    font-size: 0.875rem;
    color: var(--gray-primary);
    margin-bottom: 0.75rem;
}

/* ---------------------------------------------------------------------------
 * County contact block
 * ------------------------------------------------------------------------ */
.county-footer-contact {
    font-size: 0.875rem;
    line-height: 1.5;
    font-style: normal;
}

.validation-message {
    color: #dc3545;
    font-size: 0.875rem;
}

/* The heading above ValidationSummary after a failed submit.
   It exists mainly for a screen reader: the summary is a bare <ul>, and a
   statically rendered form replaces the whole document on a post, so without
   something announced there is nothing at all to say the submit failed. It is
   styled to look deliberate rather than hidden, because a sighted juror
   benefits from the same signal. */
.validation-summary-heading {
    color: #dc3545;
    margin-bottom: 0.25rem;
}

/* ---------------------------------------------------------------------------
 * Print
 * A juror is told to keep their confirmation; drop the chrome, keep the record.
 * ------------------------------------------------------------------------ */
@media print {

    .filter-card,
    .expand-toggle {
        display: none !important;
    }

    .juror-chip {
        border-color: #999;
    }
}

/* ---------------------------------------------------------------------------
 * Validation feedback
 *
 * site.css greens a field on `:valid:not(:placeholder-shown)`. An empty input
 * with no placeholder attribute satisfies both halves, so on a form this long
 * every untouched field renders as though it had been validated — which is
 * exactly backwards, and worst on the fields the juror has yet to reach.
 *
 * Reported upstream. Until it is fixed there, the premature state is neutered
 * and the feedback re-applied through :user-valid / :user-invalid, which fire
 * only after the juror has actually interacted with the field.
 * ------------------------------------------------------------------------ */
.form-control:valid:not(:placeholder-shown),
.form-control:invalid:not(:placeholder-shown) {
    border-color: #dee2e6;
    box-shadow: none;
}

.form-control:user-valid {
    border-color: #28a745;
}

.form-control:user-invalid,
.form-control.is-invalid,
.form-control.invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

/* Blazor stamps these on a field it has validated, which is a stronger signal
   than the browser's own and should win. */
.form-control.modified.valid,
.form-select.modified.valid {
    border-color: #28a745;
}
