/* Converter pages on the new website (templates/site/convert.html, job_status.html and the
   post-editing pages).  Loaded after site.css, only on these pages, and follows the same rules:
   3 text sizes, weight 400, no text on colour, colour only in shapes.

   static/js/main.js and Bootstrap's JavaScript still run the form and its pop-up windows, as they
   do on the old page.  Bootstrap's CSS is not loaded, so the classes they switch on and off
   (.modal, .show, .step-hidden, .alert ...) are defined here. */

.conv { padding-bottom: 96px; }
.conv .page-top { padding-bottom: 48px; }
/* The form panel spans all three columns of the grid, like the header above it (Calum 2026-11-03).  So that lines of text do not
   get far too long, each step is one column about 48rem wide.  One column reads top to bottom with no zigzag (form audit 2026-11-04). */
@media (min-width: 60rem) {
  .conv .conv-steps { max-width: none; }
  .conv .form-step { max-width: 48rem; }
  /* a fieldset has its own box, and its legend sits on top of a border: draw the hairline ourselves so it matches the other parts */
  .conv .form-step > fieldset.conv-part { margin-inline: 0; padding: 24px 0 0; min-width: 0; border: 0; position: relative; }
  .conv .form-step > fieldset.conv-part > legend { float: left; width: 100%; padding: 0; }   /* a floated legend is laid out like an ordinary heading inside the box */
  .conv .form-step > fieldset.conv-part > legend + * { clear: both; }
  .conv .form-step > fieldset.conv-part::before { content: ''; position: absolute; top: 0; left: 0; right: 0; border-top: 1px solid var(--line-strong); }
  .conv .form-step > .conv-part:not(fieldset), .conv #word_count_section > .conv-part { border-top: 1px solid var(--line-strong); padding-top: 24px; }
  }
.conv .sec { max-width: 48rem; }

/* The form is one framed panel, so it is clear where it starts and ends (user view: you know you are
   "inside the form"; accessibility view: WCAG 1.4.11 needs the edge of a control and of the group to
   be seen at 3:1, and the 1px border does that on its own (4.7:1 on the panel), the fill only helps).
   Fields stay the darker page colour inside the lighter panel, so each one reads as a well. */
.conv .conversion-card { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; padding: 32px; margin-bottom: 3rem; }
/* Parts of step 2 (version, who, details ...) are separated by a hairline instead of nested boxes. */
.conv .conv-part + .conv-part { border-top: 1px solid var(--line-strong); padding-top: 24px; }
.conv-steps { margin-bottom: 32px !important; }
@media (max-width: 640px) { .conv .conversion-card { padding: 20px 16px; } }

/* Radio buttons and tick boxes: the browser's own dark ones are hard to see on a dark page (the
   empty ring is only a faint grey).  Drawn here with a 2px ring in the text colour (WCAG 1.4.11),
   a filled dot or tick when chosen, and the system colours in Windows High Contrast. */
.conv .check-row input[type=radio], .conv .check-row input[type=checkbox] {
  -webkit-appearance: none; appearance: none; background: var(--bg); border: 2px solid var(--text);
  width: 24px; height: 24px; margin-top: 3px; flex: 0 0 auto; cursor: pointer;
}
.conv .check-row input[type=radio] { border-radius: 50%; }
.conv .check-row input[type=checkbox] { border-radius: 4px; }
.conv .check-row input[type=radio]:checked { background: radial-gradient(circle, var(--link) 0 45%, transparent 50%), var(--bg); border-color: var(--link); }
.conv .check-row input[type=checkbox]:checked {
  border-color: var(--link); background: var(--link) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23131217' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center / 80% no-repeat;
}
@media (forced-colors: active) {
  .conv .conversion-card { border-color: CanvasText; }
  .conv .check-row input[type=radio], .conv .check-row input[type=checkbox] { border-color: ButtonText; forced-color-adjust: none; background: Canvas; }
  .conv .check-row input[type=radio]:checked { background: radial-gradient(circle, Highlight 0 45%, transparent 50%), Canvas; }
  .conv .check-row input[type=checkbox]:checked { background-color: Highlight; border-color: Highlight; }
}
.conv .sec { margin-bottom: var(--space-section); scroll-margin-top: 16px; }

