* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: #172033;
    background: #f7f5fc;
    font-family: Inter, Arial, Helvetica, sans-serif;
    line-height: 1.55;
}

a {
    color: #5b2ad1;
    text-decoration: none;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    min-height: 76px;
    padding: 0 max(20px, calc((100% - 1180px) / 2));
    gap: 28px;
    background: #ffffff;
    border-bottom: 1px solid #e7e2f0;
}

.brand {
    margin-right: auto;
    color: #172033;
    font-size: 1.4rem;
    font-weight: 800;
}

.brand span {
    color: #5b2ad1;
}

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

.nav a {
    color: #172033;
    font-weight: 700;
}

.nav a:hover {
    color: #5b2ad1;
}

.nav a:last-child {
    padding: 9px 15px;
    color: #ffffff;
    background: #5b2ad1;
    border-radius: 10px;
}

.nav a:last-child:hover {
    color: #ffffff;
    background: #40208f;
}

.nav-toggle {
    display: none;
}

.container {
    width: min(1180px, calc(100% - 32px));
    min-height: calc(100vh - 180px);
    margin: 34px auto;
}

.home-hero {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
    align-items: center;
    gap: 58px;
    overflow: hidden;
    padding: 76px clamp(26px, 6vw, 76px);
    color: #ffffff;
    background: linear-gradient(135deg, #351184 0%, #622dcc 56%, #8151e5 100%);
    border-radius: 30px;
    box-shadow: 0 26px 70px rgba(73, 33, 168, 0.18);
}

.home-hero::before {
    position: absolute;
    bottom: -170px;
    left: -130px;
    z-index: -1;
    width: 280px;
    height: 280px;
    content: "";
    background: #ff4f87;
    border-radius: 50%;
    opacity: 0.72;
}

.home-hero::after {
    position: absolute;
    top: -180px;
    right: -150px;
    z-index: -1;
    width: 360px;
    height: 360px;
    content: "";
    border: 70px solid rgba(255, 255, 255, 0.07);
    border-radius: 50%;
}

.home-hero-content,
.home-hero-panel {
    position: relative;
    z-index: 1;
}

.home-hero h1 {
    max-width: 780px;
    margin: 12px 0 20px;
    font-size: clamp(2.5rem, 5.6vw, 4.8rem);
    line-height: 1.02;
    letter-spacing: -0.045em;
}

.home-hero-content > p {
    max-width: 690px;
    margin: 0;
    color: #edeaff;
    font-size: 1.17rem;
}

.eyebrow {
    display: inline-block;
    color: #dcd5ff;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.eyebrow.dark {
    color: #5b2ad1;
}

.home-hero-panel {
    padding: 32px;
    color: #172033;
    background: #ffffff;
    border: 1px solid #ffffff;
    border-radius: 22px;
    box-shadow: 0 24px 50px rgba(29, 10, 92, 0.21);
    transform: rotate(1.2deg);
}

.home-hero-panel strong {
    display: block;
    margin: 14px 0;
    font-size: 1.7rem;
    line-height: 1.18;
}

.home-hero-panel p {
    color: #667085;
}

.home-hero-panel a {
    display: inline-flex;
    margin-top: 8px;
    color: #5b2ad1;
    font-weight: 800;
}

.panel-label {
    display: inline-flex;
    padding: 6px 11px;
    color: #5b2ad1;
    background: #f0ebff;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
}

.hero {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    align-items: center;
    gap: 40px;
    padding: 64px clamp(24px, 6vw, 72px);
    color: #ffffff;
    background: linear-gradient(135deg, #3820bb, #725cff);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(61, 37, 200, 0.17);
}

.hero h1 {
    margin: 0 0 18px;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.04;
}

.hero p {
    max-width: 650px;
    color: #ece9ff;
    font-size: 1.14rem;
}

.hero-card {
    padding: 25px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 18px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 18px;
    gap: 8px;
    color: #ffffff;
    background: #5b2ad1;
    border: 0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.96rem;
    font-weight: 700;
}

.btn:hover {
    color: #ffffff;
    background: #40208f;
}

.btn.secondary {
    color: #5b2ad1;
    background: #ffffff;
}

.btn.ghost {
    color: #5b2ad1;
    background: #eeeafd;
}

.btn.danger {
    background: #b42318;
}

.outline-light {
    color: #ffffff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.47);
}

.outline-light:hover {
    background: rgba(255, 255, 255, 0.09);
}

.actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.audience-section {
    padding: 70px 0 26px;
}

.section-heading {
    max-width: 700px;
    margin: 0 auto 30px;
    text-align: center;
}

.section-heading h2 {
    margin: 8px 0 10px;
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    line-height: 1.12;
}

.section-heading p {
    margin: 0;
    color: #667085;
}

.audience-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.audience-card {
    position: relative;
    overflow: hidden;
    min-height: 480px;
    padding: 36px;
    background: #ffffff;
    border: 1px solid #e7e2f0;
    border-radius: 22px;
    box-shadow: 0 14px 34px rgba(24, 33, 54, 0.05);
}

.audience-card::after {
    position: absolute;
    right: -90px;
    bottom: -100px;
    width: 190px;
    height: 190px;
    content: "";
    background: rgba(91, 42, 209, 0.04);
    border-radius: 50%;
}

.audience-number {
    position: absolute;
    top: 26px;
    right: 30px;
    color: rgba(91, 42, 209, 0.12);
    font-size: 4.2rem;
    font-weight: 900;
    line-height: 1;
}

.audience-label {
    display: inline-block;
    margin-bottom: 18px;
    color: #5b2ad1;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.audience-card h2 {
    max-width: 500px;
    margin: 0 0 14px;
    font-size: clamp(1.55rem, 3vw, 2.2rem);
    line-height: 1.16;
}

.audience-card > p {
    max-width: 560px;
    color: #667085;
}

.company-card {
    color: #ffffff;
    background: #202a3c;
    border-color: #273143;
}

.company-card::after {
    background: rgba(255, 255, 255, 0.04);
}

.company-card .audience-number {
    color: rgba(255, 255, 255, 0.07);
}

.company-card .audience-label {
    color: #bfb3ff;
}

.company-card > p,
.company-card .access-note {
    color: #bac2d1;
}

.benefit-list {
    margin: 24px 0 30px;
    padding: 0;
    list-style: none;
}

.benefit-list li {
    position: relative;
    margin: 11px 0;
    padding-left: 27px;
}

.benefit-list li::before {
    position: absolute;
    top: 0.52em;
    left: 0;
    width: 10px;
    height: 6px;
    content: "";
    border-bottom: 2px solid #5b2ad1;
    border-left: 2px solid #5b2ad1;
    transform: rotate(-45deg);
}

.company-card .benefit-list li::before {
    border-color: #9b8aff;
}

.audience-actions {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.company-btn {
    background: #765fff;
}

.text-link,
.access-note {
    font-size: 0.9rem;
    font-weight: 700;
}

.recent-jobs {
    padding-top: 20px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 34px 0 18px;
}

.section-title h1,
.section-title h2 {
    margin: 0;
}

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

.grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
    padding: 22px;
    background: #ffffff;
    border: 1px solid #e7e2f0;
    border-radius: 16px;
    box-shadow: 0 7px 22px rgba(24, 33, 54, 0.04);
}

.card h2,
.card h3 {
    margin-top: 0;
}

.card p:last-child {
    margin-bottom: 0;
}

.metric strong {
    display: block;
    color: #5b2ad1;
    font-size: 2rem;
}

.muted {
    color: #667085;
}

.filters,
.form-card {
    padding: 22px;
    margin-bottom: 20px;
    background: #ffffff;
    border: 1px solid #e7e2f0;
    border-radius: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.field.full {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    padding: 11px 12px;
    color: #172033;
    background: #ffffff;
    border: 1px solid #cdd3df;
    border-radius: 9px;
    font: inherit;
}

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

input:focus,
select:focus,
textarea:focus {
    border-color: #5b2ad1;
    outline: 3px solid rgba(91, 45, 245, 0.13);
}

.table-wrap {
    overflow: auto;
    background: #ffffff;
    border: 1px solid #e7e2f0;
    border-radius: 15px;
}

table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 15px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #e7e2f0;
}

th {
    background: #f9fafc;
    font-size: 0.86rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: 0;
}

.badge {
    display: inline-block;
    padding: 4px 9px;
    color: #4b31dc;
    background: #eeeafd;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.alert {
    padding: 13px 16px;
    margin-bottom: 18px;
    background: #eef2f6;
    border-radius: 10px;
}

.alert.success {
    color: #087a55;
    background: #e9f8f1;
}

.alert.error {
    color: #b42318;
    background: #ffebe9;
}

.auth {
    max-width: 480px;
    margin: 55px auto;
}

.auth .card {
    padding: 30px;
}

.auth h1 {
    text-align: center;
}

.auth .btn {
    width: 100%;
}

.job-card {
    display: flex;
    flex-direction: column;
}

.job-card .btn {
    margin-top: auto;
}

.job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
    color: #667085;
}

.detail {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    gap: 22px;
}

.content-block {
    white-space: pre-line;
}

.chat {
    max-height: 480px;
    overflow: auto;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e7e2f0;
    border-radius: 16px;
}

.message {
    max-width: 75%;
    padding: 11px 14px;
    margin: 8px 0;
    background: #eef1f6;
    border-radius: 14px;
}

.message.mine {
    margin-left: auto;
    background: #e9e4ff;
}

.message small {
    display: block;
    margin-top: 5px;
    color: #667085;
}

.empty {
    padding: 35px;
    color: #667085;
    text-align: center;
    background: #ffffff;
    border: 1px dashed #cbd1dc;
    border-radius: 14px;
}

.footer {
    padding: 28px;
    color: #667085;
    text-align: center;
}

@media (max-width: 850px) {
    .hero,
    .home-hero {
        grid-template-columns: 1fr;
        padding: 46px 30px;
    }

    .home-hero {
        gap: 32px;
    }

    .home-hero-panel {
        transform: none;
    }

    .audience-grid,
    .detail {
        grid-template-columns: 1fr;
    }

    .grid,
    .grid.four {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nav-toggle {
        display: block;
        padding: 9px 13px;
        color: #5b2ad1;
        background: #f0ebff;
        border: 0;
        border-radius: 9px;
        font-weight: 800;
    }

    .nav {
        position: absolute;
        top: 68px;
        right: 16px;
        left: 16px;
        display: none;
        align-items: stretch;
        flex-direction: column;
        padding: 14px;
        background: #ffffff;
        border: 1px solid #e7e2f0;
        border-radius: 14px;
        box-shadow: 0 16px 36px rgba(24, 33, 54, 0.16);
    }

    .nav a {
        padding: 10px 12px;
        border-radius: 8px;
    }

    .nav a:last-child {
        text-align: center;
    }

    .nav.open {
        display: flex;
    }
}

@media (max-width: 560px) {
    body {
        overflow-x: hidden;
    }

    .topbar {
        min-height: 66px;
        padding: 0 16px;
    }

    .brand {
        font-size: 1.25rem;
    }

    .container {
        width: min(100% - 20px, 1180px);
        margin-top: 16px;
    }

    .home-hero {
        padding: 38px 22px;
        gap: 28px;
        border-radius: 20px;
    }

    .home-hero h1 {
        font-size: 2.2rem;
        letter-spacing: -0.035em;
    }

    .home-hero-content > p {
        font-size: 1rem;
    }

    .home-hero .actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .home-hero .btn,
    .audience-actions .btn {
        width: 100%;
    }

    .home-hero-panel {
        padding: 24px;
    }

    .home-hero-panel strong {
        font-size: 1.4rem;
    }

    .audience-section {
        padding-top: 48px;
    }

    .section-heading {
        text-align: left;
    }

    .audience-card {
        min-height: auto;
        padding: 25px 22px;
    }

    .audience-card h2 {
        font-size: 1.65rem;
    }

    .audience-number {
        right: 20px;
        font-size: 3rem;
    }

    .audience-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .access-note,
    .text-link {
        text-align: center;
    }

    .grid,
    .grid.two,
    .grid.four,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .field.full {
        grid-column: auto;
    }

    .section-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .card {
        padding: 17px;
    }

    .footer {
        padding: 24px 16px;
        font-size: 0.9rem;
    }
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    margin-left: 4px;
    padding: 0 6px;
    color: #ffffff;
    background: #e52f68;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
}

.nav-badge[hidden] {
    display: none;
}

.message-notification-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    width: min(360px, calc(100% - 32px));
    padding: 16px 18px;
    color: #ffffff;
    background: #202a3c;
    border: 1px solid #39455b;
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(23, 32, 51, 0.26);
}

.message-notification-toast strong {
    margin-bottom: 2px;
}

.message-notification-toast span {
    color: #dce1ea;
    font-size: 0.9rem;
}

.message-notification-toast[hidden] {
    display: none;
}

.candidate-dashboard-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.candidate-dashboard-header h1 {
    margin: 6px 0 2px;
    font-size: clamp(2rem, 4vw, 2.8rem);
    line-height: 1.1;
}

.candidate-dashboard-header p {
    margin: 0;
}

#enable-notifications:disabled {
    color: #087a55;
    cursor: default;
    opacity: 0.85;
}

