:root {
    --brand: #e85d2a;
    --brand-dark: #c74a1c;
    --ink: #1f2430;
    --muted: #5b6272;
    --bg: #faf8f5;
    --card: #ffffff;
    --border: #e7e2da;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.site-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

.brand {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--ink);
    text-decoration: none;
}

.brand span { color: var(--brand); }

.hero {
    padding: 3.5rem 0 2.5rem;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 800;
    margin-bottom: 1rem;
}

.hero .lead {
    color: var(--muted);
    font-size: 1.1rem;
    max-width: 40rem;
    margin: 0 auto;
}

.categories { padding: 1rem 0 3rem; }

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.category-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    text-align: center;
}

.category-card.live { border-color: var(--brand); }

.category-icon { font-size: 2.2rem; margin-bottom: .5rem; }

.category-card h2 { font-size: 1.15rem; margin-bottom: .5rem; }

.category-card p { color: var(--muted); font-size: .95rem; margin-bottom: 1rem; }

.badge {
    display: inline-block;
    padding: .25rem .75rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    background: var(--bg);
    color: var(--muted);
    border: 1px solid var(--border);
}

.badge-live {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--muted);
    font-size: .9rem;
}

/* ---- App chrome ---- */

.nav-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    font-size: .95rem;
}

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

.nav-cta {
    background: var(--brand);
    color: #fff !important;
    padding: .4rem .9rem;
    border-radius: 999px;
}

.inline-form { display: inline; }

.link-button {
    background: none;
    border: none;
    color: var(--muted);
    font: inherit;
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    padding: 0;
}

.link-button:hover { color: var(--brand); }

.page { padding: 2rem 0 3rem; min-height: 60vh; }

.flash {
    background: #e8f6ec;
    border: 1px solid #b7e2c4;
    color: #1d6b34;
    border-radius: 10px;
    padding: .75rem 1rem;
    margin-bottom: 1.25rem;
}

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

.form-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.75rem;
    max-width: 26rem;
    margin: 1rem auto;
}

.form-card-wide { max-width: 38rem; }

.form-card h1 { margin-bottom: 1rem; font-size: 1.5rem; }

.form-card label, .contact-box label {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    margin: .9rem 0 .3rem;
}

.form-card input, .form-card textarea, .form-card select,
.contact-box textarea, .reply-form textarea, .filter-form input {
    width: 100%;
    padding: .6rem .75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}

.form-card input:focus, .form-card textarea:focus,
.contact-box textarea:focus, .reply-form textarea:focus {
    outline: 2px solid var(--brand);
    border-color: var(--brand);
}

.radio-row { display: grid; gap: .4rem; margin-bottom: .25rem; }

.radio-option { font-weight: 400 !important; }

.radio-option input { width: auto; margin-right: .4rem; }

.form-errors {
    background: #fdeeee;
    border: 1px solid #f2c4c4;
    color: #a33;
    border-radius: 8px;
    padding: .6rem .9rem;
    margin-top: 1rem;
    font-size: .9rem;
}

.form-errors p { margin: .15rem 0; }

.form-alt { margin-top: 1rem; font-size: .9rem; color: var(--muted); }

.btn {
    display: inline-block;
    padding: .55rem 1.1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    margin-top: 1rem;
}

.btn-primary:hover { background: var(--brand-dark); }

.btn-danger { border-color: #e0b4b4; color: #a33; }

/* ---- Board ---- */

.board-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.board-head h1, .board-head h2 { font-size: 1.5rem; }

.filter-tabs {
    display: flex;
    gap: .5rem;
    margin-bottom: .75rem;
}

.filter-tabs a {
    padding: .35rem .9rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--ink);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 600;
}

