:root {
    --blue-900: #0b1f5e;
    --blue-700: #0f62fe;
    --blue-600: #2563eb;
    --sky-400: #38bdf8;
    --ink: #172033;
    --muted: #5d6b82;
    --line: #dbe7f5;
    --surface: #ffffff;
    --soft: #eef6ff;
}

* {
    box-sizing: border-box;
}

body.public-body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, .22), transparent 28rem),
        linear-gradient(180deg, #f6fbff 0%, #eef6ff 42%, #ffffff 100%);
}

.public-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, .88);
    border-bottom: 1px solid rgba(219, 231, 245, .8);
    backdrop-filter: blur(14px);
}

.public-nav {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand,
.nav-links a,
.secondary-button,
.back-link {
    color: inherit;
    text-decoration: none;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.12rem;
}

.brand-mark {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--blue-700), var(--sky-400));
    box-shadow: 0 12px 24px rgba(15, 98, 254, .24);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links a {
    padding: 10px 12px;
    color: #30405b;
    font-weight: 700;
}

.nav-links a:hover {
    color: var(--blue-700);
}

.nav-links .login-link {
    color: #fff;
    background: var(--blue-600);
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(37, 99, 235, .22);
}

.hero {
    padding: 72px 16px 54px;
}

.hero-content {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 64px;
    overflow: hidden;
    border-radius: 24px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(15, 98, 254, .96), rgba(37, 99, 235, .92) 48%, rgba(56, 189, 248, .9)),
        #0f62fe;
    box-shadow: 0 28px 70px rgba(15, 98, 254, .26);
}

.hero-kicker,
.section-kicker {
    margin: 0 0 12px;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero h1 {
    max-width: 720px;
    margin: 0;
    font-size: clamp(2.35rem, 5vw, 4.75rem);
    line-height: 1.03;
    letter-spacing: 0;
}

.hero-subtitle {
    max-width: 620px;
    margin: 20px 0 34px;
    font-size: 1.18rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, .9);
}

.search-panel {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) auto;
    gap: 14px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 20px 50px rgba(11, 31, 94, .22);
}

.field label {
    display: block;
    margin: 0 0 7px;
    color: #43526b;
    font-size: .82rem;
    font-weight: 800;
}

.field input,
.field select {
    width: 100%;
    height: 48px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    background: #fff;
    font: inherit;
}

.field input:focus,
.field select:focus {
    outline: 3px solid rgba(56, 189, 248, .28);
    border-color: var(--blue-600);
}

.primary-button,
.secondary-button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    border: 0;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
}

.primary-button {
    align-self: end;
    color: #fff;
    background: var(--blue-600);
}

.primary-button:hover,
.secondary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(37, 99, 235, .22);
}

.jobs-section {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0 76px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.section-kicker {
    color: var(--blue-700);
}

.section-heading h2 {
    margin: 0;
    font-size: 2rem;
}

.section-heading p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.jobs-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.job-card,
.empty-state,
.job-detail article {
    background: var(--surface);
    border: 1px solid rgba(219, 231, 245, .95);
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(23, 32, 51, .08);
}

.job-card {
    display: flex;
    min-height: 330px;
    flex-direction: column;
    padding: 22px;
}

.job-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.job-card h3 {
    margin: 0 0 8px;
    font-size: 1.17rem;
    line-height: 1.35;
}

.company-name,
.job-location,
.job-description {
    color: var(--muted);
}

.company-name,
.job-location {
    margin: 0;
    font-weight: 700;
}

.job-location {
    margin-top: 18px;
}

.job-description {
    line-height: 1.6;
}

.date-pill,
.badge {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
}

.date-pill {
    padding: 0 10px;
    color: #0b4cc2;
    background: #e8f2ff;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.badge {
    padding: 0 11px;
    color: var(--blue-900);
    background: #e6f7ff;
    border: 1px solid #bee9ff;
}

.badge-soft {
    color: #21456a;
    background: #f2f7fc;
    border-color: #dbe7f5;
}

.job-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.salary {
    color: var(--ink);
    font-weight: 800;
}

.secondary-button {
    color: #fff;
    background: var(--blue-700);
}

.empty-state {
    padding: 42px;
    text-align: center;
}

.empty-state h3,
.empty-state h1 {
    margin: 0 0 10px;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
}

.public-footer {
    border-top: 1px solid var(--line);
    background: #fff;
}

.public-footer div {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
}

.job-detail-hero {
    width: min(980px, calc(100% - 32px));
    margin: 48px auto 24px;
    padding: 54px;
    border-radius: 20px;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, var(--blue-700), var(--blue-600), var(--sky-400));
    box-shadow: 0 24px 60px rgba(15, 98, 254, .24);
}

.job-detail-hero h1 {
    margin: 14px 0 10px;
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 1.08;
}

.job-detail-hero p {
    margin: 0 0 22px;
    color: rgba(255, 255, 255, .9);
    font-size: 1.1rem;
}

.back-link {
    color: #fff;
    font-weight: 800;
}

.centered {
    justify-content: center;
}

.job-detail {
    width: min(900px, calc(100% - 32px));
    margin: 0 auto 72px;
    display: grid;
    gap: 16px;
}

.job-detail article {
    padding: 28px;
}

.job-detail h2 {
    margin: 0 0 12px;
}

.job-detail p {
    margin: 0;
    color: #41506a;
    line-height: 1.75;
}

.inline-button {
    margin-top: 20px;
    text-decoration: none;
}

.public-apply-modal {
    width: min(680px, calc(100% - 28px));
    max-height: 86vh;
    overflow: auto;
    border: 0;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}

.public-apply-modal::backdrop {
    background: rgba(15, 23, 42, .45);
}

.field-label {
    display: block;
    margin: 0 0 12px;
    color: #334155;
    font-weight: 800;
    font-size: 13px;
}

.field-label span {
    display: block;
    margin-bottom: 6px;
}

.field-label input,
.field-label textarea {
    width: 100%;
    padding: 11px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font: inherit;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.modal-actions button[type="button"] {
    background: #64748b;
}

.apply-success {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    font-weight: 800;
}

.upload-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, .58);
    color: #fff;
}

.upload-box {
    width: min(360px, calc(100% - 32px));
    padding: 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0f62fe, #38bdf8);
    box-shadow: 0 24px 70px rgba(15, 23, 42, .35);
    text-align: center;
    font-weight: 800;
}

.upload-spinner {
    width: 42px;
    height: 42px;
    margin: 0 auto 14px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.apply-button {
    gap: 8px;
    background: #38bdf8;
    color: #06233a;
}

.apply-button:hover {
    background: #7dd3fc;
}

.apply-button span {
    display: inline-grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, .7);
    font-size: 18px;
    line-height: 1;
}

@media (max-width: 920px) {
    .hero-content {
        padding: 42px 24px;
    }

    .search-panel,
    .jobs-grid {
        grid-template-columns: 1fr;
    }

    .primary-button {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .public-nav,
    .nav-links,
    .section-heading,
    .job-card-footer,
    .public-footer div {
        align-items: stretch;
        flex-direction: column;
    }

    .public-nav {
        padding: 12px 0;
    }

    .nav-links {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        text-align: center;
    }

    .hero {
        padding-top: 28px;
    }

    .hero-content,
    .job-detail-hero {
        border-radius: 16px;
    }

    .job-card-footer .secondary-button {
        width: 100%;
    }
}
