﻿/* =========================================================================
   Waqf E-Services form design system
   Mobile first, RTL. Scoped under .wq-page so it never leaks into the
   existing Bootstrap 4 / DevExtreme screens.
   ========================================================================= */

.wq-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 16px 12px 32px;
    color: var(--wq-ink);
    font-family: var(--wq-font);
    -webkit-text-size-adjust: 100%;
}

/* ------------------------------- card ---------------------------------- */

.wq-card {
    background: #fff;
    border-radius: var(--wq-radius);
    box-shadow: 0 4px 20px rgba(26, 34, 51, .09), 0 1px 2px rgba(0, 0, 0, .05);
    overflow: hidden;
}

.wq-card__head {
    background: #fff;
    border-bottom: 1px solid var(--wq-line);
    text-align: center;
    padding: 22px 16px 18px;
}

.wq-card__logo {
    width: 170px;
    max-width: 60%;
    height: auto;
    margin-bottom: 12px;
}

.wq-card__title {
    font-size: var(--wq-fs-lg);
    font-weight: 600;
    margin: 0;
    line-height: 1.5;
    color: var(--wq-ink);
}

.wq-card__body {
    padding: 20px 16px 24px;
}

/* ------------------------------ fields --------------------------------- */

.wq-field {
    margin: 0 0 20px;
    border: 0;
    padding: 0;
    min-width: 0; /* fieldset shrink fix */
}

.wq-label {
    display: block;
    float: none; /* legend reset */
    width: auto;
    font-size: var(--wq-fs-md);
    font-weight: 600;
    margin-bottom: 8px;
    padding: 0;
    color: var(--wq-ink);
}

/* Only 400/500/600 of IBM Plex Sans Arabic are loaded, so anything asking for
   700 gets synthesised fake bold. Cap emphasis at 600 across the form. */
.wq-page strong,
.wq-page b {
    font-weight: 600;
}

.wq-req {
    color: var(--wq-danger);
    margin-inline-start: 3px;
    font-weight: 600;
}

.wq-input {
    display: block;
    width: 100%;
    min-height: 48px; /* comfortable touch target */
    padding: 10px 14px;
    font-size: var(--wq-fs-base); /* 1rem = 16px: stops iOS Safari zooming on focus */
    font-family: inherit;
    line-height: 1.5;
    color: var(--wq-ink);
    background: #fff;
    border: 1px solid var(--wq-line);
    border-radius: 10px;
    transition: border-color .15s ease, box-shadow .15s ease;
    -webkit-appearance: none;
    appearance: none;
}

    .wq-input::placeholder {
        color: #a7aebd;
    }

    .wq-input:focus {
        outline: none;
        border-color: var(--wq-ink);
        box-shadow: 0 0 0 3px rgba(26, 34, 51, .13);
    }

    .wq-input[readonly], .wq-input:disabled {
        background: var(--wq-tint);
        color: var(--wq-muted);
    }

.wq-input--numeric {
    direction: ltr;
    text-align: right;
    letter-spacing: .04em;
}

.wq-input--latin {
    direction: ltr;
    text-align: left;
}

.wq-field--last {
    margin-bottom: 0;
}

/* Two-up field rows on long forms. Stays single column on phones. */
.wq-grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0 16px;
}

@media (min-width: 640px) {
    .wq-grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ------------------------------- date field ---------------------------- */
/* Three boxes instead of a character mask: the structure is visible before
   the user types, and backspace behaves normally inside each box. */

.wq-date {
    background: #fcfcfd;
    border: 1px solid var(--wq-line);
    border-radius: var(--wq-radius);
    padding: 14px 12px 12px;
}

.wq-date__grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.6fr;
    gap: 10px;
}

.wq-date__part label {
    display: block;
    font-size: var(--wq-fs-xs);
    font-weight: 500;
    color: var(--wq-muted);
    margin-bottom: 3px;
}

.wq-date__part .wq-input {
    min-height: 46px;
    padding: 8px 10px;
    text-align: center;
    direction: ltr;
    letter-spacing: .08em;
}

    .wq-date__part .wq-input::placeholder {
        letter-spacing: .12em;
        color: #c2c8d2;
    }

/* One-time code: short, centred, spaced so each digit is easy to check. */
.wq-code {
    direction: ltr;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: .5em;
    text-indent: .5em; /* balances the trailing letter-spacing */
    padding-inline: 12px;
}