.candidate-dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
    align-items: start;
    gap: 24px;
}

.candidate-dashboard-main {
    min-width: 0;
}

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

.dashboard-metrics .metric {
    min-height: 130px;
}

.dashboard-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.dashboard-action-card {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    min-height: 250px;
}

.dashboard-action-card h2 {
    margin: 8px 0;
}

.dashboard-action-card p {
    color: #667085;
}

.dashboard-action-card .btn {
    margin-top: auto;
}

.dashboard-card-kicker {
    color: #5b2ad1;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-chat-panel {
    position: sticky;
    top: 100px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e7e2f0;
    border-radius: 20px;
    box-shadow: 0 16px 38px rgba(24, 33, 54, 0.08);
}

.dashboard-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 22px 16px;
    border-bottom: 1px solid #eeeaf5;
}

.dashboard-chat-header h2 {
    margin: 3px 0 0;
}

.dashboard-chat-header > a {
    font-size: 0.88rem;
    font-weight: 700;
}

.dashboard-conversation-list {
    display: flex;
    overflow-x: auto;
    padding: 12px;
    gap: 8px;
    border-bottom: 1px solid #eeeaf5;
}

.dashboard-conversation {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 210px;
    padding: 10px;
    gap: 10px;
    color: #172033;
    background: #faf9fd;
    border: 1px solid transparent;
    border-radius: 12px;
}