/* Steps: one bar per step, like the bars on the cover of an Easy Read Document.
   The tick and the word in the heading mean colour is never the only clue (WCAG 1.4.1). */
.conv-steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 0 40px !important; padding: 0 !important; max-width: 48rem; }
.conv-steps li + li { margin-top: 0; }
.conv-step { border-top: 6px solid var(--line); padding-top: 8px; }
.conv-step.active { border-top-color: var(--brand); }
.conv-step.completed { border-top-color: var(--brand); }
.conv-step.completed::before { content: '\2713\00a0'; }

/* The steps: main.js switches these two classes */
.form-step { scroll-margin-top: 16px; }
.form-step.step-hidden { display: none; }
.form-step h2:focus { outline: none; }
.card { scroll-margin-top: 16px; }

.conv-part { margin: 0 0 28px; }   /* tighter than before: the gaps made step 2 feel endless (audit 2026-11-04) */
.conv-part h3, .conv-part legend h3 { margin: 0 0 1rem; padding-left: 10px; border-left: 3px solid var(--brand); }
.conv-part legend { width: 100%; }
.site .box h2, .site .box h3, .site .box h4 { font-size: var(--size-body); line-height: 1.6; margin: 0 0 0.5rem; }
.box--warning { border-left: 5px solid #FFB347; }
.conv h4 { margin: 1.5rem 0 0.5rem; }
.conv .field-row:last-child { margin-bottom: 0; }

.conv input[type=file] { font: inherit; color: var(--text); max-width: 100%; display: block; padding: 8px 0; }
/* The browser's grey "Choose File" button, restyled to match the site's outlined buttons.  The text beside it is still the browser's own, so it stays readable and translated. */
.conv input[type=file]::file-selector-button { font: inherit; color: var(--text); background: transparent; border: 1px solid var(--link); border-radius: 6px; padding: 9px 20px; min-height: 44px; margin-right: 16px; cursor: pointer; }
.conv input[type=file]::file-selector-button:hover { border-color: var(--link-hover); background: var(--surface); }
.conv-file { margin: 8px 0 0; }
.conv-file::before { content: '\2713\00a0'; }
.conv-indent { margin-left: 34px; }
.conv-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.conv .conv-voucher { width: 16rem; max-width: 100%; text-transform: uppercase; letter-spacing: 0.05em; }
.conv .conv-hex { width: 8rem; font-family: ui-monospace, Menlo, Consolas, monospace; }
.conv-colour { width: 48px; height: 44px; padding: 2px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 6px; cursor: pointer; }
/* Two columns even on a phone (the people and organisation lists were five screens long in one column);
   wider screens get roomier columns. */
.conv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); gap: 4px 12px; }
@media (min-width: 40rem) { .conv-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 4px 20px; } }
.conv-grid legend { grid-column: 1 / -1; }
#voucher_feedback:not(:empty) { margin-top: 8px; }