.filter-tabs a.active {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.filter-form {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.filter-form input { max-width: 14rem; }

.listing-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: .6rem;
    color: var(--ink);
    text-decoration: none;
}

a.listing-row:hover { border-color: var(--brand); }

.listing-main strong { font-size: 1.05rem; }

.listing-meta {
    color: var(--muted);
    font-size: .85rem;
    margin-top: .2rem;
}

.listing-price {
    font-weight: 700;
    white-space: nowrap;
    text-align: right;
}

.listing-price small { display: block; font-weight: 400; color: var(--muted); }

.badge-seek { background: #eef1fb; border-color: #c9d2f0; color: #3d55b8; }

.badge-demo { background: #fdf6e3; border-color: #ecd9a0; color: #8a6d1a; }

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 2.5rem 1rem;
}

.pager { display: flex; gap: .5rem; justify-content: center; margin-top: 1rem; }

/* ---- Listing detail ---- */

.listing-detail-head h1 { margin: .4rem 0 1rem; font-size: 1.6rem; }

.listing-facts {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: grid;
    gap: .35rem;
    margin-bottom: 1.25rem;
    font-size: .95rem;
}

.listing-description {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    line-height: 1.7;
}

.contact-box {
    background: var(--card);
    border: 1px solid var(--brand);
    border-radius: 12px;
    padding: 1.25rem;
}

.contact-box h2 { font-size: 1.15rem; margin-bottom: .75rem; }

.muted { color: var(--muted); }

/* ---- Messages ---- */

.message-preview { color: var(--muted); font-size: .9rem; margin-top: .25rem; }

.thread { margin: 1.25rem 0; display: grid; gap: .6rem; }

.bubble {
    max-width: 75%;
    padding: .7rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--border);
}

.bubble-mine {
    justify-self: end;
    background: #fdeee6;
    border-color: #f3cdb8;
}

.bubble-theirs { justify-self: start; background: var(--card); }

.bubble-time { color: var(--muted); font-size: .75rem; margin-top: .3rem; }

.reply-form textarea { margin-bottom: .25rem; }

/* ---- Social login ---- */

.social-login { display: grid; gap: .5rem; margin-bottom: 1rem; }

.social-btn { text-align: center; }

.social-google { background: #fff; }

.social-facebook {
    background: #1877f2;
    border-color: #1877f2;
    color: #fff;
}

.social-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--muted);
    font-size: .85rem;
    margin-top: .5rem;
}

.social-divider::before, .social-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--border);
}

/* ---- Teams ---- */

.section-title { font-size: 1.15rem; margin: 1.5rem 0 .75rem; }

.leave-form { margin-top: 2rem; }

.filter-form select, .form-card select {
    padding: .6rem .75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    background: #fff;
    width: 100%;
}

.filter-form select { width: auto; }

/* ---- Candidate voting ---- */

.candidate-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: .75rem;
}

.candidate-accepted { border-color: #2e9e50; background: #f2fbf4; }

.candidate-rejected { opacity: .6; }

.candidate-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .5rem;
}

.candidate-intro { margin-bottom: .75rem; line-height: 1.6; }

.vote-tally {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-weight: 700;
    margin-bottom: .5rem;
}

.tally-yes { color: #1d6b34; }
.tally-no { color: #a33; }

.vote-comment {
    font-size: .9rem;
    color: var(--muted);
    border-left: 3px solid var(--border);
    padding-left: .75rem;
    margin: .35rem 0;
}

.vote-form {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: .75rem;
}

.vote-form input[type="text"] {
    flex: 1;
    min-width: 12rem;
    padding: .5rem .75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
}

.radio-row-inline { display: flex; gap: .75rem; }

.decide-row { display: flex; gap: .5rem; margin-top: .75rem; }

.apply-box { margin-bottom: 1.25rem; }

/* ---- Compact hero on the board ---- */

.hero-compact { padding: 1.5rem 0 1.25rem; text-align: left; }

.hero-compact h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); margin-bottom: .4rem; }

.hero-compact .lead { margin: 0 0 .75rem; max-width: none; font-size: 1rem; }

/* ---- Extended filter bar ---- */

.filter-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .5rem;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .9rem;
}

.filter-form-grid input, .filter-form-grid select { max-width: none; width: 100%; }

