:root {
    --primary: #0b4f9f;
    --primary-dark: #07366d;
    --primary-light: #eaf3ff;
    --background: #f4f8fc;
    --surface: #ffffff;
    --text: #14213d;
    --muted: #6b7a90;
    --border: #dce7f3;
    --success: #16835d;
    --danger: #c83e4d;
    --warning: #a86f00;
    --shadow: 0 18px 45px rgba(11, 79, 159, 0.10);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top right, #e8f2ff 0, transparent 35%),
        var(--background);
    color: var(--text);
}

a {
    color: inherit;
}

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
}

.header-inner {
    min-height: 78px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-name {
    font-weight: 800;
    letter-spacing: 0.18em;
    color: var(--primary);
    font-size: 1.2rem;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: 4px;
}

.logout-link,
.back-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

.page-wrapper {
    padding: 42px 0 70px;
}

.messages {
    margin-bottom: 24px;
}

.message {
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.message.success {
    border-color: #b8ead6;
    color: var(--success);
}

.message.error {
    border-color: #f1c2c7;
    color: var(--danger);
}

.message.warning {
    border-color: #f1dfac;
    color: var(--warning);
}

.auth-section,
.thank-you-section {
    min-height: calc(100vh - 180px);
    display: grid;
    place-items: center;
}

.auth-card,
.thank-you-card {
    width: min(500px, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 42px;
    box-shadow: var(--shadow);
    text-align: center;
}

.icon-circle,
.success-circle {
    width: 74px;
    height: 74px;
    margin: 0 auto 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--primary-light);
    font-size: 2rem;
}

.success-circle {
    background: #e8f8f1;
    color: var(--success);
    font-weight: 800;
}

.eyebrow {
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    margin: 0 0 10px;
}

h1,
h2,
h3 {
    margin-top: 0;
}

.auth-card h1,
.thank-you-card h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 12px;
}

.muted-text {
    color: var(--muted);
    line-height: 1.7;
}

.auth-form {
    text-align: left;
    margin-top: 28px;
}

.auth-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.form-control {
    width: 100%;
    height: 52px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 16px;
    font-size: 1rem;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(11, 79, 159, 0.10);
}

.field-error {
    color: var(--danger);
    margin-top: 8px;
    font-size: 0.9rem;
}

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

.primary-button {
    background: linear-gradient(135deg, var(--primary), #1976d2);
    color: white;
    box-shadow: 0 12px 25px rgba(11, 79, 159, 0.20);
}

.auth-form .primary-button {
    width: 100%;
    margin-top: 18px;
}

.secondary-button {
    background: var(--primary-light);
    color: var(--primary);
}

.full-width {
    width: 100%;
}

.security-note {
    margin-top: 22px;
    color: var(--muted);
    font-size: 0.88rem;
}

.dashboard-header,
.candidate-header {
    margin-bottom: 34px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
}

.status-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 800;
    box-shadow: var(--shadow);
}

.status-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-dot.open {
    background: var(--success);
}

.status-dot.closed {
    background: var(--danger);
}

.section-heading {
    margin-bottom: 20px;
}

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

.category-card,
.candidate-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.category-card p,
.candidate-card p {
    color: var(--muted);
    line-height: 1.6;
}

.category-icon {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    background: var(--primary-light);
    border-radius: 14px;
    margin-bottom: 18px;
    font-size: 1.4rem;
}

.category-footer {
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    font-size: 0.9rem;
    color: var(--muted);
}

.voted-badge,
.closed-badge,
.department-badge {
    display: inline-flex;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.voted-badge {
    background: #e8f8f1;
    color: var(--success);
}

.closed-badge {
    background: #fff0f2;
    color: var(--danger);
}

.department-badge {
    background: var(--primary-light);
    color: var(--primary);
    margin-bottom: 20px;
}

.candidate-card {
    text-align: center;
}

.candidate-photo {
    margin-bottom: 18px;
}

.candidate-photo img,
.initial-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto;
    border: 5px solid var(--primary-light);
}

.initial-avatar {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), #1976d2);
    color: white;
    font-size: 2rem;
    font-weight: 800;
}

.already-voted-card {
    background: var(--surface);
    border: 1px solid #b8ead6;
    border-radius: 20px;
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
}

.large-check {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #e8f8f1;
    color: var(--success);
    font-size: 1.6rem;
    font-weight: 800;
}

.empty-state {
    grid-column: 1 / -1;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 18px;
    padding: 34px;
    text-align: center;
    color: var(--muted);
}

@media (max-width: 900px) {
    .category-grid,
    .candidate-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .page-wrapper {
        padding-top: 26px;
    }

    .auth-card,
    .thank-you-card {
        padding: 28px 22px;
    }

    .dashboard-header {
        flex-direction: column;
    }

    .category-grid,
    .candidate-grid {
        grid-template-columns: 1fr;
    }

    .category-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .secondary-button {
        width: 100%;
    }

    .already-voted-card {
        align-items: flex-start;
    }
}