/* Back and Next */
.conv-nav { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-top: 2rem; }
.conv-nav__hint { margin: 1.25rem 0 0; text-align: left; }
/* Step 1 has no Back button: Next sits on the left edge with the other text, and its hint lines up under it. */
.conv-nav > span:empty { display: none; }
.conv-nav:has(> span:empty) { justify-content: flex-start; }
.conv-nav:has(> span:empty) + .conv-nav__hint { text-align: left; }
/* The hint only explains a closed button, so it goes when the button opens. */
.conv-nav:has(#step-1-next:not(.is-blocked)) + .conv-nav__hint, .conv-nav:has(#step-2-next:not(.is-blocked)) + .conv-nav__hint { display: none; }
.site .btn:disabled { background: transparent; color: var(--text) !important; border-color: var(--line-strong); cursor: not-allowed; }
.site .btn:disabled:hover { background: transparent; }
/* A Next button that is not ready yet still takes a click (it then says what is missing), so it looks closed but is not disabled. */
.site .btn.is-blocked { background: transparent; color: var(--text) !important; border-color: var(--line-strong); }
.site .btn.is-blocked:hover { background: transparent; }

/* The price */
.conv-price__num { font-size: var(--size-h1); line-height: 1.2; margin: 0 0 0.5rem !important; }
.stats > div { min-width: 0; }
.stats__note { font-size: var(--size-body) !important; }
.conv details { margin-top: 1rem; }

/* Free sample: their words, then the Easy Read version on white paper */
.conv-sample { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: 24px; margin: 0 0 1.5rem; }
.conv-sample__box { max-height: 20rem; overflow-y: auto; padding: 16px; border: 1px solid var(--line-strong); border-radius: 6px; }
.conv-sample h4 { margin-top: 0; }
.conv-sample .paper h6 { font-size: var(--size-body); font-weight: 400; margin: 0 0 0.5rem; }

.conv-downloads { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.conv-wait { text-align: center; }
.conv-wait h2 { margin: 1rem 0 0.5rem; }
.conv .link-btn { padding-left: 8px; }

/* Waiting spinner.  With reduced motion, site.css stops the turn and the broken ring still marks it. */
.spinner-border { display: inline-block; width: 2rem; height: 2rem; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: conv-spin 0.75s linear infinite; vertical-align: -0.2em; }
.spinner-border-sm { width: 1em; height: 1em; border-width: 2px; }
@keyframes conv-spin { to { transform: rotate(360deg); } }

/* Messages main.js adds to the page (showAlert, showWordCountError) */
.alert { position: relative; border: 1px solid var(--line-strong); border-left: 5px solid var(--brand); border-radius: 6px; padding: 12px 48px 12px 16px; margin: 0 0 16px; }
.alert-danger { border-left-color: #FF5E78; }
.alert-warning { border-left-color: #FFB347; }
.wc-error-notice { padding-right: 16px; background: none !important; border-left: 5px solid #FF5E78 !important; border-top: 1px solid var(--line-strong) !important; border-right: 1px solid var(--line-strong) !important; border-bottom: 1px solid var(--line-strong) !important; }
.btn-close { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; font: inherit; color: var(--link); background: none; border: 0; cursor: pointer; }
.btn-close::before { content: '\00d7'; font-size: var(--size-h2); line-height: 1; }

/* Pop-up windows, opened and closed by Bootstrap's JavaScript */
body.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 1055; display: none; overflow-y: auto; padding: 16px; }
.modal-dialog { max-width: 38rem; margin: 16px auto; }
.modal-dialog-centered { display: flex; align-items: center; min-height: calc(100% - 32px); }
.modal-content { position: relative; width: 100%; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; }
.modal-header { position: relative; padding: 24px 64px 0 24px; }
.site .modal-header h2 { margin: 0; }
.modal-body { padding: 24px; }
.site .modal-body h3 { margin: 1.5rem 0 0.5rem; }
.modal-body .choice-list { margin-bottom: 1rem; }
.modal-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; padding: 0 24px 24px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 1050; background: #000; opacity: 0.7; }
/* Stripe draws its card form for a light page, so it gets a white panel. */
#payment-element { background: var(--paper); color: var(--ink); border-radius: 6px; padding: 16px; margin: 0 0 1rem; }
#payment-element:empty { display: none; }
#payment-errors:not(:empty) { padding-left: 10px; border-left: 5px solid #FF5E78; margin-bottom: 1rem; }

@media (max-width: 640px) {
  .conv-top { padding-top: 32px; }
  .conv-nav { flex-direction: column-reverse; align-items: stretch; }
  .conv-nav > span:empty { display: none; }
  .conv-nav .btn { text-align: center; }
  .conv-nav__hint { text-align: left; }
  .conv-indent { margin-left: 0; }
}

@media (forced-colors: active) {
  .conv-step { border-top-color: GrayText; }
  .conv-step.active, .conv-step.completed { border-top-color: CanvasText; }
  .modal-content { border-color: CanvasText; }
}

@media print {
  .conv-nav, .modal, .modal-backdrop { display: none !important; }
}

/* At 320px the chosen file's name ("No file chosen") was cut short beside the button; put it on its own line */
@media (max-width: 360px) {
  .conv input[type=file]::file-selector-button { display: block; margin: 0 0 8px; }
}

/* Easy Score on step 3: the headline number, bigger than the other scores */
.conv-easy-score { margin: 0 0 4px; }
.conv-easy-score__number { font-size: var(--size-h1); line-height: 1.1; margin-right: 4px; }
.conv-easy-score #easy_score_band { display: block; }