/* Trailing detail inside a note (e.g. the masked phone number). */
.wq-note__aside {
    display: block;
    margin-top: 4px;
    direction: ltr;
    text-align: center;
    font-weight: 600;
}

/* Password field with a show/hide button sitting inside the input. */
.wq-reveal {
    position: relative;
}

    .wq-reveal .wq-input {
        padding-inline-end: 46px;
    }

.wq-reveal__btn {
    position: absolute;
    inset-inline-end: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--wq-muted);
    cursor: pointer;
}

    .wq-reveal__btn:hover {
        color: var(--wq-ink);
    }

    .wq-reveal__btn:focus-visible {
        outline: 2px solid rgba(26, 34, 51, .35);
        outline-offset: 1px;
    }

/* Secondary links under a form (forgot password, register). */
.wq-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--wq-line);
}

    .wq-links a {
        color: var(--wq-muted);
        font-size: var(--wq-fs-sm);
        text-decoration: none;
    }

        .wq-links a:hover {
            color: var(--wq-ink);
            text-decoration: underline;
        }

/* Native <select>. The arrow is drawn as a background SVG because the browser
   default cannot be styled; padding-inline-end keeps text clear of it. */
.wq-select {
    padding-inline-end: 38px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%231a2233' stroke-width='2' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    background-size: 12px 8px;
}

    .wq-select::-ms-expand {
        display: none;
    }

.wq-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.8;
}

/* Radio / checkbox rendered as full-width tappable rows — far easier to hit on
   a phone than a bare 13px native control. */
.wq-choices {
    display: grid;
    gap: 8px;
}

.wq-choice {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--wq-line);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: var(--wq-fs-sm);
    transition: border-color .15s ease, background-color .15s ease;
}

    .wq-choice:hover {
        border-color: var(--wq-ink);
    }

    .wq-choice input {
        flex: none;
        width: 18px;
        height: 18px;
        accent-color: var(--wq-ink);
        margin: 0;
    }

    .wq-choice:has(input:checked) {
        border-color: var(--wq-ink);
        background: var(--wq-tint);
        font-weight: 500;
    }

    .wq-choice:has(input:focus-visible) {
        box-shadow: 0 0 0 3px rgba(26, 34, 51, .13);
    }

/* Rows revealed by another control (e.g. "صرفية محددة" picks a payment). */
.wq-conditional[hidden] {
    display: none;
}

/* File picker. Native buttons cannot be restyled directly, so the control is
   given the same box as .wq-input and ::file-selector-button is themed. */
.wq-file {
    display: block;
    width: 100%;
    padding: 9px 12px;
    font-family: inherit;
    font-size: var(--wq-fs-sm);
    color: var(--wq-ink);
    background: #fff;
    border: 1px dashed var(--wq-tint-line);
    border-radius: 10px;
    cursor: pointer;
}

    .wq-file::file-selector-button {
        font-family: inherit;
        font-size: var(--wq-fs-xs);
        font-weight: 500;
        color: #fff;
        background: var(--wq-ink);
        border: 0;
        border-radius: 8px;
        padding: 8px 14px;
        margin-inline-end: 10px;
        cursor: pointer;
    }

    .wq-file:hover {
        border-color: var(--wq-ink);
    }

    .wq-file:focus {
        outline: none;
        border-color: var(--wq-ink);
        box-shadow: 0 0 0 3px rgba(26, 34, 51, .13);
    }

    .wq-file.is-invalid {
        border-color: var(--wq-danger);
        border-style: solid;
        background: var(--wq-danger-soft);
    }

/* Optional, off by default — set FullNameFieldOptions.Hint to use it. */
.wq-help {
    display: block;
    margin-top: 6px;
    font-size: var(--wq-fs-xs);
    color: var(--wq-muted);
    line-height: 1.6;
}

.wq-error {
    display: block;
    margin-top: 6px;
    font-size: var(--wq-fs-xs);
    color: var(--wq-danger);
    font-weight: 500;
}

    .wq-error:empty {
        display: none;
    }

.wq-input.is-invalid {
    border-color: var(--wq-danger);
    background: var(--wq-danger-soft);
}

    .wq-input.is-invalid:focus {
        box-shadow: 0 0 0 3px rgba(192, 57, 43, .15);
    }