.filter-check {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .9rem;
    white-space: nowrap;
}

.filter-check input { width: auto; }

/* ---- Sidebar board layout ---- */

.board-layout { display: block; }

.filter-sidebar { margin-bottom: 1rem; }

.filter-details {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.filter-details summary {
    cursor: pointer;
    font-weight: 700;
    padding: .8rem 1rem;
    list-style-position: inside;
}

.filter-details .filter-form-grid {
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 0 0 12px 12px;
    grid-template-columns: 1fr;
}

@media (min-width: 900px) {
    .board-layout {
        display: grid;
        grid-template-columns: 280px 1fr;
        gap: 1.25rem;
        align-items: start;
    }

    .filter-sidebar {
        position: sticky;
        top: 1rem;
        margin-bottom: 0;
    }

    .filter-details summary { pointer-events: none; }
}

/* ---- Legal pages ---- */

.legal-page { max-width: 44rem; margin: 0 auto; }

.legal-page h1 { font-size: 1.6rem; margin-bottom: .5rem; }

.legal-page h2 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }

.legal-page ul { padding-left: 1.25rem; margin: .5rem 0; }

.legal-page li { margin-bottom: .35rem; }

.site-footer a { color: var(--muted); }

/* ---- Listing photos ---- */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: .6rem;
    margin-bottom: 1.25rem;
}

.photo-grid img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
    display: block;
}

.photo-grid-manage .photo-item { text-align: center; }

.photo-grid-manage form { margin-top: .35rem; }

.listing-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

input[type="file"] {
    display: block;
    width: 100%;
    padding: .5rem 0;
    font: inherit;
}

/* ---- Account & nav badge ---- */

.nav-badge {
    display: inline-block;
    background: var(--brand);
    color: #fff;
    border-radius: 999px;
    font-size: .75rem;
    padding: 0 .45rem;
    vertical-align: middle;
}

.account-form {
    max-width: 24rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
}

.account-form label { display: block; font-weight: 600; font-size: .9rem; margin: .75rem 0 .3rem; }

.account-form input {
    width: 100%;
    padding: .6rem .75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
}

.account-form button { margin-top: 1rem; }

/* ---- Icon nav ---- */

