/* New candidate apply flow - candidate/apply_*.php.
   Ported from pageindexing/signup_preview.html, signup_details_preview.html
   and profile_form_preview.html. Everything is scoped under .af-page so it
   cannot change any other page on the site. */

.af-page{
    --navy:#071C3A;
    --gold-dark:#b59020;
    --blue:#175DA8;
    --blue-dark:#124a87;
    --blue-light:#CBDDF6;
    --text-muted:#888888;
    --border:#DCE1E8;
    --green:#1DA362;
    --red:#D64545;
    font-family:'Poppins', sans-serif;
    background:#F8F9FB;
    min-height:100vh;
    padding:110px 16px 60px; /* offsets the site's fixed navbar */
    color:var(--navy);
}
.af-page *{ box-sizing:border-box; }
.af-page .hidden{ display:none !important; }

/* ---------- modal card (signup + signup details) ---------- */
.af-modal{
    position:relative;
    background:#fff;
    width:100%;
    max-width:400px;
    margin:0 auto;
    border-radius:16px;
    box-shadow:0 12px 40px rgba(7,28,58,0.18);
    padding:32px 28px 26px;
}
.af-close{
    position:absolute; top:14px; right:14px;
    width:32px; height:32px;
    border:none; background:transparent;
    color:var(--navy); font-size:22px; line-height:1;
    border-radius:50%; cursor:pointer; text-decoration:none;
    display:flex; align-items:center; justify-content:center;
}
.af-close:hover{ background:#F1F3F6; color:var(--navy); }
.af-page h1{
    font-size:22px; font-weight:600; color:var(--navy);
    margin:4px 0 6px; text-align:center;
}
.af-subtext{ font-size:14px; color:var(--text-muted); margin:0 0 20px; text-align:center; }
.af-subtext a{ color:var(--blue); font-weight:500; text-decoration:none; }
.af-subtext a:hover{ text-decoration:underline; }
.af-job-pill{
    font-size:12.5px; color:var(--blue); background:var(--blue-light);
    border-radius:20px; padding:6px 12px; margin:0 auto 18px;
    width:fit-content; max-width:100%; text-align:center;
}

/* signup choice buttons */
.af-oauth-col{ display:flex; flex-direction:column; gap:10px; margin-bottom:14px; }
.af-oauth-btn{
    width:100%; display:flex; align-items:center; justify-content:center; gap:8px;
    padding:12px 14px; min-height:46px;
    border:1px solid var(--border); border-radius:10px;
    background:#fff; color:var(--navy);
    font-family:inherit; font-size:14.5px; font-weight:500;
    cursor:pointer; text-decoration:none;
    transition:border-color .15s, background .15s;
}
.af-oauth-btn:hover{ border-color:var(--blue); background:#F7FAFD; color:var(--navy); }
.af-oauth-btn svg{ width:18px; height:18px; flex-shrink:0; }

.af-primary-btn{
    width:100%; display:block; text-align:center;
    padding:12px 14px; min-height:48px;
    border:none; border-radius:10px;
    background:var(--blue); color:#fff;
    font-family:inherit; font-size:15.5px; font-weight:600;
    cursor:pointer; text-decoration:none;
    margin:6px 0 14px;
    transition:background .15s;
}
.af-primary-btn:hover{ background:var(--blue-dark); color:#fff; }
.af-primary-btn:disabled{ background:#9DB6D3; cursor:not-allowed; }

.af-terms{ font-size:12.5px; color:var(--text-muted); line-height:1.5; margin:0; text-align:center; }
.af-terms a{ color:var(--gold-dark); font-weight:600; text-decoration:none; }

.af-via-pill{
    display:flex; align-items:center; justify-content:center; gap:6px;
    margin:10px auto 18px; padding:7px 12px;
    background:var(--blue-light); border-radius:20px;
    font-size:12.5px; color:var(--blue); font-weight:500; width:fit-content;
}

/* ---------- form fields ---------- */
.af-field{ margin-bottom:16px; text-align:left; }
.af-field > label{ display:block; font-size:13px; font-weight:500; color:var(--navy); margin-bottom:6px; }
.af-req{ color:var(--red); }
.af-verified{
    display:inline-flex; align-items:center; gap:3px;
    margin-left:6px; font-size:11px; font-weight:600; color:var(--green);
}
.af-page input[type=text],
.af-page input[type=tel],
.af-page input[type=email],
.af-page input[type=password],
.af-page input[type=number],
.af-page select,
.af-page textarea{
    width:100%; padding:11px 14px;
    border:1px solid var(--border); border-radius:9px;
    font-family:inherit; font-size:14px; color:var(--navy); background:#fff;
}
.af-page input::placeholder,
.af-page textarea::placeholder{ color:#AEB6C2; }
.af-page input:focus,
.af-page select:focus,
.af-page textarea:focus{ outline:none; border-color:var(--blue); }
.af-page input[readonly]{ background:#F3F6FA; color:#5A6472; cursor:not-allowed; }
.af-page textarea{ resize:vertical; min-height:70px; }
.af-page select{ appearance:none; padding-right:36px; cursor:pointer; }
.af-select-wrap{ position:relative; }
.af-select-wrap::after{
    content:""; position:absolute; right:14px; top:50%;
    width:9px; height:9px;
    border-right:2px solid var(--text-muted); border-bottom:2px solid var(--text-muted);
    transform:translateY(-65%) rotate(45deg); pointer-events:none;
}
.af-input-wrap{ position:relative; }
.af-phone-wrap{ display:flex; }
.af-country-code{
    display:flex; align-items:center; padding:0 10px;
    border:1px solid var(--border); border-right:none; border-radius:9px 0 0 9px;
    background:#F7F9FB; font-size:14px; white-space:nowrap;
}
.af-phone-wrap input{ border-radius:0 9px 9px 0 !important; }
.af-eye{
    position:absolute; right:10px; top:50%; transform:translateY(-50%);
    background:none; border:none; color:var(--text-muted); cursor:pointer; font-size:12px;
}

.af-radio-row{ display:flex; gap:22px; flex-wrap:wrap; }
.af-radio{ display:flex; align-items:center; gap:7px; cursor:pointer; font-size:14px; }
.af-radio input{ width:17px; height:17px; accent-color:var(--blue); }

/* OTP */
.af-otp-btn{
    width:100%; padding:11px; min-height:44px;
    border:1px solid var(--blue); border-radius:9px;
    background:#fff; color:var(--blue);
    font-family:inherit; font-size:14.5px; font-weight:600; cursor:pointer;
}
.af-otp-btn:disabled{ color:#AEB6C2; border-color:var(--border); cursor:not-allowed; }
.af-otp-row{ display:flex; gap:8px; margin-top:10px; }
.af-otp-row input{ letter-spacing:4px; text-align:center; }
.af-otp-row button{ flex-shrink:0; width:auto; padding:0 16px; margin:0; min-height:44px; }

.af-note{ font-size:12.5px; color:var(--text-muted); margin:8px 0 0; text-align:center; min-height:1em; }
.af-note.warn{ color:var(--red); font-weight:500; }
.af-note.ok{ color:var(--green); font-weight:500; }

/* ---------- profile form page ---------- */
.af-progress{
    max-width:520px; margin:0 auto 18px;
    display:flex; align-items:center; gap:12px;
    font-size:13px; color:var(--text-muted);
}
.af-progress .af-track{ flex:1; height:6px; background:#EEF1F5; border-radius:6px; overflow:hidden; }
.af-progress .af-fill{ height:100%; background:var(--blue); border-radius:6px; }
.af-progress .af-pct{ font-weight:700; color:var(--blue); }
.af-wrap{ max-width:520px; margin:0 auto; }
.af-card{ background:#fff; border-radius:14px; box-shadow:0 4px 18px rgba(7,28,58,0.08); padding:24px 22px; }

.af-suggest{
    list-style:none; margin:4px 0 0; padding:0;
    border:1px solid var(--border); border-radius:9px; background:#fff;
    box-shadow:0 6px 18px rgba(7,28,58,0.1);
    max-height:180px; overflow-y:auto; display:none;
}
.af-suggest.show{ display:block; }
.af-suggest li{ padding:9px 14px; font-size:13.5px; cursor:pointer; border-bottom:1px solid #F1F3F6; }
.af-suggest li:hover{ background:#F7FAFD; }

.af-dropzone{
    display:block; border:1.5px dashed var(--blue); border-radius:10px;
    padding:18px 14px; text-align:center; cursor:pointer;
}
.af-dropzone:hover{ background:#F7FAFD; }
.af-dropzone .af-dz-title{ color:var(--blue); font-weight:600; font-size:14px; }
.af-dropzone .af-dz-sub{ color:var(--text-muted); font-size:12px; }
.af-file-chip{
    display:none; align-items:center; gap:8px; margin-top:10px;
    padding:8px 12px; background:#F3F6FA; border-radius:8px; font-size:13px;
}
.af-file-chip.show{ display:flex; }
.af-file-chip button{ margin-left:auto; background:none; border:none; color:var(--red); cursor:pointer; font-size:15px; }

.af-error-box{
    display:none; margin:0 0 14px; padding:10px 12px;
    background:#FDECEC; border:1px solid #F5C2C2; border-radius:8px;
    color:#A12B2B; font-size:13px;
}
.af-error-box.show{ display:block; }

/* ---------- submit / done ---------- */
.af-center{ text-align:center; }
.af-tick{
    width:56px; height:56px; margin:0 auto 12px; border-radius:50%;
    background:#E4F6EC; color:var(--green);
    display:flex; align-items:center; justify-content:center; font-size:28px;
}
.af-external-box{
    margin:16px 0; padding:14px; border-radius:10px;
    background:#FFF8E6; border:1px solid #F0DDA4; font-size:13.5px; text-align:left;
}
.af-secondary-link{ display:block; text-align:center; font-size:14px; color:var(--blue); text-decoration:none; margin-top:4px; }
.af-spinner{
    width:36px; height:36px; margin:10px auto 16px;
    border:3px solid var(--blue-light); border-top-color:var(--blue);
    border-radius:50%; animation:af-spin 1s linear infinite;
}
@keyframes af-spin{ to{ transform:rotate(360deg); } }

/* Mobile: the modal becomes a full-width bottom sheet, like the mockup. */
@media (max-width:480px){
    .af-page{ padding:96px 12px 40px; }
    .af-modal{ padding:28px 18px 22px; border-radius:18px; }
    .af-page h1{ font-size:19px; }
    .af-card{ padding:20px 16px; }
}