.dashboard-conversation.active {
    background: #f1edff;
    border-color: #d8cdf8;
}

.conversation-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    color: #ffffff;
    background: #5b2ad1;
    border-radius: 50%;
    font-weight: 800;
}

.conversation-summary {
    display: flex;
    overflow: hidden;
    flex-direction: column;
    min-width: 0;
}

.conversation-summary strong,
.conversation-summary small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-summary small {
    color: #667085;
}

.conversation-unread {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 18px;
    padding: 1px 5px;
    color: #ffffff;
    text-align: center;
    background: #e52f68;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
}

.dashboard-chat-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    gap: 12px;
    background: #fcfbfe;
    border-bottom: 1px solid #eeeaf5;
}

.dashboard-chat-title > div {
    display: flex;
    flex-direction: column;
}

.dashboard-chat-title small {
    color: #667085;
}

.online-dot {
    width: 10px;
    height: 10px;
    background: #19a66a;
    border-radius: 50%;
}

.dashboard-chat-messages {
    display: flex;
    overflow-y: auto;
    flex-direction: column;
    height: 310px;
    padding: 18px;
    background: #f8f7fb;
}

.dashboard-chat-messages .message {
    align-self: flex-start;
    max-width: 85%;
    margin: 5px 0;
    background: #ffffff;
    border: 1px solid #e7e2f0;
}

