/*
 * Public applicant portal (layouts/portal.blade.php). Colours come from the
 * organisation settings via CSS variables (partials/brand-head.blade.php).
 */

:root {
    --portal-ink: #1f2a1f;
    --portal-muted: #5c665c;
    --portal-bg: #f6f8f5;
    --portal-line: #e3e8e1;
    --portal-radius: 14px;
}

body.portal {
    background: var(--portal-bg);
    color: var(--portal-ink);
    font-family: 'Mulish', 'Segoe UI', Roboto, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    display: flex; flex-direction: column; min-height: 100vh;
}
body.portal main { flex: 1 0 auto; }
body.portal a:not(.btn) { color: var(--brand-primary-dark); }
body.portal :is(h1, h2, h3, h4) { font-weight: 800; letter-spacing: -.01em; color: var(--portal-ink); }

.portal-skip { position: absolute; left: 1rem; top: .5rem; z-index: 2000; background: #fff; padding: .5rem 1rem; border-radius: 8px; }

/* Buttons */
.btn-brand, .btn-outline-brand, .btn-accent {
    font-weight: 700; border-radius: 10px; padding: .6rem 1.15rem; border-width: 2px;
}
.btn-brand { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-primary-dark); border-color: var(--brand-primary-dark); color: #fff; }
.btn-outline-brand { background: transparent; border-color: var(--brand-primary); color: var(--brand-primary-dark); }
.btn-outline-brand:hover, .btn-outline-brand:focus { background: var(--brand-primary); color: #fff; }
.btn-accent { background: var(--brand-accent); border-color: var(--brand-accent); color: #fff; }
.btn-accent:hover, .btn-accent:focus { background: var(--brand-accent-dark); border-color: var(--brand-accent-dark); color: #fff; }
.btn-light-on-dark { background: #fff; color: var(--brand-primary-dark); border: 2px solid #fff; font-weight: 700; border-radius: 10px; padding: .6rem 1.15rem; }
.btn-light-on-dark:hover { background: transparent; color: #fff; }
.btn-ghost-on-dark { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.7); font-weight: 700; border-radius: 10px; padding: .6rem 1.15rem; }
.btn-ghost-on-dark:hover { background: rgba(255,255,255,.12); color: #fff; border-color: #fff; }
body.portal a:focus-visible, body.portal .btn:focus-visible, body.portal .form-control:focus-visible,
body.portal .form-select:focus-visible, body.portal .form-check-input:focus-visible, body.portal .navbar-toggler:focus-visible {
    outline: 3px solid var(--brand-accent); outline-offset: 2px; box-shadow: none;
}

/* Header */
.portal-topstrip { background: var(--brand-primary-dark); color: rgba(255,255,255,.9); font-size: .82rem; padding: .35rem 0; }
body.portal .portal-topstrip a { color: #fff; text-decoration: none; }
.portal-header { background: #fff; border-bottom: 3px solid var(--brand-accent); position: sticky; top: 0; z-index: 1030; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.portal-header .navbar { padding: .6rem 0; }
.portal-brand { display: flex; align-items: center; gap: .85rem; }
.portal-brand img { height: 52px; width: auto; max-width: 230px; object-fit: contain; }
.portal-brand-name { border-left: 2px solid var(--portal-line); padding-left: .85rem; font-weight: 800; color: var(--portal-ink); font-size: 1.05rem; }
.portal-header .nav-link { font-weight: 700; color: var(--portal-ink); padding: .5rem .8rem !important; border-radius: 8px; }
.portal-header .nav-link:hover { color: var(--brand-primary-dark); background: var(--brand-primary-soft); }
.portal-header .navbar-toggler { border: 2px solid var(--portal-line); font-size: 1.5rem; padding: .15rem .55rem; }
@media (max-width: 991.98px) {
    .portal-header .navbar-nav { padding: .75rem 0 .25rem; gap: .35rem; }
    .portal-header .navbar-nav .btn { width: 100%; }
    .portal-brand img { height: 42px; }
}

/* Hero */
.portal-hero {
    position: relative; overflow: hidden; color: #fff;
    background:
        radial-gradient(circle at 85% 20%, rgba(255,255,255,.12) 0, transparent 40%),
        linear-gradient(135deg, var(--brand-primary-dark) 0%, var(--brand-primary) 100%);
    padding: 4.5rem 0 5.5rem;
}
.portal-hero::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
    background: linear-gradient(90deg, #000 0 33%, var(--brand-accent) 33% 66%, #fff 66% 100%);
    opacity: .9;
}
body.portal .portal-hero h1 { color: #fff; font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.15; margin-bottom: 1rem; }
.portal-hero .lead { color: rgba(255,255,255,.92); font-size: 1.15rem; max-width: 40rem; }
.portal-hero .hero-eyebrow {
    display: inline-flex; align-items: center; gap: .5rem; background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.25); padding: .3rem .8rem; border-radius: 999px; font-weight: 700; font-size: .85rem; margin-bottom: 1.25rem;
}
.portal-hero .hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.hero-card {
    background: #fff; color: var(--portal-ink); border-radius: var(--portal-radius); padding: 1.5rem;
    box-shadow: 0 20px 45px rgba(0,0,0,.18);
}
.hero-card .hero-stat { display: flex; align-items: center; gap: 1rem; padding: .75rem 0; }
.hero-card .hero-stat + .hero-stat { border-top: 1px solid var(--portal-line); }
.hero-card .hero-stat i { font-size: 1.6rem; color: var(--brand-primary); background: var(--brand-primary-soft); width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 48px; }
.hero-card .hero-stat strong { display: block; font-size: 1.5rem; line-height: 1.1; }
.hero-card .hero-stat span { color: var(--portal-muted); font-size: .9rem; font-weight: 600; }

/* Sections */
.portal-section { padding: 4rem 0; }
.portal-section.alt { background: #fff; border-top: 1px solid var(--portal-line); border-bottom: 1px solid var(--portal-line); }
.section-eyebrow { color: var(--brand-accent); font-weight: 800; text-transform: uppercase; font-size: .8rem; letter-spacing: .08em; margin-bottom: .35rem; }
.section-title { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: .5rem; }
.section-lead { color: var(--portal-muted); max-width: 46rem; }

.portal-notice {
    display: flex; gap: 1rem; align-items: flex-start;
    background: #fff5f5; border: 1px solid #f5c2c0; border-left: 6px solid var(--brand-accent);
    border-radius: var(--portal-radius); padding: 1rem 1.25rem; color: #6b1111;
}
.portal-notice i { font-size: 1.6rem; color: var(--brand-accent); line-height: 1; }
.portal-notice strong { display: block; }

/* Vacancy cards */
.vacancy-toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin: 1.5rem 0 1rem; }
.vacancy-toolbar .form-control { max-width: 360px; border-radius: 10px; padding: .6rem .9rem; }
.vacancy-card {
    background: #fff; border: 1px solid var(--portal-line); border-radius: var(--portal-radius);
    padding: 1.35rem; height: 100%; display: flex; flex-direction: column; gap: .75rem;
    transition: box-shadow .15s, transform .15s, border-color .15s;
}
.vacancy-card:hover { box-shadow: 0 10px 28px rgba(0,0,0,.08); transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand-primary) 40%, var(--portal-line)); }
.vacancy-card h3 { font-size: 1.1rem; margin: 0; text-transform: none; }
.vacancy-meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; color: var(--portal-muted); font-size: .88rem; font-weight: 600; }
.vacancy-meta i { color: var(--brand-primary); }
.vacancy-card .vacancy-actions { margin-top: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.vacancy-card .vacancy-actions .btn { flex: 1 1 auto; }
.deadline-chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 800; border-radius: 999px; padding: .2rem .65rem; background: var(--brand-primary-soft); color: var(--brand-primary-dark); }
.deadline-chip.is-soon { background: #fff4e5; color: #8a4b00; }
.deadline-chip.is-closed { background: #fdecea; color: #a61b1b; }
.portal-empty { background: #fff; border: 2px dashed var(--portal-line); border-radius: var(--portal-radius); padding: 2.5rem 1.5rem; text-align: center; color: var(--portal-muted); }
.portal-empty i { font-size: 2.75rem; color: #adb5bd; }

/* Steps */
.steps-list { list-style: none; padding: 0; margin: 0; counter-reset: step; display: grid; gap: 1rem; }
.steps-list li {
    counter-increment: step; position: relative; background: #fff; border: 1px solid var(--portal-line);
    border-radius: var(--portal-radius); padding: 1rem 1.25rem 1rem 4.25rem; min-height: 64px;
}
.steps-list li::before {
    content: counter(step); position: absolute; left: 1rem; top: 1rem; width: 2.3rem; height: 2.3rem; border-radius: 50%;
    background: var(--brand-primary); color: #fff; font-weight: 800; display: grid; place-items: center;
}
.info-card { background: #fff; border: 1px solid var(--portal-line); border-radius: var(--portal-radius); padding: 1.5rem; height: 100%; }
.info-card h3 { font-size: 1.1rem; display: flex; align-items: center; gap: .6rem; }
.info-card h3 i { color: var(--brand-primary); font-size: 1.5rem; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { position: relative; padding-left: 1.9rem; margin-bottom: .55rem; }
.check-list li::before { content: "\F012C"; font-family: "Material Design Icons"; position: absolute; left: 0; top: 0; color: var(--brand-primary); font-size: 1.15rem; line-height: 1.5; }

.cta-band { background: linear-gradient(135deg, var(--brand-primary-dark), var(--brand-primary)); color: #fff; border-radius: var(--portal-radius); padding: 2.25rem; }
body.portal .cta-band h2 { color: #fff; }

/* Vacancy details */
.detail-hero { background: #fff; border-bottom: 1px solid var(--portal-line); padding: 2rem 0 1.5rem; }
.detail-hero h1 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
.detail-body { background: #fff; border: 1px solid var(--portal-line); border-radius: var(--portal-radius); padding: 1.5rem; }
.detail-body h2 { font-size: 1.2rem; margin-top: 1.25rem; }
.detail-body h2:first-child { margin-top: 0; }
.detail-body .rich-text { overflow-wrap: anywhere; }
.detail-body .rich-text table { max-width: 100%; }
.detail-aside { position: sticky; top: 100px; }
.detail-facts { list-style: none; padding: 0; margin: 0 0 1rem; }
.detail-facts li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--portal-line); }
.detail-facts li span { color: var(--portal-muted); font-weight: 600; }
.detail-facts li strong { text-align: right; }

/* Auth pages */
.auth-shell { padding: 3rem 0; }
.auth-card { background: #fff; border: 1px solid var(--portal-line); border-radius: var(--portal-radius); box-shadow: 0 12px 32px rgba(0,0,0,.06); overflow: hidden; }
.auth-card .auth-card-head { padding: 1.75rem 1.75rem .5rem; text-align: center; }
.auth-card .auth-card-head img { max-height: 64px; max-width: 100%; margin-bottom: 1rem; }
.auth-card .auth-card-head h1 { font-size: 1.5rem; margin-bottom: .25rem; }
.auth-card .auth-card-head p { color: var(--portal-muted); margin: 0; }
.auth-card .auth-card-body { padding: 1.25rem 1.75rem 1.75rem; }
.auth-card .form-label { font-weight: 700; }
.auth-card .form-control, .auth-card .form-select { padding: .65rem .9rem; border-radius: 10px; }
.auth-side { background: linear-gradient(160deg, var(--brand-primary-dark), var(--brand-primary)); color: #fff; padding: 2rem; height: 100%; }
body.portal .auth-side h2 { color: #fff; font-size: 1.35rem; }
.auth-side .check-list li::before { color: #fff; }
.field-hint { color: var(--portal-muted); font-size: .85rem; }
.invalid-feedback { font-weight: 600; }

/* Footer */
.portal-footer { background: #17331a; color: rgba(255,255,255,.85); padding: 3rem 0 1.25rem; margin-top: 0; }
body.portal .portal-footer h2 { color: #fff; }
body.portal .portal-footer a { color: #fff; }
.portal-footer .portal-contact li { display: flex; gap: .5rem; margin-bottom: .4rem; }
.portal-footer li { margin-bottom: .35rem; }
.portal-social { display: flex; gap: .5rem; margin-top: .75rem; }
.portal-social a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.1); font-size: 1.25rem; text-decoration: none; }
.portal-social a:hover { background: var(--brand-accent); }
.portal-footer-bottom { border-top: 1px solid rgba(255,255,255,.15); margin-top: 2rem; padding-top: 1rem; font-size: .88rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }

/* Error pages */
.error-shell { padding: 4rem 0; text-align: center; }
.error-shell .error-code { font-size: clamp(3.5rem, 10vw, 6rem); font-weight: 800; color: var(--brand-primary); line-height: 1; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

body.portal .breadcrumb-item + .breadcrumb-item::before { content: "/"; font-family: inherit; color: var(--portal-muted); }

/* Never allow sideways page scroll on small screens. */
html, body.portal { overflow-x: clip; }

/* Vacancy table (landing page) */
.vacancy-table-wrap { background: #fff; border: 1px solid var(--portal-line); border-radius: var(--portal-radius); overflow: hidden; }
.vacancy-table { --bs-table-bg: transparent; }
.vacancy-table thead th {
    background: var(--brand-primary-dark); color: #fff; font-size: .8rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .04em; border: 0; padding: .9rem 1rem; white-space: nowrap;
}
.vacancy-table td, .vacancy-table tbody th { padding: .9rem 1rem; border-color: var(--portal-line); vertical-align: middle; }
.vacancy-table tbody tr:nth-child(even) { background: #fafcf9; }
.vacancy-table tbody tr:hover { background: var(--brand-primary-soft); }
.vacancy-table .vacancy-title { font-weight: 800; min-width: 220px; }
body.portal .vacancy-table .vacancy-title a { color: var(--portal-ink); text-decoration: none; }
body.portal .vacancy-table .vacancy-title a:hover { color: var(--brand-primary-dark); text-decoration: underline; }
.vacancy-table .deadline-chip { white-space: nowrap; }
.vacancy-table .vacancy-actions-cell { white-space: nowrap; }

/* Phones: each vacancy becomes a stacked block with labels */
@media (max-width: 767.98px) {
    .vacancy-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .vacancy-table, .vacancy-table tbody, .vacancy-table tr, .vacancy-table td, .vacancy-table tbody th { display: block; width: 100%; }
    .vacancy-table tbody tr { padding: .75rem 1rem; border-bottom: 1px solid var(--portal-line); }
    .vacancy-table tbody tr:last-child { border-bottom: 0; }
    .vacancy-table td, .vacancy-table tbody th { border: 0; padding: .2rem 0; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
    .vacancy-table td::before { content: attr(data-label); font-weight: 700; color: var(--portal-muted); text-align: left; }
    .vacancy-table td[data-label="#"] { display: none; }
    .vacancy-table tbody th.vacancy-title { display: block; text-align: left; font-size: 1.05rem; padding-bottom: .4rem; min-width: 0; }
    .vacancy-table .vacancy-actions-cell { display: block; padding-top: .6rem; }
    .vacancy-table .vacancy-actions-cell::before { content: none; }
    .vacancy-table .vacancy-actions-cell > div { display: flex !important; width: 100%; }
    .vacancy-table .vacancy-actions-cell .btn { flex: 1 1 0; }
    .vacancy-table td.text-center { text-align: right !important; }
}