.nav-links a, .nav-links .link-button {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.nav-icon { width: 20px; height: 20px; flex-shrink: 0; }

.nav-has-badge { position: relative; }

@media (max-width: 640px) {
    .nav-links { gap: .35rem; }

    .nav-links .nav-label { display: none; }

    .nav-links a, .nav-links .link-button {
        padding: .55rem;
        border-radius: 10px;
    }

    .nav-links a:active, .nav-links .link-button:active { background: var(--bg); }

    .nav-icon { width: 24px; height: 24px; }

    .nav-cta { padding: .45rem .8rem; }

    .nav-has-badge .nav-badge {
        position: absolute;
        top: 0;
        right: 0;
    }
}

/* ---- Result cards on small screens: stack, don't squeeze ---- */

@media (max-width: 640px) {
    .listing-row {
        flex-direction: column;
        align-items: stretch;
        gap: .5rem;
    }

    .listing-thumb {
        width: 100%;
        height: 170px;
        border-radius: 10px;
    }

    .listing-price {
        text-align: left;
        white-space: normal;
        display: flex;
        align-items: baseline;
        gap: .35rem;
        border-top: 1px solid var(--border);
        padding-top: .5rem;
    }

    .listing-price small { display: inline; }
}

/* ---- Card title on its own line, badges above ---- */

.listing-head-badges {
    display: flex;
    gap: .4rem;
    margin-bottom: .3rem;
}

.listing-title {
    display: block;
    font-size: 1.05rem;
    line-height: 1.35;
}

.listing-title a { color: var(--ink); text-decoration: none; }

/* ---- Feature chips in the badge row ---- */

.listing-head-badges {
    flex-wrap: wrap;
    row-gap: .3rem;
    margin-bottom: .5rem;
}

.badge-soft {
    background: var(--bg);
    border-color: var(--border);
    color: var(--muted);
}

/* ---- Hero banner with illustration ---- */

.hero-banner {
    position: relative;
    background: linear-gradient(135deg, #fdf1e3, #fbe0c8);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.hero-banner .hero-text {
    position: relative;
    z-index: 1;
    max-width: 55%;
}

.hero-art {
    position: absolute;
    right: -20px;
    bottom: -6px;
    height: 105%;
    max-width: 55%;
    pointer-events: none;
}

@media (max-width: 760px) {
    .hero-banner { padding: 1.5rem 1.25rem 0; }

    .hero-banner .hero-text { max-width: 100%; }

    .hero-art {
        position: static;
        display: block;
        max-width: 100%;
        height: auto;
        margin: .5rem auto -6px;
    }
}

/* ---- Structured apply fields ---- */

.apply-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: .6rem;
    margin: .6rem 0;
}

.apply-fields label {
    display: block;
    font-weight: 600;
    font-size: .85rem;
}

.apply-fields input {
    width: 100%;
    margin-top: .25rem;
    padding: .55rem .7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
}

/* ---- Candidate photo on the board ---- */

.candidate-body { display: flex; gap: 1rem; align-items: flex-start; }

.candidate-photo {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.apply-fields select {
    width: 100%;
    margin-top: .25rem;
    padding: .55rem .7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}

/* ---- Design pass: links, back-links, detail rhythm ---- */

/* Content links: brand color, never browser purple */
.page a { color: var(--brand-dark); }

.page a.btn, .page a.badge, .page a.listing-row, .page a.category-card,
.page a.back-link, .page .nav-links a, .page .filter-tabs a { color: inherit; }

.page a.btn-primary, .page .nav-cta { color: #fff; }

.back-link {
    display: inline-block;
    color: var(--muted) !important;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.back-link:hover { color: var(--brand) !important; }

/* Listing detail: breathing room between badge row and title */
.listing-detail-head { margin-bottom: 1.25rem; }

.listing-detail-head .badge { margin-right: .4rem; }

.listing-detail-head h1 { margin: .65rem 0 0; }

/* Fix: active filter tab keeps white text (design-pass link rule overrode it) */
.page .filter-tabs a.active { color: #fff; }

/* ---- Impersonation banner ---- */

.impersonation-bar {
    background: #1f2430;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: .5rem 1rem;
    font-size: .9rem;
    flex-wrap: wrap;
}

.impersonation-bar .btn { padding: .3rem .8rem; font-size: .85rem; }

/* ---- Share row ---- */

.share-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.share-label { font-weight: 600; font-size: .9rem; color: var(--muted); }

.share-btn { font-size: .85rem; padding: .4rem .8rem; }

.share-fb { background: #1877f2; border-color: #1877f2; color: #fff !important; }

.share-wa { background: #25d366; border-color: #25d366; color: #fff !important; }

.share-viber { background: #7360f2; border-color: #7360f2; color: #fff !important; }

/* ---- Avatars ---- */

.avatar {
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.avatar-sm { width: 28px; height: 28px; }
.avatar-md { width: 44px; height: 44px; }
.avatar-lg { width: 64px; height: 64px; }

.avatar-initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
}

.avatar-sm.avatar-initial { font-size: .85rem; }
.avatar-lg.avatar-initial { font-size: 1.6rem; }

.thread-head, .account-head {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin-bottom: .75rem;
}

.candidate-name { display: inline-flex; align-items: center; gap: .5rem; }

.avatar-form {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: .5rem;
}

.avatar-form input[type="file"] { width: auto; padding: 0; }

.applicants-cta { margin-top: .5rem; font-size: .85rem; padding: .35rem .8rem; }

.fiok-tabs { margin: 1rem 0 1.5rem; }

.account-form-wide { max-width: 30rem; }

.account-form select {
    width: 100%;
    padding: .6rem .75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}