.wq-input.is-valid {
    border-color: var(--wq-tint-line);
}

/* ---------------------------- full name -------------------------------- */

.wq-name {
    background: #fcfcfd;
    border: 1px solid var(--wq-line);
    border-radius: var(--wq-radius);
    padding: 14px 12px 12px;
}

/* Phones get one input per row: Arabic names are long, and anything narrower
   than a full row clips them. Wider screens tighten up progressively. */
.wq-name__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}

.wq-name__part label {
    display: block;
    font-size: var(--wq-fs-xs);
    font-weight: 500;
    color: var(--wq-muted);
    margin-bottom: 3px;
}

.wq-name__part .wq-input {
    min-height: 46px;
    padding: 8px 12px;
    text-align: center;
}

/* live assembly of the four parts */
.wq-name__preview {
    margin-top: 12px;
    background: var(--wq-tint);
    border: 1px dashed var(--wq-tint-line);
    border-radius: 10px;
    padding: 12px;
    min-height: 48px;
    display: flex;
    align-items: center;
}

.wq-name__preview-value {
    font-size: var(--wq-fs-base);
    font-weight: 600;
    color: var(--wq-ink);
    line-height: 1.7;
    word-break: break-word;
}

.wq-name__ghost {
    color: #a7aebd;
    font-weight: 400;
    border-bottom: 1px dashed #a7aebd;
}

.wq-name__preview.is-complete {
    border-style: solid;
    border-color: var(--wq-ink);
    background: #fff;
}

/* ------------------------------ notice --------------------------------- */

.wq-note {
    background: var(--wq-tint);
    border: 1px solid var(--wq-line);
    border-inline-start: 4px solid var(--wq-ink);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: var(--wq-fs-sm);
    line-height: 1.8;
    color: var(--wq-ink);
    margin: 0 0 20px;
}

    .wq-note p:last-child {
        margin-bottom: 0;
    }

/* Long legal wording (e.g. the نظارة consent text) inside a .wq-note. */
.wq-legal p {
    margin: 0 0 10px;
    text-align: justify;
}

.wq-summary {
    background: var(--wq-danger-soft);
    border: 1px solid #f2c4bd;
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--wq-danger);
    font-size: var(--wq-fs-sm);
    margin-bottom: 20px;
}

    .wq-summary ul {
        margin: 0;
        padding-inline-start: 18px;
    }

    .wq-summary:empty, .wq-summary.validation-summary-valid {
        display: none;
    }

/* ------------------------------ divider -------------------------------- */

.wq-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--wq-fs-md);
    font-weight: 600;
    color: var(--wq-ink);
    margin: 26px 0 14px;
}

    .wq-section-title::after {
        content: "";
        flex: 1;
        height: 1px;
        background: var(--wq-line);
    }

/* ---------------------- optional / disclosure -------------------------- */

.wq-details {
    border: 1px solid var(--wq-line);
    border-radius: 10px;
    margin-bottom: 20px;
    background: #fcfcfd;
}

.wq-details__summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    font-size: var(--wq-fs-md);
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    min-height: 48px;
    color: var(--wq-ink);
}

    .wq-details__summary::-webkit-details-marker {
        display: none;
    }

    .wq-details__summary::before {
        content: "";
        width: 8px;
        height: 8px;
        border-inline-start: 2px solid var(--wq-ink);
        border-bottom: 2px solid var(--wq-ink);
        transform: rotate(45deg);
        transition: transform .2s ease;
        flex: none;
    }

.wq-details[open] > .wq-details__summary::before {
    transform: rotate(-135deg);
}

.wq-details__body {
    padding: 0 16px 16px;
}

/* Reference image inside a disclosure (e.g. the IBAN certificate sample). */
.wq-sample-img {
    display: block;
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
    height: auto;
    border: 1px solid var(--wq-line);
    border-radius: 8px;
}

/* ----------------------------- signature ------------------------------- */

.wq-sign {
    border: 1px solid var(--wq-line);
    border-radius: 10px;
    background: #fff;
    padding: 8px;
    position: relative;
    touch-action: none; /* let the pad own the gesture */
}

