/* ─── Reset & Variables ──────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy:      #0d1b4b;
    --navy-mid:  #1a2f7a;
    --red:       #c62828;
    --red-light: #ffebee;
    --green:     #2e7d32;
    --green-light:#e8f5e9;
    --orange:    #e65100;
    --orange-light:#fff3e0;
    --blue:      #1565c0;
    --blue-light:#e3f2fd;
    --purple:    #6a1b9a;
    --purple-light:#f3e5f5;
    --grey-100:  #f4f6fb;
    --grey-200:  #e8ecf4;
    --grey-300:  #d0d7e8;
    --grey-500:  #8a95b0;
    --grey-700:  #4a5270;
    --grey-900:  #1a1f36;
    --white:     #ffffff;
    --nav-h:     60px;
    --header-h:  56px;
    --radius:    12px;
    --radius-sm: 8px;
    --shadow:    0 2px 8px rgba(13,27,75,.10);
    --shadow-md: 0 4px 16px rgba(13,27,75,.14);
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--grey-100);
    color: var(--grey-900);
    font-size: 15px;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
}

#app { min-height: 100vh; }

/* ─── Full-screen layout ─────────────────────────── */
.resp-screen {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

/* ─── Header ─────────────────────────────────────── */
.resp-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--navy);
    color: var(--white);
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    font-size: 16px;
    font-weight: 700;
}

.resp-header-brand { display: flex; align-items: center; gap: 10px; flex: 1; font-size: 18px; }
.resp-icon { width: 32px; height: 32px; border-radius: 8px; }

.back-btn {
    background: none;
    border: none;
    color: var(--white);
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px 4px 0;
    flex-shrink: 0;
}

/* ─── Bottom Nav ─────────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--nav-h);
    background: var(--white);
    border-top: 1px solid var(--grey-200);
    display: flex;
    z-index: 100;
    box-shadow: 0 -2px 8px rgba(13,27,75,.08);
}

.bnav-item {
    flex: 1;
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--grey-500);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: color .15s;
}
.bnav-item svg { width: 22px; height: 22px; }
.bnav-item.active { color: var(--navy); }

/* ─── Scrollable content area ────────────────────── */
.detail-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0 0 calc(var(--nav-h) + 16px);
    -webkit-overflow-scrolling: touch;
}

/* ─── Job Cards ──────────────────────────────────── */
.jobs-list {
    padding: 12px 12px calc(var(--nav-h) + 16px);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.job-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--grey-300);
}

.job-card-pending { border-left-color: var(--orange); }

.job-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.job-ref {
    font-weight: 700;
    font-family: monospace;
    font-size: 14px;
    color: var(--navy);
}

.job-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 10px;
}

.job-cat  { font-weight: 600; color: var(--grey-700); }
.job-loc  { font-size: 13px; color: var(--grey-500); }

.job-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.job-actions { display: flex; gap: 8px; }

/* ─── Detail sections ────────────────────────────── */
.detail-section {
    background: var(--white);
    margin: 10px 12px 0;
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow);
}

.section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--grey-500);
    margin-bottom: 10px;
}

.kv-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 5px 0;
    border-bottom: 1px solid var(--grey-200);
    gap: 12px;
    font-size: 14px;
}
.kv-row:last-child { border-bottom: none; }
.kv-row > span:first-child { color: var(--grey-500); white-space: nowrap; flex-shrink: 0; }
.kv-row.full { flex-direction: column; gap: 4px; }
.kv-row.full > span:first-child { margin-bottom: 2px; }

.flag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.flag { background: var(--blue-light); color: var(--blue); border-radius: 20px; padding: 3px 10px; font-size: 12px; font-weight: 600; }
.flag-red { background: var(--red-light); color: var(--red); }

.call-link { color: var(--blue); font-weight: 700; text-decoration: none; }

.action-section { display: flex; flex-direction: column; gap: 10px; }

