/* ============================================================
   Family 1st Homecare - Employee Hiring Package
   ============================================================ */

:root {
    --blue: #3a72b8;
    --blue-dark: #27548f;
    --blue-light: #eaf1fa;
    --orange: #f5a93f;
    --orange-dark: #d98c22;
    --ink: #1f2933;
    --muted: #6b7784;
    --line: #dde3ea;
    --bg: #f4f6f9;
    --white: #fff;
    --green: #1f9d55;
    --red: #d64545;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 6px 18px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
}

a { color: var(--blue); }

/* ---------- Layout ---------- */

.site-header {
    background: var(--white);
    border-bottom: 3px solid var(--orange);
    box-shadow: 0 1px 4px rgba(16, 24, 40, .06);
}

.site-header .inner,
.container {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-header .inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 14px;
    padding-bottom: 14px;
    flex-wrap: wrap;
}

.site-header img.logo { height: 52px; width: auto; }

.site-header .brand-text strong {
    display: block;
    font-size: 17px;
    color: var(--blue);
    letter-spacing: .2px;
}

.site-header .brand-text span {
    font-size: 12.5px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.site-header nav {
    margin-left: auto;
    display: flex;
    gap: 8px;
    align-items: center;
}

.site-footer {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    padding: 28px 20px 40px;
}

main { padding: 26px 0 50px; }

/* ---------- Cards & headings ---------- */

.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px;
    margin-bottom: 22px;
}

.card h2 {
    margin: 0 0 4px;
    font-size: 20px;
    color: var(--blue);
}

.card > p.lead {
    margin: 0 0 20px;
    color: var(--muted);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 26px 0 12px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--blue);
    border-bottom: 2px solid var(--blue-light);
    padding-bottom: 6px;
}

.section-title:first-child { margin-top: 0; }

/* ---------- Hero ---------- */

.hero {
    background: linear-gradient(135deg, var(--blue) 0%, #1f4a80 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 42px 34px;
    margin-bottom: 24px;
}

.hero h1 { margin: 0 0 10px; font-size: 30px; }
.hero p  { margin: 0 0 22px; max-width: 640px; opacity: .92; }

.steps-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.steps-preview div {
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13.5px;
}

.steps-preview b { display: block; color: var(--orange); }

/* ---------- Forms ---------- */

.grid { display: grid; gap: 14px 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.span-2 { grid-column: span 2; }
.span-full { grid-column: 1 / -1; }

.field label,
.field > span.label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #445;
}

.field .req { color: var(--red); }

input[type=text],
input[type=email],
input[type=tel],
input[type=date],
input[type=password],
input[type=number],
select,
textarea {
    width: 100%;
    padding: 9px 11px;
    font: inherit;
    font-size: 14px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #c8d1dc;
    border-radius: 7px;
    transition: border-color .15s, box-shadow .15s;
}

textarea { min-height: 80px; resize: vertical; }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(58, 114, 184, .16);
}

input.invalid, select.invalid, textarea.invalid {
    border-color: var(--red);
    background: #fff7f7;
}

.help { font-size: 12px; color: var(--muted); margin-top: 4px; }

.error-text {
    color: var(--red);
    font-size: 12.5px;
    margin-top: 4px;
    display: none;
}

.error-text.show { display: block; }

/* Checkbox / radio groups */

.choice-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
}

.choice {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border: 1px solid #c8d1dc;
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    font-size: 13.5px;
    user-select: none;
}

.choice:hover { border-color: var(--blue); }
.choice input { margin: 0; accent-color: var(--blue); }

.choice.checked {
    border-color: var(--blue);
    background: var(--blue-light);
    font-weight: 600;
}

/* Yes / No question rows */

.qrow {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 13px 15px;
    margin-bottom: 12px;
    background: #fcfdfe;
}

.qrow .qtext {
    font-size: 14px;
    margin-bottom: 9px;
}

.qrow .qdetail {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}

.qrow .qdetail.show { display: block; }

/* Repeating blocks */

.block {
    border: 1px solid var(--line);
    border-left: 4px solid var(--orange);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    background: #fcfdfe;
}

.block > h4 {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* ---------- Wizard ---------- */

.wizard-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}

.wizard-nav button {
    flex: 1 1 auto;
    min-width: 118px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 7px;
    padding: 8px 10px;
    font: inherit;
    font-size: 12.5px;
    color: var(--muted);
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wizard-nav button .num {
    flex: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e6ebf2;
    color: #66707c;
    font-size: 11.5px;
    font-weight: 700;
    display: grid;
    place-items: center;
}

.wizard-nav button.active {
    background: var(--blue-light);
    border-color: #c3d6ee;
    color: var(--blue);
    font-weight: 600;
}

.wizard-nav button.active .num { background: var(--blue); color: #fff; }
.wizard-nav button.done .num   { background: var(--green); color: #fff; }

.progress-bar {
    height: 6px;
    background: #e6ebf2;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 18px;
}

.progress-bar > i {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--blue), var(--orange));
    transition: width .3s ease;
}

.step { display: none; }
.step.active { display: block; }

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 20px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: 7px;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, box-shadow .15s;
}