.wq-sign__canvas {
    display: block;
    width: 100%;
    height: 170px;
    border-radius: 6px;
    background: repeating-linear-gradient(0deg, #fff, #fff 33px, var(--wq-tint) 34px);
    cursor: crosshair;
}

.wq-sign__hint {
    position: absolute;
    inset-inline-start: 0;
    inset-inline-end: 0;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
    color: #b3bac7;
    font-size: var(--wq-fs-sm);
    pointer-events: none;
    transition: opacity .2s;
}

.wq-sign.is-signed .wq-sign__hint {
    opacity: 0;
}

.wq-sign__bar {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

/* ------------------------------ buttons -------------------------------- */

.wq-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 22px;
    font-family: inherit;
    font-size: var(--wq-fs-base);
    font-weight: 600;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color .15s ease, box-shadow .15s ease, transform .05s ease;
    -webkit-appearance: none;
    appearance: none;
}

    .wq-btn:active {
        transform: translateY(1px);
    }

    .wq-btn:focus-visible {
        outline: 3px solid rgba(26, 34, 51, .3);
        outline-offset: 2px;
    }

.wq-btn--primary {
    background: var(--wq-ink);
    color: #fff;
    width: 100%;
    box-shadow: 0 2px 8px rgba(26, 34, 51, .22);
}

    .wq-btn--primary:hover {
        background: var(--wq-ink-hover);
        color: #fff;
    }

.wq-btn--ghost {
    background: #fff;
    color: var(--wq-muted);
    border-color: var(--wq-line);
    min-height: 40px;
    padding: 8px 16px;
    font-size: var(--wq-fs-sm);
    font-weight: 500;
}

    .wq-btn--ghost:hover {
        background: var(--wq-tint);
        color: var(--wq-ink);
    }

.wq-actions {
    margin-top: 26px;
}

/* --------------------------- larger screens ---------------------------- */

/* Large phones / small tablets: a clean 2x2, no orphan cell. */
@media (min-width: 520px) {
    .wq-name__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 720px) {
    .wq-page {
        padding: 28px 16px 48px;
    }

    .wq-card__body {
        padding: 28px 32px 32px;
    }

    .wq-card__title {
        font-size: var(--wq-fs-xl);
    }

    .wq-name__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .wq-btn--primary {
        width: auto;
        min-width: 220px;
    }

    .wq-actions {
        display: flex;
        justify-content: center;
    }
}

/* --------------------------- confirmation ------------------------------ */

.wq-done {
    text-align: center;
    padding: 8px 0 4px;
}

.wq-done__mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--wq-ink);
    color: #fff;
    font-size: 1.9rem;
    line-height: 1;
}

.wq-done__title {
    font-size: var(--wq-fs-lg);
    font-weight: 600;
    color: var(--wq-ink);
    line-height: 1.7;
    margin: 0 0 24px;
}

/* ===================== Admin list screens (staff) =======================
   Same tokens as the public forms. Replaces the Tailwind Play CDN, which
   compiled CSS in the browser by scanning every DOM node on load.
   ======================================================================== */

.wq-admin {
    max-width: 1240px;
    margin: 0 auto;
    padding: 20px 16px 48px;
    font-family: var(--wq-font);
    color: var(--wq-ink);
}

.wq-admin__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.wq-admin__title {
    font-size: var(--wq-fs-lg);
    font-weight: 600;
    margin: 0;
}

.wq-admin__group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wq-count {
    background: var(--wq-tint);
    border: 1px solid var(--wq-line);
    color: var(--wq-ink);
    font-size: var(--wq-fs-sm);
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
    white-space: nowrap;
}

/* ------------------------------- toolbar ------------------------------- */

.wq-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.wq-toolbar__search {
    flex: 1 1 260px;
    min-width: 0;
}

/* -------------------------------- table -------------------------------- */

.wq-panel {
    background: #fff;
    border: 1px solid var(--wq-line);
    border-radius: var(--wq-radius);
    overflow: hidden;
}

.wq-tablewrap {
    overflow-x: auto;
}

.wq-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--wq-fs-sm);
}

    .wq-table thead th {
        background: var(--wq-ink);
        color: #fff;
        font-weight: 600;
        font-size: var(--wq-fs-xs);
        text-align: start;
        padding: 12px 14px;
        white-space: nowrap;
    }

    .wq-table tbody td {
        padding: 12px 14px;
        border-top: 1px solid var(--wq-line);
        vertical-align: middle;
    }

    .wq-table tbody tr:hover {
        background: var(--wq-tint);
    }