.dashboard-chat-messages .message.mine {
    align-self: flex-end;
    color: #ffffff;
    background: #5b2ad1;
    border-color: #5b2ad1;
}

.dashboard-chat-messages .message.mine small {
    color: #e7ddff;
}

.empty.compact {
    padding: 20px;
}

.dashboard-chat-compose {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    padding: 14px;
    gap: 10px;
    border-top: 1px solid #eeeaf5;
}

.dashboard-chat-compose textarea {
    min-height: 48px;
    max-height: 120px;
    padding: 12px;
    resize: vertical;
}

.dashboard-chat-empty {
    padding: 54px 28px;
    color: #667085;
    text-align: center;
}

.dashboard-chat-empty strong {
    display: block;
    margin-bottom: 8px;
    color: #172033;
    font-size: 1.15rem;
}

.sr-only {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    border: 0;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

@media (max-width: 1050px) {
    .candidate-dashboard-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-chat-panel {
        position: static;
    }
}

@media (max-width: 700px) {
    .candidate-dashboard-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-actions-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-action-card {
        min-height: 220px;
    }
}

@media (max-width: 480px) {
    .message-notification-toast {
        right: 12px;
        bottom: 12px;
        left: 12px;
        width: auto;
    }

    .candidate-dashboard-header #enable-notifications {
        width: 100%;
    }

    .dashboard-metrics {
        grid-template-columns: 1fr;
    }

    .dashboard-metrics .metric {
        min-height: 105px;
    }

    .dashboard-chat-header {
        padding: 18px;
    }

    .dashboard-conversation {
        min-width: 190px;
    }

    .dashboard-chat-messages {
        height: 330px;
        padding: 14px;
    }

    .dashboard-chat-compose {
        grid-template-columns: 1fr;
    }

    .dashboard-chat-compose .btn {
        width: 100%;
    }
}
