/* ============================================================================
 * Design 2 (iWorkForSA) — Application Step 1 (Personal Details) restyle.
 * Scoped entirely under .iwfsa-apply so no other page/tenant is affected.
 * The markup is produced by iworkforsa/js/apply-iworkforsa.js, which transplants
 * the REAL engine form controls (names/tokens/validation preserved) into the
 * mockup layout below. Guarded to pageID 230 on boards 565/569.
 * ==========================================================================*/

/* Hide the engine's own chrome we replace — ONLY once the JS re-layout has
 * succeeded (.iwfsa-ready). If the JS aborts, the engine form stays visible and
 * fully functional. */
.iwfsa-apply.iwfsa-ready .pageheading,
.iwfsa-apply.iwfsa-ready #brsStepCount,
.iwfsa-apply.iwfsa-ready #steps,
.iwfsa-apply.iwfsa-ready table.Form,
.iwfsa-apply.iwfsa-ready .engine-mandatory-note { display: none !important; }

.iwfsa-apply { color: #222; }
.iwfsa-apply * { box-sizing: border-box; }

/* ── Header ── */
.iwfsa-apply .apply-header {
    background: #fafafa;
    padding: 24px 32px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 24px;
}
.iwfsa-apply .apply-back-link {
    display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px;
    font-size: 11px; color: #555; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; cursor: pointer; text-decoration: none;
}
.iwfsa-apply .apply-back-link:hover { color: #e05a2b; text-decoration: none; }
.iwfsa-apply .apply-title-row {
    display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 24px;
}
.iwfsa-apply .apply-title-row h1 {
    font-size: 22px; font-weight: 700; color: #000; margin-bottom: 6px; line-height: 1.2;
}
.iwfsa-apply .apply-title-row .meta { font-size: 12px; color: #666; }
.iwfsa-apply .apply-title-row .meta strong { color: #000; }
.iwfsa-apply .apply-title-row .meta .sep { margin: 0 8px; color: #ccc; }
.iwfsa-apply .apply-status {
    background: #fff; border: 1px solid #ddd; padding: 6px 12px; font-size: 11px;
    color: #666; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; white-space: nowrap;
}
.iwfsa-apply .apply-status .dot {
    display: inline-block; width: 8px; height: 8px; background: #e05a2b;
    border-radius: 50%; margin-right: 6px; vertical-align: middle;
}

/* ── Stepper ── */
.iwfsa-apply .stepper { display: flex; align-items: center; max-width: 840px; margin-bottom: 28px; }
.iwfsa-apply .step { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.iwfsa-apply .step .circle {
    width: 32px; height: 32px; border-radius: 50%; background: #fff; border: 2px solid #ddd;
    display: flex; align-items: center; justify-content: center; font-weight: 700; color: #aaa;
    font-size: 13px; transition: all 0.2s;
}
.iwfsa-apply .step .label {
    font-size: 11px; color: #999; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.4px; white-space: nowrap;
}
.iwfsa-apply .step.active .circle { background: #e05a2b; border-color: #e05a2b; color: #fff; }
.iwfsa-apply .step.active .label { color: #000; }
.iwfsa-apply .step.done .circle { background: #fff; border-color: #e05a2b; color: #e05a2b; }
.iwfsa-apply .step.done .label { color: #555; }
.iwfsa-apply .step-line {
    flex: 1; height: 2px; background: #ddd; margin: 0 14px; min-width: 30px; align-self: center;
}

/* ── Body / layout ── */
.iwfsa-apply .apply-body { background: #f7f7f7; padding: 30px 32px 50px; }
.iwfsa-apply .apply-layout {
    display: grid; grid-template-columns: 1fr 280px; gap: 24px; max-width: 1200px; margin: 0 auto;
    align-items: start;
}
.iwfsa-apply .apply-main { max-width: 880px; margin: 0; }

/* ── Sections ── */
.iwfsa-apply .form-section {
    background: #fff; border: 1px solid #e5e5e5; padding: 26px 32px 28px; margin-bottom: 14px;
}
.iwfsa-apply .form-section .section-head {
    margin-bottom: 22px; padding-bottom: 14px; border-bottom: 1px solid #f0f0f0;
    display: flex; align-items: baseline; gap: 14px;
}
.iwfsa-apply .form-section .section-head h2 {
    font-size: 13px; font-weight: 700; color: #000; text-transform: uppercase; letter-spacing: 0.5px; margin: 0;
}
.iwfsa-apply .form-section .section-head .section-sub { font-size: 12px; color: #888; }

.iwfsa-apply .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; }
.iwfsa-apply .field { display: flex; flex-direction: column; min-width: 0; }
.iwfsa-apply .field.full-width { grid-column: 1 / -1; }
.iwfsa-apply .field > label {
    font-size: 11px; color: #444; font-weight: 700; margin-bottom: 6px; text-transform: uppercase;
    letter-spacing: 0.4px; display: flex; align-items: center; gap: 4px;
}
.iwfsa-apply .field > label .req { color: #e05a2b; font-size: 13px; }

/* Normalise the transplanted engine controls to the mockup input style. */
.iwfsa-apply .field input[type="text"],
.iwfsa-apply .field input[type="tel"],
.iwfsa-apply .field input[type="email"],
.iwfsa-apply .field input[type="number"],
.iwfsa-apply .field select {
    width: 100%; border: 1px solid #ddd; padding: 10px 14px; font-size: 13px; font-family: inherit;
    background: #fff; outline: none; transition: border 0.15s, background 0.15s; color: #222;
    max-width: none; height: auto; border-radius: 0;
}
.iwfsa-apply .field input:hover, .iwfsa-apply .field select:hover { border-color: #aaa; }
.iwfsa-apply .field input:focus, .iwfsa-apply .field select:focus { border-color: #e05a2b; background: #fff; }
.iwfsa-apply .field input::placeholder { color: #bbb; }
.iwfsa-apply .field .hint { font-size: 11px; color: #999; margin-top: 5px; }
/* Engine wraps the Title select in a nested table — neutralise it. */
.iwfsa-apply .field table { border: 0; margin: 0; width: 100%; }
.iwfsa-apply .field table td { padding: 0; border: 0; }

.iwfsa-apply .field.inline-check { flex-direction: row; align-items: center; gap: 8px; padding: 4px 0; }
.iwfsa-apply .field.inline-check > label {
    margin: 0; font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; color: #555; cursor: pointer;
}
.iwfsa-apply .field.inline-check input[type="checkbox"] { width: 16px; height: 16px; margin: 0; padding: 0; cursor: pointer; }

.iwfsa-apply .info-link {
    display: inline-block; margin-top: 14px; font-size: 11px; color: #888; font-weight: 400; cursor: pointer;
    text-decoration: underline; text-decoration-color: #ddd; text-underline-offset: 2px;
}
.iwfsa-apply .info-link:hover { color: #555; text-decoration-color: #999; }

.iwfsa-apply .apply-legend {
    font-size: 11px; color: #888; margin-bottom: 14px; display: inline-flex; align-items: center; gap: 6px;
}
.iwfsa-apply .apply-legend .req { color: #e05a2b; font-weight: 700; }

/* ── Aside ── */
.iwfsa-apply .apply-aside { position: sticky; top: 20px; align-self: start; }
.iwfsa-apply .apply-aside-card { background: #fff; border: 1px solid #e5e5e5; padding: 20px; margin-bottom: 10px; }
.iwfsa-apply .apply-aside-card h3 {
    font-size: 11px; font-weight: 700; color: #000; text-transform: uppercase; letter-spacing: 0.5px;
    margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid #f0f0f0;
}
.iwfsa-apply .apply-aside-card .row { display: flex; justify-content: space-between; font-size: 12px; padding: 4px 0; color: #444; gap: 10px; }
.iwfsa-apply .apply-aside-card .row .lbl { color: #888; text-transform: uppercase; font-size: 10px; letter-spacing: 0.3px; font-weight: 700; }
.iwfsa-apply .apply-aside-card .row .val { font-weight: 500; color: #000; text-align: right; }
.iwfsa-apply .apply-aside-card .position-name { font-weight: 700; color: #000; font-size: 13px; margin-bottom: 14px; }
.iwfsa-apply .apply-progress-list { font-size: 12px; color: #444; line-height: 1.7; }
.iwfsa-apply .apply-progress-list .todo { color: #999; }
.iwfsa-apply .progress-note {
    background: #fff5ef; border-left: 3px solid #e05a2b; padding: 12px 14px; font-size: 12px; color: #5a3a2e; line-height: 1.55;
}
.iwfsa-apply .progress-note strong { color: #c94d22; }

/* ── Action bar ── */
.iwfsa-apply .form-actions {
    background: #fff; border: 1px solid #e5e5e5; padding: 18px 28px; display: flex;
    justify-content: space-between; align-items: center; margin-top: 14px;
}
.iwfsa-apply .form-actions .actions-right { display: flex; gap: 8px; }
.iwfsa-apply .btn-back-step,
.iwfsa-apply .form-actions input[type="button"] {
    padding: 10px 22px; font-size: 11px; font-weight: 700; cursor: pointer; text-transform: uppercase;
    letter-spacing: 0.5px; font-family: inherit; border: 1px solid; border-radius: 0; width: auto;
}
.iwfsa-apply .btn-back-step { background: #fff; color: #888; border-color: #ddd; }
.iwfsa-apply .btn-back-step:hover { border-color: #999; color: #000; }
.iwfsa-apply .btn-back-step[disabled] { opacity: 0.4; cursor: not-allowed; }
.iwfsa-apply .form-actions input.btn-save { background: #fff; color: #e05a2b; border-color: #e05a2b; }
.iwfsa-apply .form-actions input.btn-save:hover { background: #fff5ef; }
.iwfsa-apply .form-actions input.btn-next { background: #e05a2b; color: #fff; border-color: #e05a2b; }
.iwfsa-apply .form-actions input.btn-next:hover { background: #c94d22; }

/* ── CV upload ── */
.iwfsa-apply .cv-upload-section { margin-bottom: 14px; }
.iwfsa-apply .cv-upload-card {
    background: #fff; border: 2px dashed #d4d4d4; padding: 22px 28px; display: flex; align-items: center;
    gap: 18px; transition: all 0.2s;
}
.iwfsa-apply .cv-upload-card:hover, .iwfsa-apply .cv-upload-card.dragover { border-color: #e05a2b; background: #fff5ef; }
.iwfsa-apply .cv-upload-card .cv-icon {
    width: 48px; height: 48px; background: #fff5ef; border: 1px solid #fadcc8; display: flex;
    align-items: center; justify-content: center; color: #e05a2b; flex-shrink: 0;
}
.iwfsa-apply .cv-upload-card .cv-content { flex: 1; }
.iwfsa-apply .cv-upload-card .cv-content h3 {
    font-size: 13px; font-weight: 700; color: #000; margin: 0 0 4px; text-transform: uppercase; letter-spacing: 0.5px;
}
.iwfsa-apply .cv-preview-tag {
    display: inline-block; margin-left: 8px; padding: 2px 8px; font-size: 9px; font-weight: 700;
    letter-spacing: 0.6px; color: #666; background: #ececec; border: 1px solid #ddd; border-radius: 10px;
    vertical-align: middle;
}
.iwfsa-apply .cv-upload-card .cv-content p { font-size: 12px; color: #666; line-height: 1.5; margin: 0; }
.iwfsa-apply .cv-upload-btn {
    background: #e05a2b; color: #fff; padding: 10px 22px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer; border: 1px solid #e05a2b;
    transition: background 0.15s; font-family: inherit; flex-shrink: 0; display: inline-block;
}
.iwfsa-apply .cv-upload-btn:hover { background: #c94d22; border-color: #c94d22; }
.iwfsa-apply .cv-formats { font-size: 11px; color: #999; margin-top: 4px; }
.iwfsa-apply .cv-loading {
    background: #fff; border: 1px solid #fadcc8; padding: 18px 22px; display: flex; flex-direction: column; gap: 10px;
}
.iwfsa-apply .cv-loading-bar { width: 100%; height: 3px; background: #f5f5f5; position: relative; overflow: hidden; }
.iwfsa-apply .cv-loading-bar .bar {
    position: absolute; height: 100%; background: #e05a2b; width: 30%; animation: iwfsa-cv-anim 1.4s ease-in-out infinite;
}
@keyframes iwfsa-cv-anim { 0% { left: -30%; } 100% { left: 100%; } }
.iwfsa-apply .cv-loading-text { display: flex; align-items: center; gap: 14px; font-size: 12px; }
.iwfsa-apply .cv-loading-text .filename { font-weight: 700; color: #000; }
.iwfsa-apply .cv-loading-text .status { color: #c94d22; font-weight: 600; }
.iwfsa-apply .cv-success {
    background: #f4f4f4; border-left: 3px solid #999; padding: 14px 18px; display: flex; align-items: center;
    gap: 12px; font-size: 12px; color: #444;
}
.iwfsa-apply .cv-success .check {
    width: 22px; height: 22px; background: #888; color: #fff; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; font-style: italic;
}
.iwfsa-apply .cv-success strong { color: #000; }
.iwfsa-apply .cv-success .cv-replace {
    margin-left: auto; color: #777; font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.4px; cursor: pointer; text-decoration: none; flex-shrink: 0;
}
.iwfsa-apply .cv-success .cv-replace:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .iwfsa-apply .apply-layout { grid-template-columns: 1fr; }
    .iwfsa-apply .apply-aside { position: static; }
    .iwfsa-apply .form-grid { grid-template-columns: 1fr; }
    .iwfsa-apply .apply-header, .iwfsa-apply .apply-body { padding-left: 16px; padding-right: 16px; }
    .iwfsa-apply .apply-title-row { flex-direction: column; align-items: flex-start; gap: 12px; }
    .iwfsa-apply .cv-upload-card { flex-direction: column; text-align: center; }
}