.wq-table__name {
    font-weight: 600;
    white-space: nowrap;
}

.wq-table__muted {
    color: var(--wq-muted);
    font-size: var(--wq-fs-xs);
}

.wq-table__empty {
    text-align: center;
    color: var(--wq-muted);
    padding: 40px 16px;
}

.wq-table__actions {
    display: flex;
    gap: 6px;
    justify-content: flex-start;
    white-space: nowrap;
}

/* -------------------------------- badge -------------------------------- */

.wq-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: var(--wq-fs-xs);
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid var(--wq-tint-line);
    background: var(--wq-tint);
    color: var(--wq-ink);
}

.wq-badge--solid {
    background: var(--wq-ink);
    border-color: var(--wq-ink);
    color: #fff;
}

.wq-badge--danger {
    background: var(--wq-danger-soft);
    border-color: #f2c4bd;
    color: var(--wq-danger);
}

.wq-badge--quiet {
    background: #fff;
    color: var(--wq-muted);
}

/* ------------------------------ small button --------------------------- */

/* Also cancels the full-width/min-width sizing --primary carries, so a small
   button stays small whichever variant it is paired with. */
.wq-btn--sm {
    min-height: 34px;
    padding: 6px 12px;
    font-size: var(--wq-fs-xs);
    font-weight: 500;
    border-radius: 8px;
    width: auto;
    min-width: 0;
}

.wq-btn--danger {
    background: var(--wq-danger);
    color: #fff;
}

    .wq-btn--danger:hover {
        background: #96291d;
        color: #fff;
    }

/* Demoted destructive action: reads as secondary but keeps the red signal. */
.wq-btn--ghost-danger {
    background: #fff;
    color: var(--wq-danger);
    border-color: var(--wq-line);
}

    .wq-btn--ghost-danger:hover {
        background: var(--wq-danger-soft);
        border-color: var(--wq-danger);
        color: var(--wq-danger);
    }

.wq-btn[disabled] {
    opacity: .45;
    cursor: not-allowed;
}

/* -------------------------------- pager -------------------------------- */

.wq-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid var(--wq-line);
    border-radius: var(--wq-radius);
}

.wq-pager__nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wq-pager__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--wq-line);
    border-radius: 8px;
    color: var(--wq-ink);
    background: #fff;
    text-decoration: none;
    font-size: var(--wq-fs-sm);
}

    .wq-pager__link:hover {
        border-color: var(--wq-ink);
        color: var(--wq-ink);
        text-decoration: none;
    }

    .wq-pager__link.is-disabled {
        opacity: .4;
        pointer-events: none;
    }

.wq-pager__state {
    font-size: var(--wq-fs-sm);
    color: var(--wq-muted);
}

.wq-pager__size {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--wq-fs-xs);
    color: var(--wq-muted);
}

    .wq-pager__size select {
        min-height: 34px;
        padding: 4px 8px;
        font-family: inherit;
        font-size: var(--wq-fs-xs);
        border: 1px solid var(--wq-line);
        border-radius: 8px;
        background: #fff;
        color: var(--wq-ink);
    }

/* -------------------------------- banner ------------------------------- */

.wq-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px 16px;
    background: var(--wq-tint);
    border: 1px solid var(--wq-tint-line);
    border-inline-start: 4px solid var(--wq-ink);
    border-radius: 10px;
    font-size: var(--wq-fs-sm);
    font-weight: 500;
    cursor: pointer;
}

    .wq-banner[hidden] {
        display: none;
    }

/* -------------------------------- modal -------------------------------- */

.wq-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(26, 34, 51, .55);
    overflow-y: auto;
    padding: 24px 16px;
}

    .wq-modal[hidden] {
        display: none;
    }

.wq-modal__card {
    background: #fff;
    border-radius: var(--wq-radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
    max-width: 520px;
    margin: 40px auto;
    overflow: hidden;
}

.wq-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    background: var(--wq-ink);
    color: #fff;
}

    .wq-modal__head h3 {
        margin: 0;
        font-size: var(--wq-fs-md);
        font-weight: 600;
        color: #fff;
    }

