/* Extra field types for the forms site. Builds on form.css, the content capture form's styles. */

[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

nav a:first-child { margin-right: auto; }

/* Long titles wrap inside the header instead of running past its right-hand edge */
.hero > div { min-width: 0; }
.hero h1 { overflow-wrap: break-word; hyphens: manual; }

/* Space between the header, the notice (if any) and the form, as on the original content capture page */
.wrap > .hero + .card, .wrap > .notice + .card, .wrap > .card + .card { margin-top: 24px; }
.notice > :first-child { margin-top: 0; }
.notice p:last-child { margin-bottom: 0; }

.fields { display: flex; flex-direction: column; gap: 26px; }
.flabel { display: block; font-weight: 600; margin: 0 0 8px; }
.flabel p { display: inline; margin: 0; }
.req { color: #a12a1d; }
.field > .hint, .layout > .hint, .repeater > .hint { margin: 8px 0 0; }
.hint p { margin: 0 0 6px; }
.hint p:last-child { margin-bottom: 0; }

/* Answer box widths, chosen in form.js from what goes in each box */
.w-xs .in { max-width: 160px; }
.w-s .in { max-width: 280px; }
.w-m .in { max-width: 480px; }
.w-l > .subs { max-width: 640px; }
/* Beside other questions, boxes fill their column so the columns line up */
.cols > .field:not(.span-all) .in, .cols > .field:not(.span-all) > .subs { max-width: none; }
.cols > .span-all { grid-column: 1 / -1; }

select.in {
    display: block; width: 100%; min-height: 48px; padding: 11px 40px 11px 12px; font: inherit; color: var(--ink);
    border: 1px solid #a9bfc2; border-radius: 10px; background: white;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2353666c' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
}
select.in:focus { outline: 3px solid #00abb144; border-color: var(--strong); }
input.file { padding: 10px; }

/* Several inputs under one question: name, address, date and time, email + confirm */
.subs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.subs-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.subs-1 { grid-template-columns: minmax(0, 1fr); }
.subs .wide { grid-column: 1 / -1; }
.subs input.in { max-width: none !important; }
.sublabel { display: block; font-weight: 400; font-size: .84rem; color: var(--muted); margin: 6px 0 0; }

/* Ticks and options */
.choices { display: grid; gap: 10px; }
.choices.inline { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.choices.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choices.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choices.short { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.choice {
    display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 12px 14px; font-weight: 400; cursor: pointer;
    border: 1px solid var(--line); border-radius: 10px; background: white; transition: border-color .12s, background .12s;
}
.choice:hover { border-color: #a9bfc2; }
.choice:has(input:checked) { border-color: var(--strong); background: var(--soft); }
.choice input { flex: none; width: 20px; height: 20px; min-height: 0; margin: 1px 0 0; padding: 0; accent-color: var(--strong); }
.choice span { min-width: 0; }

/* Slider */
.slider { display: flex; align-items: center; gap: 16px; max-width: 560px; min-height: 48px; } /* same height as answer boxes, so it lines up beside them */
.range { flex: 1; min-height: 0; padding: 0; border: 0; accent-color: var(--strong); }
.range-value { flex: none; font-weight: 600; color: #006c70; font-size: .95rem; }

/* Rating grid */
.likert-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.likert { width: 100%; border-collapse: collapse; font-size: .92rem; }
.likert th, .likert td { padding: 10px 8px; text-align: center; border-bottom: 1px solid var(--line); }
.likert thead th { font-weight: 600; color: var(--muted); background: #f8fbfb; vertical-align: bottom; }
.likert tbody th { text-align: left; font-weight: 500; min-width: 180px; }
.likert tbody tr:last-child > * { border-bottom: 0; }
.likert-cell { display: grid; place-items: center; margin: 0; cursor: pointer; min-height: 32px; }
.likert-cell input { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--strong); }

/* Signature */
.sig { max-width: 560px; }
.sig-pad { display: block; width: 100%; height: 170px; border: 1px dashed #a9bfc2; border-radius: 10px; background: #fbfdfd; touch-action: none; cursor: crosshair; }
.sig-clear { margin-top: 6px; }

/* Buttons */
.btn-link { min-height: 0; padding: 4px 0; border-radius: 4px; background: none; color: #006c70; font-size: .9rem; font-weight: 600; text-decoration: underline; }
.btn-link:hover { background: none; color: #004c4f; }
.btn-quiet { background: white; color: #006c70; border: 1px solid var(--line); }
.btn-quiet:hover { background: var(--soft); }

/* Sections and content */
.divider { padding-top: 22px; border-top: 1px solid var(--line); }
.fields > .divider:first-child { padding-top: 0; border-top: 0; }
.legend { font-size: 1.15rem; font-weight: 700; color: #006c70; margin: 0; }
.divider .hint { margin-top: 6px; }
.content-block { overflow-wrap: anywhere; }
.content-block > :first-child { margin-top: 0; }
.content-block > :last-child { margin-bottom: 0; }
.content-block img { max-width: 100%; height: auto; }
.content-block .content-heading { font-size: 1.05rem; line-height: 1.35; margin: 1.2em 0 .4em; color: #006c70; }
.content-block ul, .content-block ol { padding-left: 1.3em; }
.content-block li + li { margin-top: 4px; }
.content-block table { border-collapse: collapse; max-width: 100%; }
.content-block td, .content-block th { border: 1px solid var(--line); padding: 6px 8px; }

/* Columns (WPForms layout) and repeating groups */
.cols { display: grid; gap: 22px; align-items: start; }
.cols > .field { min-width: 0; }
.cols-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.layout-title { font-size: 1.02rem; margin: 0 0 14px; color: var(--ink); }
.repeater { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fafcfc; }
.rep-rows { display: flex; flex-direction: column; gap: 16px; }
.rep-row { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.rep-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.rep-num { margin: 0; font-weight: 700; color: #006c70; }
.rep-add { margin-top: 14px; min-height: 44px; padding: 10px 16px; }

/* Pages */
.progress { margin: 0 0 26px; }
.progress-text { margin: 0 0 8px; color: var(--muted); font-size: .92rem; }
.progress-text strong { color: #006c70; }
.progress-bar { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--brand); border-radius: inherit; transition: width .3s; }
.page-nav { margin-top: 32px; padding-top: 26px; border-top: 1px solid var(--line); }
.page-nav .hint { margin: 0; }
button:disabled { opacity: .6; cursor: progress; }

/* Errors */
.has-error .choices .choice, .has-error .likert-wrap, .has-error .sig-pad { border-color: #a12a1d; }
.error { font-weight: 600; }

/* Thank you */
.success { padding: 36px 40px; }
.success:focus { outline: none; }
.success h2 { font-size: 1.6rem; margin: 0 0 12px; }
.thanks-links { margin: 26px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }

@media (max-width: 640px) {
    .cols { grid-template-columns: minmax(0, 1fr) !important; }
    .cols > * { grid-column: auto !important; grid-row: auto !important; }
    .subs, .subs-3 { grid-template-columns: minmax(0, 1fr); }
    .choices.cols-2, .choices.cols-3 { grid-template-columns: minmax(0, 1fr); }
    .repeater { padding: 14px; }
    .rep-row { padding: 14px; }
    .page-nav { display: flex; flex-wrap: wrap; gap: 12px; }
    .page-nav button { flex: 1; width: auto !important; margin-top: 0 !important; }
    .page-nav .hint { flex-basis: 100%; order: 3; }
    .success { padding: 26px 22px; }
}