.btn-primary  { background: var(--blue); color: #fff; }
.btn-primary:hover  { background: var(--blue-dark); }
.btn-accent   { background: var(--orange); color: #29323d; }
.btn-accent:hover   { background: var(--orange-dark); }
.btn-ghost    { background: #fff; color: var(--ink); border-color: #c8d1dc; }
.btn-ghost:hover    { background: #f3f6fa; }
.btn-danger   { background: var(--red); color: #fff; }
.btn-danger:hover   { background: #b93636; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Signature ---------- */

.sig-wrap {
    border: 2px dashed #b9c4d2;
    border-radius: 8px;
    background: #fff;
    padding: 8px;
    max-width: 520px;
}

.sig-wrap canvas {
    display: block;
    width: 100%;
    height: 160px;
    touch-action: none;
    cursor: crosshair;
    border-radius: 4px;
}

.sig-tools {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

/* ---------- Alerts ---------- */

.alert {
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid;
}

.alert-success { background: #edf9f1; border-color: #b7e4c7; color: #14532d; }
.alert-error   { background: #fdf0f0; border-color: #f3c2c2; color: #7f1d1d; }
.alert-info    { background: var(--blue-light); border-color: #c3d6ee; color: #1e3a5f; }
.alert-warning { background: #fff8e8; border-color: #f6dfae; color: #6b4a08; }

.alert ul { margin: 8px 0 0; padding-left: 20px; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

table.data th,
table.data td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

table.data th {
    background: #f7f9fc;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #5a6672;
    white-space: nowrap;
}

table.data tbody tr:hover { background: #fafcff; }

table.kv { width: 100%; border-collapse: collapse; font-size: 13.5px; }

table.kv th {
    width: 210px;
    text-align: left;
    font-weight: 600;
    color: #4a5563;
    background: #f7f9fc;
    padding: 8px 12px;
    border: 1px solid var(--line);
    vertical-align: top;
}

table.kv td {
    padding: 8px 12px;
    border: 1px solid var(--line);
    vertical-align: top;
}

/* ---------- Badges ---------- */

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
}

.badge-new          { background: #e3f0ff; color: #12508f; }
.badge-under_review { background: #fff3d9; color: #8a5a00; }
.badge-shortlisted  { background: #ede4ff; color: #4b2c92; }
.badge-hired        { background: #e0f6e9; color: #10693a; }
.badge-rejected     { background: #fde5e5; color: #96201f; }

/* ---------- Stats ---------- */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.stat {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
}

.stat .n { font-size: 27px; font-weight: 700; color: var(--blue); line-height: 1.15; }
.stat .l { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }

/* ---------- Admin shell ---------- */

.admin-header {
    background: var(--blue);
    color: #fff;
}

.admin-header .inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.admin-header .inner img { height: 34px; background: #fff; border-radius: 5px; padding: 3px 5px; }
.admin-header .title { font-weight: 700; font-size: 15px; }

.admin-header nav {
    margin-left: auto;
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.admin-header nav a {
    color: #dce8f7;
    text-decoration: none;
    font-size: 13.5px;
    padding: 7px 12px;
    border-radius: 6px;
}

.admin-header nav a:hover { background: rgba(255, 255, 255, .13); color: #fff; }
.admin-header nav a.active { background: rgba(255, 255, 255, .2); color: #fff; font-weight: 600; }

.admin-container { max-width: 1160px; margin: 0 auto; padding: 24px 20px 60px; }

.page-head {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.page-head h1 { margin: 0; font-size: 22px; }
.page-head .spacer { margin-left: auto; }

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #27548f 0%, #1b3a63 100%);
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
    padding: 34px 32px;
    width: 100%;
    max-width: 400px;
}

.login-card img { display: block; height: 60px; margin: 0 auto 14px; }
.login-card h1 { text-align: center; font-size: 19px; margin: 0 0 4px; color: var(--blue); }
.login-card p.sub { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 22px; }

/* ---------- Filters ---------- */

.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 15px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}

.filters .field { flex: 1 1 170px; }

/* ---------- Pagination ---------- */

.pagination {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    text-decoration: none;
    font-size: 13px;
    color: var(--ink);
}

.pagination .current { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.pagination .disabled { opacity: .45; }

/* ---------- Success page ---------- */

.success-box { text-align: center; padding: 20px 10px 6px; }

.success-box .check {
    width: 74px;
    height: 74px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #e0f6e9;
    color: var(--green);
    font-size: 40px;
    display: grid;
    place-items: center;
}

.ref-box {
    display: inline-block;
    background: var(--blue-light);
    border: 1px dashed #9dbde3;
    border-radius: 8px;
    padding: 12px 26px;
    margin: 8px 0 20px;
}

.ref-box .l { font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.ref-box .v { font-size: 22px; font-weight: 700; color: var(--blue); letter-spacing: 1px; }

/* ---------- Print ---------- */

@media print {
    .site-header, .site-footer, .form-actions, .wizard-nav, .no-print { display: none !important; }
}

/* ---------- Responsive ---------- */

@media (max-width: 780px) {
    .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .hero { padding: 30px 22px; }
    .hero h1 { font-size: 24px; }
    .card { padding: 18px; }
    table.kv th { width: 40%; }
}