.wq-modal__close {
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.wq-modal__body {
    padding: 18px 20px;
}

.wq-modal__facts {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
    padding: 14px;
    background: var(--wq-tint);
    border-radius: 10px;
}

.wq-fact {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: var(--wq-fs-sm);
}

    .wq-fact span:first-child {
        color: var(--wq-muted);
    }

    .wq-fact span:last-child {
        font-weight: 600;
    }

.wq-modal__foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    background: var(--wq-tint);
    border-top: 1px solid var(--wq-line);
}

    .wq-modal__foot .wq-btn--primary {
        width: auto;
        min-width: 0;
    }

/* -------------------------------- toast -------------------------------- */

.wq-toast {
    position: fixed;
    top: 74px;
    inset-inline-end: 16px;
    z-index: 1100;
    padding: 12px 18px;
    border-radius: 10px;
    background: var(--wq-ink);
    color: #fff;
    font-family: var(--wq-font);
    font-size: var(--wq-fs-sm);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
    transition: opacity .3s ease;
}

.wq-toast--error {
    background: var(--wq-danger);
}

@media (max-width: 640px) {
    .wq-admin__bar, .wq-pager {
        flex-direction: column;
        align-items: stretch;
    }

    .wq-pager__nav {
        justify-content: center;
    }
}

/* ========================= Services portal (Index) =======================
   Same tokens as the forms, so the landing page and the form it opens read
   as one product.
   ======================================================================== */

.wq-portal {
    font-family: var(--wq-font);
    background: var(--wq-tint);
    min-height: 100vh;
    color: var(--wq-ink);
}

.wq-portal__header {
    text-align: center;
    padding: 44px 20px 36px;
    background: #fff;
    border-bottom: 1px solid var(--wq-line);
}

.wq-portal__logo {
    height: 72px;
    width: auto;
    display: block;
    margin: 0 auto 14px;
}

.wq-portal__rule {
    display: block;
    width: 64px;
    height: 3px;
    border-radius: 3px;
    margin: 0 auto 16px;
    background: var(--wq-ink);
}

.wq-portal__header h1 {
    margin: 0;
    font-weight: 600;
    font-size: clamp(1.5rem, 4vw, 2.1rem);
    color: var(--wq-ink);
}

.wq-portal__header p {
    margin: 8px auto 0;
    color: var(--wq-muted);
    font-size: var(--wq-fs-md);
}

.wq-portal__main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 16px 64px;
}

.wq-portal__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.wq-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
    padding: 26px 16px 22px;
    background: #fff;
    border: 1px solid var(--wq-line);
    border-radius: var(--wq-radius, 14px);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

    .wq-tile::before {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        height: 3px;
        background: var(--wq-ink);
        transform: scaleX(0);
        transition: transform .25s ease;
    }

    .wq-tile:hover, .wq-tile:focus-visible {
        transform: translateY(-3px);
        border-color: var(--wq-ink);
        box-shadow: 0 8px 22px rgba(26, 34, 51, .12);
        color: inherit;
        text-decoration: none;
        outline: none;
    }

        .wq-tile:hover::before, .wq-tile:focus-visible::before {
            transform: scaleX(1);
        }

    .wq-tile:focus-visible {
        box-shadow: 0 0 0 3px rgba(26, 34, 51, .25), 0 8px 22px rgba(26, 34, 51, .12);
    }

.wq-tile__num {
    font-size: var(--wq-fs-xs);
    font-weight: 500;
    color: var(--wq-muted);
    margin-bottom: 10px;
}

.wq-tile__icon {
    width: 62px;
    height: 62px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    font-size: 1.6rem;
    color: #fff;
    background: var(--wq-ink);
    transition: transform .2s ease;
}

.wq-tile:hover .wq-tile__icon {
    transform: scale(1.06);
}

.wq-tile__title {
    margin: 0;
    font-weight: 600;
    font-size: var(--wq-fs-md);
    line-height: 1.6;
    color: var(--wq-ink);
    display: flex;
    align-items: center;
    min-height: 3.2em;
}

@media (max-width: 991px) {
    .wq-portal__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .wq-portal__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .wq-tile {
        padding: 20px 10px 16px;
    }

    .wq-tile__icon {
        width: 52px;
        height: 52px;
        font-size: 1.35rem;
    }
}

/* Respect users who ask for less motion */
@media (prefers-reduced-motion: reduce) {
    .wq-btn, .wq-input, .wq-sign__hint, .wq-tile, .wq-tile__icon {
        transition: none;
    }
}