.action-row { display: flex; gap: 10px; }
.btn-half { flex: 1; justify-content: center; }
.field-row { display: flex; flex-direction: column; gap: 4px; }
.input-full {
    width: 100%;
    padding: 10px;
    border: 1.5px solid var(--grey-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    resize: none;
}

.action-msg-bar {
    margin: 0 12px 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.msg-success { background: var(--green-light); color: var(--green); }
.msg-error   { background: var(--red-light);   color: var(--red);   }

.map-link-btn {
    display: inline-block;
    background: var(--blue-light);
    color: var(--blue);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    margin-top: 4px;
}

/* ─── Profile ────────────────────────────────────── */
.profile-hero {
    background: linear-gradient(160deg, var(--navy) 0%, var(--navy-mid) 100%);
    color: var(--white);
    padding: 24px 16px;
    text-align: center;
}

.profile-avatar {
    width: 64px; height: 64px;
    background: rgba(255,255,255,.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 700;
    margin: 0 auto 10px;
}

.profile-hero h2 { font-size: 20px; margin-bottom: 8px; }

.text-green { color: var(--green); font-weight: 600; }
.text-red   { color: var(--red);   font-weight: 600; }

/* ─── Auth ───────────────────────────────────────── */
.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: linear-gradient(160deg, var(--navy) 0%, var(--navy-mid) 55%, #c62828 100%);
    padding: 40px 16px 20px;
}

.auth-box {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 28px 22px;
    width: 100%;
    max-width: 400px;
}

.auth-box-wide { max-width: 480px; }

.auth-brand { text-align: center; margin-bottom: 24px; }
.auth-logo  { width: 160px; height: auto; display: block; margin: 0 auto 12px; }
.auth-brand h1 { font-size: 22px; font-weight: 800; color: var(--navy); }
.auth-brand p  { font-size: 13px; color: var(--grey-500); margin-top: 4px; }

.auth-switch {
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--grey-700);
}

.btn-link {
    background: none;
    border: none;
    color: var(--blue);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

/* ─── Pending ────────────────────────────────────── */
.pending-icon { font-size: 48px; margin-bottom: 12px; }

.pending-steps {
    text-align: left;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pstep {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
}
.pstep-done { background: var(--green-light); color: var(--green); }
.pstep-wait { background: var(--grey-100);    color: var(--grey-500); }

/* ─── Buttons ────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    white-space: nowrap;
    font-family: inherit;
}
.btn:active   { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--navy);  color: var(--white); }
.btn-outline { background: var(--white); border: 1.5px solid var(--grey-300); color: var(--grey-700); }
.btn-success { background: var(--green); color: var(--white); }
.btn-danger  { background: var(--red);   color: var(--white); }
.btn-sm      { padding: 7px 14px; font-size: 13px; }
.btn-full    { width: 100%; margin-top: 6px; }

/* ─── Forms ──────────────────────────────────────── */
.form-group { margin-bottom: 13px; }
.form-group label { display: block; font-size: 12px; font-weight: 700; color: var(--grey-700); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .4px; }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1.5px solid var(--grey-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--grey-900);
    background: var(--white);
    outline: none;
    transition: border-color .2s;
    font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--navy); }
.form-group textarea { resize: none; }

/* ─── Alerts ─────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 12px; }
.alert-error   { background: var(--red-light);  color: var(--red);  border-left: 3px solid var(--red); }
.alert-success { background: var(--green-light); color: var(--green); border-left: 3px solid var(--green); }

/* ─── Status Pills ───────────────────────────────── */
.status-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
}
.status-grey   { background: var(--grey-200);    color: var(--grey-700); }
.status-orange { background: var(--orange-light); color: var(--orange); }
.status-blue   { background: var(--blue-light);   color: var(--blue); }
.status-purple { background: var(--purple-light); color: var(--purple); }
.status-green  { background: var(--green-light);  color: var(--green); }
.status-red    { background: var(--red-light);    color: var(--red); }

/* ─── Badges ─────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 7px; border-radius: 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.badge-red  { background: var(--red-light);  color: var(--red); }
.badge-grey { background: var(--grey-200);   color: var(--grey-700); }

/* ─── Availability Toggle ────────────────────────── */
.avail-toggle {
    margin-left: auto;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: background .2s;
}
.avail-on  { background: var(--green-light); color: var(--green); }
.avail-off { background: rgba(255,255,255,.15); color: rgba(255,255,255,.75); }

/* ─── States ─────────────────────────────────────── */
.loading-row { padding: 48px 16px; text-align: center; color: var(--grey-500); }
.error-row   { padding: 32px 16px; text-align: center; color: var(--red); }
.empty-jobs  { padding: 60px 20px; text-align: center; }
.empty-icon  { font-size: 40px; margin-bottom: 12px; }
.muted       { color: var(--grey-500); font-size: 13px; }

/* ─── Auth box wide (registration) ──────────────── */
.auth-box-wide { max-width: 560px; }

/* ─── Form layout ────────────────────────────────── */
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; min-width: 0; }
.btn-row  { display: flex; gap: 10px; margin-top: 16px; }
.btn-half { flex: 1; }
.btn-full { width: 100%; }
.btn-link { background: none; border: none; color: var(--blue); cursor: pointer; font-size: 14px; padding: 0; text-decoration: underline; }
.info-card { background: #e3f2fd; border-radius: 8px; padding: 10px 14px; font-size: 13px; color: #1e3a8a; display: flex; align-items: center; gap: 8px; }

/* ─── Registration steps ─────────────────────────── */
.reg-steps { display: flex; align-items: center; margin: 20px 0 24px; }
.reg-step  { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }
.reg-step-num   { width: 28px; height: 28px; border-radius: 50%; background: var(--grey-200); color: var(--grey-500); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.reg-step-label { font-size: 11px; color: var(--grey-500); white-space: nowrap; }
.reg-step.active .reg-step-num { background: var(--navy); color: #fff; }
.reg-step.active .reg-step-label { color: var(--navy); font-weight: 600; }
.reg-step.done .reg-step-num { background: var(--green); color: #fff; }
.reg-step.done .reg-step-label { color: var(--green); }
.reg-step-line { flex: 1; height: 2px; background: var(--grey-200); margin: 0 4px; margin-bottom: 16px; }

/* ─── Success icon ───────────────────────────────── */
.success-icon { width: 56px; height: 56px; border-radius: 50%; background: #d1fae5; color: #065f46; font-size: 24px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }

/* ─── Document upload rows ───────────────────────── */
.doc-upload-list { display: flex; flex-direction: column; gap: 8px; }
.doc-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--grey-200); border-radius: 10px; background: #fff; }
.doc-row-left { display: flex; align-items: center; gap: 12px; }
.doc-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--grey-100); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--grey-700); flex-shrink: 0; }
.doc-label { font-size: 14px; font-weight: 500; }
.doc-status { font-size: 12px; margin-top: 2px; min-height: 16px; }

/* ─── Pending / status page ──────────────────────── */
.pnd-header { text-align: center; margin-bottom: 20px; }
.pnd-header h1 { font-size: 22px; margin: 8px 0 6px; }
.pnd-header p  { color: var(--grey-700); font-size: 14px; }
.pnd-status-badge { display: inline-block; padding: 4px 14px; border-radius: 20px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.pnd-section { margin-top: 20px; }
.pnd-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--grey-500); margin-bottom: 10px; }
.pnd-hint { font-size: 13px; color: var(--grey-700); margin-bottom: 10px; }
.pnd-rejection-card { background: #fff5f5; border: 1px solid #fecaca; border-radius: 10px; padding: 14px; margin-top: 16px; }
.pnd-rejection-title { font-weight: 700; color: var(--red); font-size: 13px; margin-bottom: 6px; }
.pnd-approved-card { background: #f0fdf4; border: 1px solid #86efac; border-radius: 12px; padding: 20px; text-align: center; margin-top: 16px; }
.pnd-approved-icon { font-size: 36px; margin-bottom: 8px; }
.pnd-approved-title { font-size: 18px; font-weight: 700; color: #065f46; margin-bottom: 6px; }

/* ─── Form feedback messages ─────────────────────── */
.form-msg { padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-top: 8px; }
.form-msg-ok  { background: var(--green-light); color: var(--green); }
.form-msg-err { background: var(--red-light);   color: var(--red); }

/* ─── Badge variants ─────────────────────────────── */
.badge-green { background: #d1fae5; color: #065f46; }

/* ─── Alert ──────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: 8px; font-size: 14px; margin: 8px 0; }
.alert-error { background: var(--red-light); color: var(--red); }
