/*
 * The widget's own styles - only for the few elements it adds that the themes never had.
 *
 * Everything the widget reuses (the dropzone, the file rows, the sidebar card, the buttons) keeps the
 * theme's own classes and is styled by the theme, so a brand's colours and spacing carry over with no
 * work here. What is left is the upload STATUS on each row, which had nothing to style because the
 * theme never uploaded anything.
 *
 * Colours come from the theme's custom properties, with a literal fallback for the one case they are
 * missing: certified-us defines a different set, and an unreadable status line is worse than an
 * off-brand one.
 */

.tc-upload-status {
    font-size: 13px;
    color: var(--color-text-light, #999);
    flex-shrink: 0;
    margin-left: 8px;
    white-space: nowrap;
}

/* A page count is the answer the customer is waiting for, so it is not greyed out like the file size. */
.tc-upload-status.is-counted {
    color: var(--color-text-dark, #03031a);
    font-weight: 500;
}

.tc-upload-status.is-failed {
    color: #c62828;
    white-space: normal;
}

/* The name can be long and the status must stay readable, so the name gives way first. */
.upload-file-item .upload-file-name {
    min-width: 0;
}

/* ------------------------------------------------------------------ the email field */

.tc-email-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 6px;
    padding: 12px 14px;
    border: 1px solid var(--color-border, #eaeaea);
    border-radius: 6px;
    font-family: inherit;
    font-size: 17px; /* input text as on the homepage - David 2026-10-07 */
    color: var(--color-text-dark, #03031a);
    background: var(--color-surface, #fff);
}

.tc-email-input:focus {
    outline: none;
    border-color: var(--color-primary, #1a63e2);
}

.tc-email-error,
.tc-order-error {
    margin: 8px 0 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: #c62828;
}

/* One line under the email field on why we ask (David's design review 2026-10-07). */
.tc-email-help {
    margin: 6px 0 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--color-text-gray, #434343);
}

/* Step 1 while it runs (C10): a spinner in place of the arrow, and the button cannot be pressed again. */
.tc-busy,
.tc-busy:disabled {
    cursor: progress;
    opacity: 1;
}

.tc-busy .btn-arrow {
    display: none;
}

.tc-busy::after {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-left: 10px;
    vertical-align: middle;
    /* The button's own text colour, so the spinner shows on light and dark buttons alike. */
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: tc-spin 0.7s linear infinite;
}

/* A form button while its request runs (David 2026-11-12): dimmed, with the spinner above. */
.tc-sending,
.tc-sending:disabled {
    opacity: 0.75;
}

/* Texts from Widget texts keep a line break typed in the field (David 2026-11-12). */
.tc-lines {
    white-space: pre-line;
}

@keyframes tc-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .tc-busy::after { animation-duration: 2s; }
}

/* Step 1: a field Start found empty (W2) - red border, message under it (.tc-start-error). */
.tc-invalid,
.tc-invalid:focus,
.tc-invalid:hover {
    border-color: #c62828 !important;
    box-shadow: 0 0 0 1px #c62828;
}

.tc-start-error {
    margin: 6px 0 0 0;
}

/* A message under one language must not move its neighbour: the language rows are grids, which centre
   (EU) or stretch (US footer) their cells. With no message both cells are the same height either way. */
.lang-pair-row > .form-field-wrap,
.footer-form-row > .form-group {
    align-self: start;
}

/* The document type list (C13): a ticked type no longer turns the whole row solid blue - the "flash" -
   but light blue with the check mark, and the line on top says several can be chosen. */
/* .multiselect-dropdown in front: this file loads BEFORE the theme's stylesheet, so a rule here
   needs more weight than the theme's to win. */
.multiselect-dropdown .multiselect-option,
.multiselect-dropdown .multiselect-option:hover {
    transition: none;
}

.multiselect-dropdown .multiselect-option.selected,
.multiselect-dropdown .multiselect-option.selected:hover {
    background-color: #e8effc;
    color: #0f3d91;
}

.multiselect-dropdown .multiselect-option.selected::after {
    color: var(--color-primary-text, var(--color-primary, #1a63e2));
}

.tc-multi-hint {
    padding: 8px 16px 6px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--color-text-gray, #434343);
    border-bottom: 1px solid #eef0f3;
}

.footer-form .tc-multi-hint {
    color: rgba(255, 255, 255, 0.8);
    border-bottom-color: rgba(255, 255, 255, 0.15);
}

/* Call me back on the EU form (BE-EN9): the theme's select look, as a text field. */
.tc-callback-field {
    margin-top: 18px;
    margin-bottom: 0;
}

.form-field-wrap .tc-callback-input {
    background-image: none;
    padding-right: 14px;
    cursor: text;
    color: var(--color-text-dark, #1e293b);
}

/* Upload step, phones (C17): the info icon stays on the first line when the text wraps. */
@media (max-width: 767px) {
    .upload-dropzone .upload-accepted {
        align-items: flex-start;
    }

    .upload-dropzone .upload-accepted-icon {
        margin-top: 3px;
    }

    .upload-dropzone .upload-drag-text {
        text-wrap: balance;
    }
}

/* Widget title on phones (W20): no word left alone on the second line. */
.form-card-title {
    text-wrap: balance;
}

/* Privacy line under the contact and manual quote buttons, and the link under the contact card (W16). */
.tc-privacy-line {
    margin: 12px 0 0 0;
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
    color: var(--color-text-gray, #434343);
}

.tc-privacy-line a {
    color: inherit;
    text-decoration: underline;
}

.tc-contact-cta {
    margin: 20px 0 0 0;
    text-align: center;
    font-size: 16px;
}

.tc-contact-cta a {
    color: var(--color-primary-text, var(--color-primary, #1a63e2));
    font-weight: 500;
    text-decoration: none;
}

.tc-contact-cta a:hover,
.tc-contact-cta a:focus-visible {
    text-decoration: underline;
}

/* A contact field the widget found empty or wrong: red border next to its message. */
.contact-form .contact-input[aria-invalid="true"] {
    border-color: #c62828;
}

/* The e-mail field of the upload step (EU and US) with a wrong address (R4). */
.tc-email-input[aria-invalid="true"],
.tc-gs-input[aria-invalid="true"] {
    border-color: #c62828 !important;
}

.tc-ready-hint {
    min-height: 1.4em;   /* C9a: the line keeps its height when the hint is hidden */
    margin: 8px 0 0 0;
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
    color: var(--color-text-gray, #434343);
}

/* ------------------------------------------------------------------ the waiting screen */

/* The card is the positioning context, so the overlay covers the price and the button while leaving
   the uploaded documents visible beside it (contract 3.4). */
.upload-sidebar-card {
    position: relative;
}

.tc-waiting {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.94);
    z-index: 2;
}

.tc-waiting-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--color-border, #eaeaea);
    border-top-color: var(--color-primary, #1a63e2);
    border-radius: 50%;
    animation: tc-spin 0.8s linear infinite;
}

@keyframes tc-spin {
    to { transform: rotate(360deg); }
}

/* Respecting the setting rather than ignoring it: the wait still reads as a wait without the motion. */
@media (prefers-reduced-motion: reduce) {
    .tc-waiting-spinner { animation-duration: 3s; }
}

.tc-waiting-text {
    margin: 0;
    text-align: center;
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-text-dark, #03031a);
}

/* ------------------------------------------------------------------ the manual quote form */

/* It stands in for the quote form on the hero card and for the card's contents on the upload page, so
   it carries no background or padding of its own - whichever card it lands in supplies those. */
.tc-manual-form {
    display: block;
}

.tc-field {
    margin-top: 16px;
}

.tc-field-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.3;
    color: var(--color-text-gray, #434343);
}

.tc-field-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid var(--color-border, #eaeaea);
    border-radius: 6px;
    font-family: inherit;
    font-size: 17px; /* input text as on the homepage - David 2026-10-07 */
    line-height: 1.4;
    color: var(--color-text-dark, #03031a);
    background: var(--color-surface, #fff);
}

textarea.tc-field-input {
    min-height: 88px;
    resize: vertical;
}

.tc-field-input:focus {
    outline: none;
    border-color: var(--color-primary, #1a63e2);
}

.tc-field-error {
    margin: 10px 0 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: #c62828;
}

.tc-manual-form button[type="submit"] {
    margin-top: 20px;
}

/* Errors on the theme's own contact fields sit under the field, inside its wrapper. */
.tc-contact-error {
    margin: 6px 0 0 0;
}

/* One confirmation for the manual quote, the contact form and Call me Back (R12, David 2026-10-15):
   pale green box, green check mark, title, text. Dark green text on #ecfdf5 is over 7:1. */
.tc-confirm {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 20px;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    background: #ecfdf5;
    color: #065f46;
    text-align: center;
}

/* Focus is moved here for screen readers; the ring around it looked like a selection (R12). */
.tc-confirm:focus {
    outline: none;
}

.tc-confirm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #047857;
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.tc-confirm-title {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    color: #065f46;
}

.tc-confirm-text {
    margin: 0;
    max-width: 480px;
    font-size: 15px;
    line-height: 1.6;
    color: #065f46;
}

/* ------------------------------------------------------------------ the manual quote step */

/* The EU upload page turned into the manual quote step (David 2026-10-07/08). Left: the details form,
   in the upload step's bordered card. Right: the theme's summary card. On desktop both cards share
   a height - the sidebar wrapper steps out of the grid (display: contents) so the summary card and
   the form card sit in the same row, with the trust badge on a row of its own under the summary. */
.tc-step-card {
    box-sizing: border-box;
    height: 100%;
    padding: 28px 24px;
    background: var(--color-surface, #fff);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
}

.tc-step-card .tc-field:first-of-type {
    margin-top: 0;
}

@media (min-width: 992px) {
    .upload-inner.tc-manual-step {
        align-items: stretch;
        row-gap: 0; /* the badge keeps its own margin, as under the upload step's card */
    }

    .tc-manual-step .upload-sidebar {
        display: contents;
    }

    .tc-manual-step .upload-main {
        grid-column: 1;
        grid-row: 1;
    }

    .tc-manual-step .tc-manual-summary {
        grid-column: 2;
        grid-row: 1;
    }

    .tc-manual-step .upload-trust-badge {
        grid-column: 2;
        grid-row: 2;
        align-self: start;
    }
}

.tc-files-ok {
    color: #047857;
    font-weight: 600;
}

/* Manual quote step on a laptop (1366 x 768): the button sat 28 px below the fold. Tighter spacing in the
   summary card brings it into view without scrolling (design feedback 2026-10-07). Desktop only. */
@media (min-width: 992px) {
    .tc-manual-step .tc-manual-summary .upload-sidebar-title {
        margin-bottom: 16px;
    }

    .tc-manual-step .tc-manual-summary .upload-sidebar-section {
        margin-bottom: 14px;
    }

    .tc-manual-step .tc-manual-summary .tc-next-steps li {
        margin-bottom: 6px;
    }
}

/* Reviews under the upload steps and the manual quote step, on phones: one swipeable row instead of three stacked cards
   (design feedback 2026-10-07). The next card peeks in, so the row reads as swipeable. Only here - the
   homepage keeps its own layout. */
@media (max-width: 767px) {
    .tc-manual-reviews .testimonials-grid,
    .tc-upload-reviews .testimonials-grid {
        display: flex;
        gap: 16px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 8px;
    }

    .tc-manual-reviews .testimonials-grid::-webkit-scrollbar,
    .tc-upload-reviews .testimonials-grid::-webkit-scrollbar {
        display: none;
    }

    .tc-manual-reviews .testimonial-card,
    .tc-upload-reviews .testimonial-card {
        flex: 0 0 85%;
        scroll-snap-align: start;
    }
}

.tc-next-steps {
    list-style: none;
    margin: 4px 0 0 0;
    padding: 0;
    counter-reset: tc-step;
}

.tc-next-steps li {
    position: relative;
    margin: 0 0 10px 0;
    padding-left: 32px;
    font-size: 15px;
    line-height: 22px;
    color: var(--color-text-dark, #03031a);
    counter-increment: tc-step;
}

.tc-next-steps li::before {
    content: counter(tc-step);
    position: absolute;
    left: 0;
    top: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-primary, #1a63e2);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 22px;
    text-align: center;
}

.tc-manual-summary button[type="submit"] {
    margin-top: 8px;
}

/* ------------------------------------------------------------------ call me back */

/* Sits where the button was, inside the quote form's card, so it inherits the card's own width and
   padding. Shown only where the button is - the theme hides that above the mobile breakpoint. */
.tc-callback {
    margin-top: 8px;
}

.tc-callback .tc-field {
    margin-top: 8px;
}

.tc-callback button {
    margin-top: 12px;
}

.tc-outcome-text {
    margin: 12px 0 0 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text-gray, #434343);
}

/* ------------------------------------------------------------------ the US brand */

/* Step 2's form card holds the waiting screen, as the sidebar card does on the EU brands. */
.gs-form-card {
    position: relative;
}

/* The email field, in the theme's own floating-label look (.gs-select-wrap select), without the arrow. */
.tc-gs-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 8.5px 17px;
    border: 1px solid var(--color-neutral-0, #002429);
    border-radius: 8px;
    background: var(--color-neutral-1, #fbf8f5);
    font-family: inherit;
    font-size: 13.6px;
    color: var(--color-secondary, #004852);
    transition: border-color 0.2s;
}

.tc-gs-input:focus {
    outline: none;
    border-color: var(--color-secondary, #004852);
}

.gs-file-item .tc-upload-status {
    margin-left: 12px;
}

.gs-form-card .tc-manual-form .upload-sidebar-title,
.gs-form-card .tc-outcome .upload-sidebar-title,
.footer-form-card .tc-manual-form .upload-sidebar-title,
.footer-form-card .tc-outcome .upload-sidebar-title {
    margin: 0 0 8px 0;
    font-size: 22px;
    line-height: 1.3;
}

/* The US theme keeps its own, smaller input text: the homepage values are the EU theme's. */
.gs-form-card .tc-field-input,
.footer-form-card .tc-field-input {
    font-size: 15px;
}

/* The footer card is dark teal with white text: the grey used on light cards would not be readable.
   The form is left-aligned inside a block the theme centres. */
.footer-form-card .tc-manual-form,
.footer-form-card .tc-outcome {
    text-align: left;
}

.footer-form-card .tc-field-label,
.footer-form-card .tc-outcome-text {
    color: rgba(255, 255, 255, 0.85);
}

.footer-form-card .tc-field-error,
.footer-form-card .tc-order-error,
.footer-form-card .tc-email-error {
    color: #ffb4a8;
}

.footer-form-card .tc-invalid,
.footer-form-card .tc-invalid:focus,
.footer-form-card .tc-invalid:hover {
    border-color: #ffb4a8 !important;
    box-shadow: 0 0 0 1px #ffb4a8;
}

/* The footer form borders a wrapper (.form-group) and lays the languages out in a grid, so the message
   cannot take a line of its own: it hangs under the box, and the box's margin grows to make room for it
   (the next field's label overlaps 8px of the usual 20px). */
.footer-form .form-group.tc-invalid {
    margin-bottom: 40px;
}

.footer-form .form-group .tc-start-error {
    position: absolute;
    top: 100%;
    left: 2px;
    margin: 5px 0 0 0;
    font-size: 12px;
    line-height: 1.3;
    text-align: left;
    white-space: nowrap;
}

.footer-form-card .tc-email-help,
.footer-form-card .tc-ready-hint {
    color: rgba(255, 255, 255, 0.85);
}

/* ------------------------------------------------------------------ R10: the file list (David 2026-10-15) */

/* A very long file name stretched the upload column, the page scrolled sideways at every width and at
   1280 px the summary card was pushed off-screen (V7): grid and flex children may not shrink below their
   content by default, so the name never reached its ellipsis. Everything between the page and the name
   may shrink now; the name gives way first. */
body .upload-inner {
    grid-template-columns: minmax(0, 1fr) 360px;
}
body .upload-main,
body .upload-file-list,
body .upload-file-item {
    min-width: 0;
}
body .upload-file-item .upload-file-info {
    flex: 1 1 auto;
    min-width: 0;
}
body .upload-file-item .upload-file-name {
    flex: 0 1 auto;
    min-width: 3.5em; /* at 320 px "Uploading..." left one letter of the name */
}

/* Phones: the file size gives its room to the name; the page count stays. */
@media (max-width: 420px) {
    body .upload-file-item .upload-file-size {
        display: none;
    }
}

/* A file that cannot be read (V8): the name stays, the red message goes on its own line under it. */
body .upload-file-item.tc-upload-failed .upload-file-info {
    flex-wrap: wrap;
    row-gap: 2px;
}

/* The name stays beside its icon on the first line (a wrapping row places items at their full width). */
body .upload-file-item.tc-upload-failed .upload-file-name {
    max-width: calc(100% - 100px);
}
body .upload-file-item.tc-upload-failed .tc-upload-status {
    flex-basis: 100%;
    margin-left: 30px;
    text-align: left;
}

/* The remove button: at least 44 x 44 px to tap (V16), the cross itself unchanged. */
body .upload-file-item .upload-file-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    margin: -10px -10px -10px 4px;
}

@media (max-width: 991px) {
    body .upload-inner {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ------------------------------------------------------------------ R11: manual quote step (David 2026-10-15) */

/* On a 1054 x 701 laptop the "Request a quote" button sat ~150 px below the fold (V9). Desktop only:
   a shorter hero under the title (and, since RT16, no "What happens next" list in the card). The card
   is about as tall as the form beside it, so making it sticky would not have moved it. */
@media (min-width: 992px) {
    body.tc-manual-page .upload-hero {
        padding-bottom: 64px;
    }

    body.tc-manual-page .upload-hero .upload-subtitle {
        max-width: 760px;
        margin-left: auto;
        margin-right: auto;
    }

}

/* Phones: the subtitle kept 15 px from the screen edge and a large empty band sat under it (V10);
   the upload step had the same band, ~75 px (RT8, David 2026-10-19). */
@media (max-width: 767px) {
    body .upload-hero {
        padding-bottom: 40px;
    }

    body .upload-hero .upload-subtitle {
        padding: 0 12px;
    }
}

/* ------------------------------------------------------------------ R12: errors and labels (David 2026-10-15) */

/* Red border on every field with an error (V22): the manual quote form and Call me Back kept blue. */
.tc-field-input[aria-invalid="true"],
.tc-field-input[aria-invalid="true"]:focus,
.tc-callback-input[aria-invalid="true"],
.tc-callback-input[aria-invalid="true"]:focus {
    border-color: #c62828 !important;
}

/* The manual quote step's labels in the field border, as on the contact form and the quote form (V23). */
.tc-manual-step .tc-field {
    position: relative;
    margin-top: 22px;
}

.tc-manual-step .tc-field-label {
    position: absolute;
    left: 12px;
    top: 0;
    transform: translateY(-50%);
    margin: 0;
    padding: 0 6px;
    font-size: 12px;
    line-height: 1.2;
    color: var(--color-text-light, #626875);   /* P1: #999 gave 2.85 */
    background: var(--color-surface, #fff);
    pointer-events: none;
    z-index: 1;
}

.tc-manual-step .tc-field-input {
    padding: 18px 14px 12px;
    border: 1px solid #8a8a8a;   /* P1: field borders at least 3:1 */
    border-radius: 10px;
}

.tc-manual-step .tc-field-error {
    margin-top: 6px;
}

/* Call me Back's confirmation inside the quote form card: a little room above it. */
form.order-form .tc-confirm {
    margin-top: 16px;
    padding: 18px 16px;
}

/* ------------------------------------------------------------------ RT15 / RT16 (David 2026-10-19) */

/* Summary cards on the upload and manual quote steps: the title centred, the items under it in one
   left-aligned column (Languages, Document type, Files), as on the original site and the checkout. */
body .upload-sidebar-card .upload-sidebar-title {
    text-align: center;
    text-wrap: balance;
}

body .upload-sidebar-card .upload-sidebar-value,
body .upload-sidebar-card .upload-sidebar-label {
    text-wrap: pretty;
}

/* The privacy line under the manual quote button: small grey text. */
.tc-manual-summary .tc-privacy-line {
    font-size: 12px;
    line-height: 1.5;
    color: var(--color-text-light, #626875);
}

/* The upload step's e-mail field with its label in the border, as on the other forms. */
body .upload-sidebar-section.tc-email {
    position: relative;
}

body .upload-sidebar-section.tc-email .upload-sidebar-label {
    position: absolute;
    top: 0;
    left: 12px;
    transform: translateY(-50%);
    margin: 0;
    padding: 0 6px;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.2;
    color: var(--color-text-light, #626875);   /* P1: #999 gave 2.85 */
    background: var(--color-surface, #fff);
    pointer-events: none;
    z-index: 1;
}

body .upload-sidebar-section.tc-email .tc-email-input {
    padding: 18px 14px 12px;
    border: 1px solid #8a8a8a;   /* P1: field borders at least 3:1 */
    border-radius: 10px;
}

/* ------------------------------------------------------------------ RT13: placeholders (David 2026-10-19) */

/* A placeholder ("For example: where you'll use the translation...") read as text already typed in.
   On every form, both themes: smaller, lighter grey, italic. */
body input::placeholder,
body textarea::placeholder {
    font-size: 0.88em;
    font-style: italic;
    color: #9aa0a6;
    opacity: 1;
}

/* The TFE footer form is dark teal: the same style in a light tone that stays readable there. */
body .footer-form-card input::placeholder,
body .footer-form-card textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* ------------------------------------------------------------------ RT2: button content centred (David 2026-10-19) */

/* Text + arrow is centred as a box, but the arrow icons carry empty space on their right inside the
   icon (the theme's 22 px arrow is drawn from x 2 to 19 of 24, the widget's 16 px one from 4 to 20), so
   the visible text and arrow sat ~2 px left of centre. The negative margin takes that space out. */
.btn .btn-arrow svg[width="22"] {
    margin-right: -4px;
}

.btn .btn-arrow svg[width="16"] {
    margin-right: -2px;
}

/* ------------------------------------------------------------------ R21-1: reCAPTCHA badge (David 2026-10-20) */

/* Google's standard badge, no text notice (the agreement). On phones the badge sat over the last
   lines of the page, so the footer gets extra room at the bottom on pages where reCAPTCHA runs. */
@media (max-width: 767px) {
    body.tc-recaptcha-on .site-footer::after {
        content: "";
        display: block;
        height: 84px;
    }

    /* The EU upload / personal quote page has no footer: the room goes under the page itself. */
    body.tc-recaptcha-on.page-template-page-upload {
        padding-bottom: 84px;
    }

    /* Polish B4 (David 2026-11-02): on form pages the badge still covered the end of the last lines
       (TFE contact page, the German manual quote page "Sicherer Server"). The page content gets the
       same room, so its last lines can scroll above the badge too. */
    body.tc-recaptcha-on main {
        padding-bottom: 80px;
    }
}

/* RT3 (David 2026-10-19): at 320 px "Ihre beglaubigte / Übersetzung" left one word on the last line -
   "beglaubigte Übersetzung" does not fit the card's 242 px, so balancing alone cannot help. On the
   smallest phones the card's side padding and the title step down a little and the title fits one line. */
@media (max-width: 360px) {
    body .upload-sidebar-card {
        padding-left: 16px;
        padding-right: 16px;
    }

    body .upload-sidebar-card .upload-sidebar-title {
        font-size: 19px;
    }

    /* The longest labels ("Sollten wir noch etwas wissen? (optional)") fit the border at 11 px. */
    .tc-manual-step .tc-field-label {
        font-size: 11px;
        padding: 0 4px;
    }
}

/* A label in the field border stays on one line (at 320 px "Sollten wir noch etwas wissen? (optional)"
   wrapped over the border); when it cannot fit, it ends in "...". */
.tc-manual-step .tc-field-label {
    max-width: calc(100% - 24px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ------------------------------------------------------------------ RT17 / RT18: TFE upload and personal quote (David 2026-10-19) */

/* The e-mail field must read as "fill this in now": a clear label in normal case above the field (not
   the small capitals legend), the field as tall as the theme's other fields, the reason line under it. */
.gs-atf--step2 .tc-email-wrap {
    position: static;
    margin-bottom: 0;
}

.gs-atf--step2 .tc-email-wrap > label {
    position: static;
    display: block;
    margin: 0 0 6px 0;
    padding: 0;
    background: none;
    font-family: var(--font-body-bold, inherit);
    font-size: 16px;   /* R22-3 (David 2026-10-21) */
    letter-spacing: 0;
    text-transform: none;
    color: var(--color-secondary, #004852);
}

.gs-atf--step2 .tc-gs-input,
.tc-us-manual-step .tc-field-input {
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid var(--color-neutral-0, #002429);
    background: var(--color-neutral-1, #fbf8f5);
    color: var(--color-secondary, #004852);
}

/* Desktop: the e-mail next to Continue; phones: above it. The upload area and the lines under the
   button keep the full width. */
@media (min-width: 768px) {
    .gs-atf--step2 .gs-form-card form {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        column-gap: 16px;
    }

    .gs-atf--step2 .gs-form-card form > * {
        flex: 0 0 100%;
    }

    .gs-atf--step2 .gs-form-card form > .tc-email-wrap {
        flex: 1 1 260px;
    }

    .gs-atf--step2 .gs-form-card form > .gs-continue-btn {
        flex: 0 0 auto;
        margin-top: 27px;   /* level with the field under its label */
        min-height: 46px;
    }

    .gs-atf--step2.tc-us-manual-step .gs-form-card form {
        display: block;
    }
}

@media (max-width: 767px) {
    .gs-atf--step2 .gs-form-card form > .gs-continue-btn {
        margin-top: 16px;
    }
}

/* The accepted formats inside the upload area, as on the EU brands. */
.gs-upload-formats {
    margin: 8px 0 0 0;
    font-size: 13px;
    color: var(--color-secondary, #004852);
    opacity: 0.8;
}

/* The intro as wide as the upload box. */
.gs-atf--step2 .gs-step-desc {
    max-width: none;
}

/* The order summary as the original design: the labels, and the values in a larger size. */
.gs-atf--step2 .gs-summary-key {
    font-size: 12px;
    letter-spacing: 1.2px;
}

.gs-atf--step2 .gs-summary-doc-list li,
.gs-atf--step2 .gs-summary-langs,
.gs-atf--step2 .gs-summary-val {
    font-size: 17px;
    line-height: 1.4;
}

/* The personal quote step 3 on TFE: labels in normal case above the fields, as the e-mail of step 2.
   David 2026-11-19: the fields, labels and button as step 2's e-mail field and Continue - 44 px fields,
   16 px labels, the dark field colour in dark mode. */
.tc-us-manual-step .tc-manual-form .tc-field {
    margin-top: 10px;
}

.tc-us-manual-step .tc-manual-form .tc-field:first-of-type {
    margin-top: 0;
}

.tc-us-manual-step .tc-field-label {
    font-family: var(--font-body-bold, inherit);
    font-size: 16px;
    color: var(--color-secondary, #004852);
    margin-bottom: 6px;
}

.tc-us-manual-step input.tc-field-input {
    line-height: normal;
    min-height: 44px;
}

.tc-us-manual-step textarea.tc-field-input {
    min-height: 72px;
}

.tc-us-manual-step .tc-manual-form button[type="submit"] {
    margin-top: 16px;
}

/* RT18: name and e-mail side by side on desktop, a shorter message box. David 2026-11-19: the steps, STEP
   and the title stay where step 2 has them (circles at 140 px, STEP at 210 px, title 48 px) and the card
   keeps step 2's padding - the page no longer jumps between the steps. */
@media (min-width: 992px) {
    .gs-atf--step2.tc-us-manual-step .gs-atf__left {
        justify-content: flex-start;
    }

    .gs-atf--step2.tc-us-manual-step .gs-form-card form.tc-manual-form {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        column-gap: 16px;
    }

    .tc-us-manual-step .tc-manual-form > * {
        grid-column: 1 / -1;
    }

    .tc-us-manual-step .tc-manual-form > .tc-field:nth-of-type(1) {
        grid-column: 1;
    }

    .tc-us-manual-step .tc-manual-form > .tc-field:nth-of-type(2) {
        grid-column: 2;
        margin-top: 0;
    }

    .tc-us-manual-step textarea.tc-field-input {
        min-height: 60px;
    }
}

/* R20-1 (David 2026-10-20): no single word left alone on the last line of the e-mail helper
   ("Verder niets." at 320 px) or the reCAPTCHA notice ("s'appliquent." in the card). */
.tc-email-help,
.tc-privacy-line {
    text-wrap: balance;
}

/* R20-9 (David 2026-10-20): the upload step's e-mail label read as part of the helper text (grey).
   It takes the colour of "Document type" and is a bit larger; the field gets a clear blue border on
   focus, and the same border once a file is uploaded while the e-mail is still empty. */
body .upload-sidebar-section.tc-email .upload-sidebar-label {
    font-size: 16px;   /* R21-3: as "Document type" */
    font-weight: 500;
    color: var(--color-text-dark, #03031a);
}

body .upload-sidebar-section.tc-email .tc-email-input:focus,
body .upload-sidebar-section.tc-email.tc-email-needed .tc-email-input {
    border-color: var(--color-primary, #1a63e2);
    box-shadow: 0 0 0 1px var(--color-primary, #1a63e2);
}

/* ------------------------------------------------------------------ R21-3 (David 2026-10-20) */

/* One placeholder style on every field of every form, all brands incl. TFE: 14 px, a lighter grey,
   italic - the labels lead, the placeholder stays a hint. Fixed size (not em), so a field with
   17 px text does not get a 15 px placeholder. */
body input::placeholder,
body textarea::placeholder,
body .footer-form-card input::placeholder,
body .footer-form-card textarea::placeholder {
    font-size: 14px !important;
    font-style: italic !important;
    color: #a9aeb5 !important;
    opacity: 1;
}

/* Summary card values (upload step, personal quote step): a shade darker than before, the same
   colour in every summary card, still secondary to the labels. */
body .upload-sidebar-card .upload-sidebar-value,
body .upload-sidebar-card .upload-sidebar-value *,
body .upload-sidebar-card .upload-lang-arrow {
    color: #5f6670;
}

/* R22-3 (David 2026-10-21): the Document type value was still #999 / 14 px - as the other values. */
body .upload-sidebar-card .upload-doctype-item {
    font-size: 15px;
    color: #5f6670;
}

/* R21-5 (David 2026-10-20): on translationsforeurope.com everything is left-aligned, so the lines
   under the buttons are too. */
body.wp-theme-certified-us .tc-privacy-line,
body.wp-theme-certified-us .tc-email-help {
    text-align: left;
}

/* R22-3 (David 2026-10-21): the TFE step 2 summary card was ~360 px wide in a much wider column;
   wider, as on the live site. */
.gs-atf--step2 .gs-summary-inner {
    max-width: 480px;
}

/* R22-8b (David 2026-10-21): the heading sat ~15 px above the Browse button and the accepted-types
   line ~24 px below it. The space above the button now matches the space below: under the "or" on
   desktop, and under the heading itself on touch screens (where the "or" is hidden). */
body .upload-dropzone .upload-or {
    margin-bottom: 18px;
}

body .upload-dropzone .upload-drag-text.tc-drop-touch {
    margin-bottom: 18px;
}

/* D9-9 dark mode (David 2026-11-03): the widget's own fixed colours on the dark page of either theme. */
@media (prefers-color-scheme: dark) {
    .multiselect-dropdown .multiselect-option.selected,
    .multiselect-dropdown .multiselect-option.selected:hover {
        background-color: #22345a;
        color: #dbe6ff;   /* 9.83 */
    }
    body .upload-sidebar-card .upload-sidebar-value,
    body .upload-sidebar-card .upload-sidebar-value *,
    body .upload-sidebar-card .upload-lang-arrow,
    body .upload-sidebar-card .upload-doctype-item {
        color: #b4bcc9;   /* 8.51 on the EU card, 7.88 on the TFE card (#5f6670 was for light cards) */
    }
    /* Error messages: #c62828 gave 3.25 on the dark card; 7.1 - 8.0. */
    .tc-field-error,
    .tc-order-error,
    .tc-email-error,
    .tc-upload-status.is-failed { color: #ff8a80; }
    /* Translations for Europe step 2: the fields were cream and the helper the EU grey. */
    body.wp-theme-certified-us .tc-gs-input,
    body.wp-theme-certified-us .gs-atf--step2 .tc-gs-input,
    body.wp-theme-certified-us .tc-us-manual-step .tc-field-input {
        background: var(--color-surface-raised, #13292d);
        color: var(--color-secondary, #cfe8ea);
        border-color: var(--color-neutral-0, #e7f2f3);
    }
    body.wp-theme-certified-us .tc-email-help,
    body.wp-theme-certified-us .tc-privacy-line { color: #b4bcc9; }
    /* The price calculation overlay (David 2026-11-12): the card's own dark surface, light text. */
    .tc-waiting { background: rgba(15, 21, 34, 0.94); }
    body.wp-theme-certified-us .tc-waiting { background: rgba(19, 41, 45, 0.95); }
    .tc-waiting-text { color: #e8ebf2; }
    .tc-waiting-spinner { border-color: #5d6a85; border-top-color: #8fb4ff; }
    /* The thank-you boxes (contact, personal quote, callback): dark green instead of mint. */
    .tc-confirm { background: #0f2e25; border-color: #1f6f55; color: #b9f0d8; }
    .tc-confirm-title,
    .tc-confirm-text { color: #b9f0d8; }   /* 11.49 on #0f2e25 */
}

/* A hidden reviews block stays hidden whatever the theme sets on the section (upload / manual swap). */
.tc-upload-reviews[hidden],
.tc-manual-reviews[hidden] {
    display: none !important;
}
