/* ------------ Application form widgets (shared by the public wizard and the admin edit screen) ------------ */

/* Card-style radio picker (work type / format) */
.choice-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .6rem;
}

/* Every card in a picker - and in pickers side by side (.choice-col) - is as tall as the tallest one */
.choice-col {
    display: flex;
    flex-direction: column;
}

.choice-col .choice-grid {
    flex: 1;
    grid-auto-rows: 1fr;
}

.choice-option {
    display: flex;
    margin: 0;
    cursor: pointer;
}

.choice-option .choice-card {
    flex: 1;
}

.choice-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choice-card small {
    font-size: .74rem;
    font-weight: 400;
    color: #8494a7;
}

.choice-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    text-align: center;
    padding: .85rem .5rem;
    min-height: 88px;
    border: 1.5px solid var(--bs-border-color, #dfe3e7);
    border-radius: .85rem;
    font-size: .88rem;
    line-height: 1.4;
    transition: all .18s ease;
    background: var(--bs-body-bg, #fff);
}

.choice-card i {
    font-size: 1.6rem;
    color: #8494a7;
    transition: color .18s ease;
}

.choice-option:hover .choice-card {
    border-color: var(--nesco-primary-50p);
}

.choice-option input:checked + .choice-card {
    border-color: var(--nesco-primary);
    background: var(--nesco-primary-10p);
    color: var(--nesco-primary);
    font-weight: 600;
    box-shadow: 0 0 0 3px var(--nesco-primary-10p);
}

.choice-option input:checked + .choice-card i {
    color: var(--nesco-primary);
}

.choice-option input:focus-visible + .choice-card {
    outline: 2px solid var(--nesco-primary);
    outline-offset: 2px;
}

.choice-grid.is-invalid .choice-card {
    border-color: #ff5b5c;
}

/* "No registration number" acknowledgement */
.responsibility-box {
    border: 1.5px dashed rgba(247, 161, 26, .7);
    background: rgba(247, 161, 26, .08);
    border-radius: .85rem;
    padding: .7rem .9rem;
    min-height: 46px;
}

.responsibility-box.is-invalid {
    border-color: #ff5b5c;
    background: rgba(255, 91, 92, .06);
}

/* Upload tiles */
.upload-tile {
    position: relative;
    border: 1.5px dashed var(--bs-border-color, #cfd6dd);
    border-radius: .85rem;
    background: var(--bs-body-bg, #fff);
    transition: all .18s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.upload-tile:hover,
.upload-tile.dragover {
    border-color: var(--nesco-primary);
    background: var(--nesco-primary-10p);
}

.upload-tile.has-file {
    border-style: solid;
    border-color: #39da8a;
    background: rgba(57, 218, 138, .06);
}

.upload-tile.is-invalid {
    border-color: #ff5b5c;
    background: rgba(255, 91, 92, .05);
}

.upload-tile input[type=file] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.upload-body {
    display: flex;
    gap: .85rem;
    align-items: center;
    padding: .85rem;
    cursor: pointer;
    margin: 0;
    width: 100%;
    flex: 1;
}

.upload-preview {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: .6rem;
    background: var(--nesco-primary-10p);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.upload-preview i {
    font-size: 1.9rem;
    color: var(--nesco-primary);
}

.upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: .1rem;
}

.upload-text strong {
    font-size: .92rem;
}

.upload-hint {
    color: #8494a7;
    font-size: .75rem;
    line-height: 1.5;
}

.upload-status {
    font-size: .78rem;
    color: var(--nesco-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-tile.has-file .upload-status {
    color: #20a866;
}

.upload-tile.is-invalid .upload-status {
    color: #ff5b5c;
}

/* Photo tile: a 3x4 preview instead of the square icon box */
.photo-tile .upload-preview {
    width: 60px;
    height: 80px;
}

/* Account photo shown read-only on the submission form */
.account-photo {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin: 0;
}

.account-photo img,
.account-photo-empty {
    width: 90px;
    height: 120px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: .7rem;
    border: 2px solid var(--js-ink, #1d2625);
    background: var(--nesco-primary-10p);
}

.account-photo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: var(--nesco-primary);
}

.account-photo figcaption {
    font-size: .8rem;
    color: #8494a7;
    line-height: 1.7;
}

.account-photo figcaption strong {
    display: block;
    font-size: .92rem;
    color: var(--js-ink, #1d2625);
}

/* 3x4 photo cropper (croppie) */
.photo-crop-area {
    direction: ltr;
}

/* croppie sets height: 100%, which collapses inside the flex-centered modal */
.photo-crop-area.croppie-container {
    height: auto;
}

.photo-crop-area .cr-boundary {
    border-radius: .5rem;
    background: #f1f3f5;
}

/* Zoom slider: croppie draws it white on white; the admin theme (customization.min.css) recolors it,
   but the public pages don't load that, so the same rules live here. Zoom icons sit either side. */
.photo-crop-area .cr-slider-wrap {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 80%;
    margin: 14px auto 0;
    color: var(--nesco-primary, #13807b);
    font-size: 1.15rem;
}

.photo-crop-area .cr-slider-wrap::before,
.photo-crop-area .cr-slider-wrap::after {
    font-family: boxicons;
    line-height: 1;
}

.photo-crop-area .cr-slider-wrap::before { content: '\ec91'; } /* bx-zoom-out */
.photo-crop-area .cr-slider-wrap::after { content: '\ec90'; }  /* bx-zoom-in */

.photo-crop-area .cr-slider {
    flex: 1;
    margin: 0;
    padding: 8px 0;
    accent-color: var(--nesco-primary, #13807b);
    cursor: pointer;
}

.photo-crop-area .cr-slider::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 4px;
    background: var(--nesco-primary-50p, rgba(19, 128, 123, .35));
}

.photo-crop-area .cr-slider::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    margin-top: -7px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--nesco-primary, #13807b);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}

.photo-crop-area .cr-slider::-moz-range-track {
    height: 4px;
    border-radius: 4px;
    background: var(--nesco-primary-50p, rgba(19, 128, 123, .35));
}

.photo-crop-area .cr-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--nesco-primary, #13807b);
}
