/**
 * WCAG 1.4.4 Resize text (IS 5568 / WCAG 2.0 AA)
 * Content must remain readable/usable when resized up to ~200% (browser zoom
 * or text size). Prefer wrapping + auto height over clipping.
 */

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

/* Readable text: wrap instead of clipping */
.pdf-form-page__title,
.form-title,
.hero-title,
.logo-text,
.user-profile-name,
.upload-app__title,
.upload-app__status-line,
.upload-app__instructions-title,
.upload-app__instructions-subtitle,
.upload-app__step-text,
.upload-app__waiting-subline,
.upload-app__progress-text,
.upload-app__email-notify-line,
.wapup-activity-heading,
.wapup-section-title,
.wapup-invite-message,
.footer-widget-title,
.footer-widget-subtitle,
.footer-logo p,
.card-title,
.zero_correspondence_text,
.terms-of-use-modal__title,
.custom-heading-timeframe,
.custom-heading-sorting,
.custom-heading,
.policy-terms-checkbox-text,
.radio-option__text,
.notify_me_text,
.email_updates_text,
.corresspondence_main_title {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    max-width: 100%;
}

/* Header / user chip: allow name to wrap at high zoom */
.header-inner,
.header-user-menu,
.user-login-name,
.user-profile-name {
    min-width: 0;
}

.user-profile-name {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
}

/* Form controls grow with text size instead of fixed clip heights */
.pdf-form-page .form-field__input,
.pdf-form-page .form-control,
.pdf-form-page textarea.form-control,
.pdf-form-page #aiPromptSearchInput,
.btn-common,
.btn-submit,
.upload-app__btn,
.wapup-invite-input,
.wapup-invite-submit,
#wapup_code {
    height: auto !important;
    min-height: 2.75rem;
    line-height: 1.4;
    white-space: normal;
}

.pdf-form-page textarea.form-control,
.pdf-form-page #aiReport {
    min-height: 6rem;
}

.pdf-form-page #aiPromptDisplay,
.pdf-form-page #aiPromptSelectCustom {
    height: auto !important;
    min-height: 2.75rem;
}

/* Cards / panels: don't clip growing text */
.pdf-form-card,
.pdf-form-card__body,
.pdf-form-card__head,
.upload-app__card,
.wapup-panel-card,
.access-panel .access-content {
    overflow: visible;
}

/* Tabs / buttons: allow multi-line labels */
.pdf-form-page .tabs .tab,
.upload-app__instruction-tab,
.header-action-btn,
.header-action-link {
    height: auto !important;
    min-height: 2.5rem;
    white-space: normal;
    align-items: center;
}

/* Lawyer account rows: wrap at narrow/zoomed viewports */
.info-row,
.info-fetch-button,
.wapup-stat-item,
.voucher-meta-label-row {
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
}

.info-row .label,
.info-row .value,
.info-fetch-button .value,
.voucher-code-display-code {
    white-space: normal !important;
    overflow-wrap: anywhere;
}

/* App shell: content can scroll when zoomed */
.upload-app,
.legalpdf-app-shell {
    overflow-x: hidden;
    overflow-y: auto;
}

.upload-app__status-line,
.upload-app__email-notify-line {
    white-space: normal !important;
}

/*
 * Avoid horizontal page lock at ~200% zoom (WCAG 1.4.4).
 * Do NOT set max-width: 100% on .site-wrapper — it shares the class with
 * Bootstrap .container (e.g. /wiki) and would wipe the container max-width.
 */
#mainContent,
#main-content,
.site-wrapper {
    overflow-x: clip;
}
/* Soften fixed icon boxes so they don't dominate at 200% */
@media (min-resolution: 1.25dppx) {
    .pdf-form-page .tabs .tab .icon img {
        max-width: 1.25rem;
        height: auto;
    }
}

/**
 * WCAG 3.1.1 / 3.1.2 — language of page & parts
 * Email / phone stay LTR even on RTL pages.
 */
input[type="email"],
input[inputmode="email"],
input[inputmode="numeric"],
input[inputmode="tel"],
input[name="phone"],
.ltr-direction,
.email_inputfield,
.wapup-invite-input,
.upload-app__email-inline-input {
    direction: ltr;
    unicode-bidi: isolate;
    text-align: start;
}

html[dir="ltr"] input[name="wapup_code"],
html[dir="ltr"] #wapup_code,
html[dir="ltr"] #wapup_code_new,
html[dir="ltr"] .wapup-new-code-input {
    direction: ltr;
    unicode-bidi: isolate;
    text-align: start;
}

html[dir="rtl"] input[name="wapup_code"],
html[dir="rtl"] #wapup_code,
html[dir="rtl"] #wapup_code_new,
html[dir="rtl"] .wapup-new-code-input,
html[dir="rtl"] #client_email_slot_new{
    direction: rtl;
    unicode-bidi: isolate;
}
.pdf-form-page__title{
    text-align: center;
}

/* RTL body font stack (app layout does not load custom-styles.css) */
html[dir="rtl"] body,
body.rtl-direction-font {
    font-family: Arial, Helvetica, sans-serif;
}
