/* Worker application (tradespeople/apply.html). Builds on request-flow.css (.rq) and adds only what the
   application needs: progress, language switch, trade levels, skill ratings, tool tiles, licenses, uploads. */

/* ---------- progress and save state ---------- */
.ap__top { margin-bottom: 36px; }
.ap__prog { height: 3px; background: var(--rule); border-radius: 2px; overflow: hidden; }
.ap__prog span { display: block; height: 100%; width: 0; background: var(--blue); transition: width .3s ease; }
.ap__meta { display: flex; justify-content: space-between; gap: 16px; margin-top: 12px; font: 500 13px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ap__save { display: inline-flex; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: 14px; font-weight: 400; text-align: right; }
.ap__save::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #9AA3D6; flex: none; }
.ap__save[data-s="saved"]::before { background: #16A34A; }
.ap__save[data-s="saving"]::before { background: var(--blue); }
.ap__save[data-s="fail"]::before { background: #D97706; }

/* ---------- language switch (first step, under the intro) ---------- */
.ap__lang { margin-bottom: 28px; }
.ap__lang legend { margin-bottom: 8px; }
.ap.is-still .rq__step { animation: none; }
.ap__seg { display: inline-grid; grid-template-columns: 1fr 1fr; padding: 3px; background: #fff; border: 1px solid #D5D9EA; border-radius: var(--radius); }
.ap__seg label { position: relative; cursor: pointer; }
.ap__seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ap__seg span { display: block; min-width: 108px; padding: 9px 18px; font-size: 15px; font-weight: 500; text-align: center; color: var(--muted); border-radius: 2px; transition: background-color .15s, color .15s; }
.ap__seg input:checked + span { color: #fff; background: var(--ink); }
.ap__seg input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- shared bits ---------- */
.ap .rq__step > .rq__f:last-child { margin-bottom: 0; }
.ap__hint { margin-top: 8px; font-size: 14px; line-height: 1.4; color: var(--muted); }
.ap__hint.is-err { color: #B42318; }
.ap__full { margin-bottom: 0; }
.ap__hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.ap [aria-invalid="true"] .rq__chips span, .ap [aria-invalid="true"] .ap__levels span, .ap [aria-invalid="true"] .rq__tile { border-color: #B42318; }
.ap__consent { margin-top: 8px; }
.ap__consent + .ap__consent { margin-top: 16px; }
.ap .rq__err.is-note { color: var(--blue); }
.rq__f legend span.opt, .rq__f label .opt { font-weight: 400; color: var(--muted); }

/* trade tiles: one choice */
.ap__tile::after { border-radius: 50%; }
.ap .rq__tiles { margin-bottom: 32px; }

/* levels: label and a short description */
.ap__levels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ap__levels label { position: relative; cursor: pointer; }
.ap__levels input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ap__levels span { display: block; height: 100%; padding: 14px 16px; background: #fff; border: 1px solid #D5D9EA; border-radius: var(--radius); transition: border-color .15s; }
.ap__levels b { display: block; font-size: 16px; font-weight: 500; color: var(--ink); }
.ap__levels small { display: block; margin-top: 4px; font-size: 13px; line-height: 1.35; color: var(--muted); }
.ap__levels label:hover span { border-color: #9AA3D6; }
.ap__levels input:checked + span { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); background: #F7F8FF; }
.ap__levels input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- skills: one row per skill, three levels ---------- */
.ap__skills { background: #fff; border: 1px solid #E1E4EE; border-radius: var(--radius-card); }
.ap__sk-head, .ap__sk { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 112px); align-items: center; gap: 8px; padding: 0 20px; }
.ap__sk-head { padding-top: 16px; padding-bottom: 14px; border-bottom: 1px solid #ECEEF5; }
.ap__sk-head span { text-align: center; }
.ap__sk-head b { display: block; font-size: 14px; font-weight: 500; color: var(--ink); }
.ap__sk-head small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.3; color: var(--muted); }
.ap__sk { margin: 0; min-width: 0; border: 0; border-bottom: 1px solid #ECEEF5; padding-top: 10px; padding-bottom: 10px; }
.ap__sk:last-child { border-bottom: 0; }
.ap__sk legend { float: left; padding: 0; font-size: 16px; line-height: 1.35; color: var(--ink); }
.ap__sk-opts { display: contents; }
.ap__sk-opts label { position: relative; display: block; cursor: pointer; }
.ap__sk-opts input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ap__sk-opts span { display: flex; align-items: center; justify-content: center; height: 40px; font-size: 14px; color: var(--muted); background: #fff; border: 1px solid #D5D9EA; border-radius: var(--radius); transition: border-color .15s, background-color .15s, color .15s; }
.ap__sk-opts label:hover span { border-color: #9AA3D6; color: var(--ink); }
.ap__sk-opts input:checked + span { color: #fff; background: var(--ink); border-color: var(--ink); }
.ap__sk-opts input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

/* key for the three levels, phones only (the column heads are hidden there) */
.ap__sk-key { display: none; margin: -16px 0 20px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.ap__sk-key b { font-weight: 500; color: var(--ink); }

/* ---------- cards (jobs, licenses by state, references) ---------- */
.ap__cards { display: grid; gap: 16px; }
.ap__card .rq__crew-h { margin-bottom: 18px; }
.ap__card .rq__row { margin-bottom: 0; }
.ap__card .rq__row .rq__f { margin-bottom: 18px; }
.ap__add { margin-top: 14px; padding: 8px 0; font: 500 15px/1 var(--sans); color: var(--blue); background: none; border: 0; cursor: pointer; }
.ap__add:hover { text-decoration: underline; text-underline-offset: 3px; }
.ap__cards + .rq__f, .ap__add + .rq__f, .ap__cards + .ap__more-st { margin-top: 28px; }

/* licenses */
.ap__lic { padding: 4px 0; border-bottom: 1px solid #ECEEF5; }
.ap__lic:last-child { border-bottom: 0; }
.ap__lic .rq__check { margin: 0; padding: 10px 0; align-items: flex-start; line-height: 1.35; }
.ap__lic .rq__check input { margin-top: 1px; flex: none; }
.ap__lic-more { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 20px; padding: 2px 0 14px 28px; }
.ap__lic-more .rq__f { margin-bottom: 0; }
.ap__none { font-size: 16px; line-height: 1.45; color: var(--text); }
.ap__chipbtn { display: inline-flex; align-items: center; height: 44px; padding: 0 16px; font: 15px/1.2 var(--sans); color: var(--ink); background: #fff; border: 1px solid #D5D9EA; border-radius: var(--radius); cursor: pointer; }
.ap__chipbtn:hover { border-color: var(--ink); }

/* uploads */
.ap__up { margin-top: 4px; }
.ap__up-l { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; color: var(--ink); }
.ap__up-btn, .rq__f > .ap__up-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; margin: 0; padding: 0 18px; font-size: 15px; line-height: 1; cursor: pointer; }
.ap__up-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.ap__up-btn svg { flex: none; width: 18px; height: 18px; }
.ap__up-btn:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.ap__up-btn.is-busy { opacity: .6; pointer-events: none; }
.ap__files { display: grid; gap: 8px; margin-bottom: 12px; }
.ap__files li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #fff; border: 1px solid #E1E4EE; border-radius: var(--radius); }
.ap__file-n { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 15px; color: var(--ink); }
.ap__file-s { font-size: 13px; color: #16A34A; }

/* ---------- tools: icon tiles ---------- */
.ap__tools { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ap__tool { position: relative; display: grid; justify-items: center; align-content: start; gap: 10px; min-height: 124px; padding: 20px 10px 14px; text-align: center; background: #fff; border: 1px solid #D5D9EA; border-radius: var(--radius); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.ap__tool:hover { border-color: #9AA3D6; }
.ap__tool input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ap__tool img { width: 48px; height: 48px; }
.ap__tool--text { align-content: center; }
.ap__tool span { font-size: 14px; line-height: 1.3; font-weight: 500; color: var(--ink); }
.ap__tool::after { content: ""; position: absolute; top: 8px; right: 8px; width: 16px; height: 16px; border: 1px solid #C9CDE0; border-radius: 2px; background: #fff; }
.ap__tool:has(input:checked) { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); background: #F7F8FF; }
.ap__tool:has(input:checked)::after { border-color: var(--blue); background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M4.5 9.2l3 3 6-6.4' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }
.ap__tool:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }

.ap__pay { max-width: 240px; }

/* ---------- aside: the steps ---------- */
.ap__steps { display: grid; margin-top: 18px; }
.ap__steps li { border-top: 1px solid #ECEEF5; }
.ap__steps li > * { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 0; font: 15px/1.3 var(--sans); color: var(--muted); text-align: left; background: none; border: 0; }
.ap__steps button { cursor: pointer; color: var(--ink); }
.ap__steps button:hover { color: var(--blue); }
.ap__steps i { position: relative; width: 16px; height: 16px; flex: none; border: 1px solid #C9CDE0; border-radius: 50%; }
.ap__steps .is-done i { border-color: var(--blue); background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M4.5 9.2l3 3 6-6.4' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; }
.ap__steps .is-now > * { color: var(--ink); font-weight: 500; }
.ap__steps .is-now i { border: 5px solid var(--blue); background: #fff; }

/* ---------- tablet and mobile ---------- */
@media (max-width: 860px) {
  .ap .rq__sum { display: none; }
  .ap__top { margin-bottom: 28px; }
  .ap__levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ap__tools { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .ap .rq__nav { margin-bottom: 0; }
}
@media (max-width: 640px) {
  .ap__sk-head { display: none; }
  .ap__sk { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 14px 16px; }
  .ap__sk { padding-top: 18px; padding-bottom: 18px; }
  .ap__sk legend { float: none; grid-column: 1 / -1; width: 100%; margin-bottom: 10px; font-weight: 500; }
  .ap__sk-key { display: block; }
  .ap__lic-more { grid-template-columns: 1fr; padding-left: 28px; }
  .ap__lic-more .rq__f { margin-bottom: 12px; }
  .ap__tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ap__tool { min-height: 112px; }
  .ap__seg span { min-width: 0; }
  .ap__meta { font-size: 12px; }
}
