:root {
    color-scheme: light;
    font-family: Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

.login-page {
    align-items: center;
    background: #7793aa;
    color: #111;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: #fff;
    border: 1px solid #430;
    max-width: 410px;
    padding: 22px;
    width: 100%;
}

.login-box.compact {
    max-width: 440px;
}

.login-heading {
    align-items: center;
    display: flex;
    gap: 14px;
    margin-bottom: 22px;
}

.login-heading h1 {
    font-size: 21px;
    margin: 0 0 6px;
}

.login-heading p,
.help-text {
    color: #444;
    font-size: 14px;
    margin: 0;
}

.lock-symbol {
    font-size: 38px;
}

.login-box label {
    display: block;
    font-size: 14px;
    font-weight: bold;
    margin: 13px 0 5px;
}

.login-box input {
    border: 1px solid #888;
    font-size: 16px;
    padding: 9px;
    width: 100%;
}

.login-box button {
    background: #7793aa;
    border: 0;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    margin-top: 20px;
    padding: 11px 18px;
    text-transform: uppercase;
}

.login-box button:hover,
.login-box button:focus {
    background: #57738a;
}

.login-box button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.help-text {
    margin-top: 18px;
}

.notice {
    border-radius: 3px;
    font-size: 14px;
    margin: 0 0 16px;
    padding: 10px;
}

.notice.success {
    background: #e5f4e5;
    border: 1px solid #5b8c5b;
}

.notice.error {
    background: #f9e4e4;
    border: 1px solid #a44;
}

.preview-banner {
    background: #fff3cd;
    border: 1px solid #9c7800;
    font-weight: bold;
    margin-bottom: 18px;
    padding: 10px 14px;
}
.preview-submit-note {
    background: #eee;
    border: 1px solid #999;
    display: inline-block;
    padding: 10px 14px;
}
.preview-region-selector,
.preview-region-label {
    background: #eef5fb;
    border: 1px solid #7793aa;
    margin: 0 0 18px;
    padding: 10px 14px;
}
.preview-region-selector select { margin-left: 8px; padding: 5px; }
.goto-button:disabled { cursor: not-allowed; opacity: .5; }

.formatted-text p { margin: 0 0 10px; }
.formatted-text ul { margin: 0 0 10px; padding-left: 24px; }
.formatted-text h2 { font-size: 1.45rem; margin: 16px 0 8px; }
.formatted-text h3 { font-size: 1.15rem; margin: 14px 0 7px; }

.voter-page {
    background: #fff;
    color: #111;
}

.voter-container {
    margin: 0 auto;
    max-width: 900px;
    padding: 20px;
}

.voter-nav {
    align-items: center;
    color: #324e94;
    display: flex;
    font-size: 14px;
    justify-content: flex-end;
    gap: 14px;
}

.voter-nav form {
    margin: 0;
}

.voter-nav a {
    color: #324e94;
}

.link-button {
    background: none;
    border: 0;
    color: #324e94;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.election-list {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    list-style: none;
    margin: 30px 0 0;
    padding: 0;
}

.election-list li {
    border: 1px dotted #aaa;
    padding: 18px;
}

.election-list h3 {
    margin-top: 0;
}

.muted {
    color: #666;
}

.goto-button {
    background: #7793aa;
    border: 0;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    display: inline-block;
    font: inherit;
    padding: 11px 20px;
    text-decoration: none;
}

.goto-button:hover,
.goto-button:focus {
    background: #57738a;
    color: #fff;
}

.goto-button.secondary {
    background: #657582;
}

.voting-rules {
    background: #f2f6f9;
    border-left: 5px solid #7793aa;
    margin: 24px 0;
    padding: 14px 18px;
}

.voting-rules h2 {
    margin-top: 0;
}

.voting-rules p {
    margin: 7px 0;
}

.candidate-container {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 36px 0;
}

.region-heading {
    background: #97b3cc;
    border-radius: 4px;
    color: #fff;
    grid-column: 1 / -1;
    margin: 0;
    padding: 8px 12px;
}

.candidate-card {
    border-bottom: 2px solid #f36ca0;
    padding: 0 8px 24px;
}

.candidate-details {
    display: grid;
    gap: 15px;
    grid-template-columns: minmax(90px, 28%) 1fr;
}

.candidate-details img {
    background: #fff;
    border: 1px solid #ccc;
    height: auto;
    max-width: 100%;
}

.candidate-details h3 {
    font-size: 20px;
    margin: 0 0 6px;
}

.candidate-details p {
    font-size: 14px;
    margin: 5px 0;
}

.candidate-description {
    min-height: 50px;
}

.candidate-choices {
    border: 0;
    display: flex;
    gap: 16px;
    justify-content: center;
    margin: 16px 0 0;
    padding: 0;
}

.candidate-choices label {
    align-items: center;
    display: flex;
    flex-direction: column;
    font-size: 13px;
    gap: 6px;
    text-align: center;
}

.candidate-choices input {
    height: 22px;
    width: 22px;
}

.candidate-suggestions {
    border-top: 1px solid #bbb;
    margin-top: 35px;
    padding-top: 20px;
}

.suggestion-row {
    display: grid;
    gap: 14px;
    grid-template-columns: 2fr 1fr;
    margin-bottom: 12px;
}

.suggestion-row label {
    font-weight: bold;
}

.suggestion-row input {
    background: #eee;
    border: 1px solid #aaa;
    display: block;
    font-size: 16px;
    margin-top: 5px;
    padding: 10px;
    width: 100%;
}

.ballot-actions,
.blank-vote-form {
    margin: 14px 0;
    text-align: center;
}

.thanks-panel {
    margin: 60px auto;
    max-width: 600px;
    text-align: center;
}

.thanks-symbol {
    align-items: center;
    background: #5c9564;
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    font-size: 60px;
    height: 110px;
    justify-content: center;
    width: 110px;
}

.voter-footer {
    background: #7793aa;
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-top: 60px;
    padding: 20px;
}

.voter-footer a {
    color: #fff;
}

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

@media (max-width: 680px) {
    .candidate-container {
        grid-template-columns: 1fr;
    }

    .suggestion-row {
        grid-template-columns: 1fr;
    }

    .voter-nav {
        flex-wrap: wrap;
    }
}

/* Stemmesidene bygger videre på den opprinnelige visuelle profilen. */
.voter-page {
    background: #fff;
    color: #111;
    font-family: Arial, sans-serif;
    font-size: 16px;
}

.voter-container {
    margin: 0 auto;
    max-width: 900px;
    padding: 0;
}

.voter-nav {
    align-items: flex-end;
    color: #324e94;
    display: flex;
    justify-content: space-between;
    min-height: 94px;
    padding: 12px 20px 8px;
}

.voter-brand {
    display: block;
    line-height: 0;
}

.voter-brand img {
    height: auto;
    width: 150px;
}

.voter-nav-links {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    justify-content: flex-end;
}

.voter-nav-links a,
.voter-nav-links .link-button {
    color: #324e94;
    font-size: 14px;
}

.voter-nav-links a + a::before,
.voter-nav-links form::before {
    color: #999;
    content: "|";
    margin-right: 12px;
    text-decoration: none;
}

.voter-hero {
    background: #e9eef2;
    line-height: 0;
    overflow: hidden;
}

.voter-hero img {
    display: block;
    height: auto;
    width: 100%;
}

.voter-content {
    min-height: 320px;
    padding: 28px 20px 44px;
}

.voter-content h1 {
    font-size: 24px;
    margin: 0 0 14px;
}

.voter-content h2 {
    font-size: 20px;
}

.home-intro {
    max-width: 760px;
}

.home-intro p {
    line-height: 1.55;
}

.election-list {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    list-style: none;
    margin: 38px 0 0;
    padding: 0;
}

.election-list li {
    border: 1px dotted #bbb;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-height: 310px;
    padding: 18px;
    transition: background-color .15s ease, border-color .15s ease;
}

.election-list li:hover,
.election-list li:focus-within {
    background: #f9fbfb;
    border-color: #9abbd2;
    border-style: dashed;
}

.election-icon {
    height: 64px;
    object-fit: contain;
    object-position: left center;
    width: 64px;
}

.election-list h3 {
    font-size: 23px;
    line-height: 1.2;
    margin: 12px 0 8px;
}

.election-list .formatted-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.election-deadline {
    font-size: 14px;
}

.election-link {
    color: #324e94;
    font-size: 16px;
    font-weight: bold;
    margin-top: auto;
    text-align: center;
    text-decoration: underline;
}

.voting-rules {
    background: #f5f8fa;
    border-left: 5px solid #7793aa;
}

.candidate-card {
    border-bottom: 2px solid #f36ca0;
    padding-bottom: 34px;
}

.candidate-details img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.candidate-choices input[type="checkbox"] {
    appearance: none;
    background: url('../images/voter/unchecked_checkbox.png') center / contain no-repeat;
    border: 0;
    cursor: pointer;
    height: 27px;
    margin: 0;
    width: 27px;
}

.candidate-choices input[type="checkbox"]:checked {
    background-image: url('../images/voter/checked_checkbox.png');
}

.candidate-choices input[type="checkbox"]:focus-visible {
    outline: 3px solid #324e94;
    outline-offset: 3px;
}

.thanks-panel {
    margin-top: 20px;
}

.thanks-image {
    height: auto;
    max-width: 420px;
    width: 70%;
}

.voter-footer {
    background: #7793aa;
    color: #fff;
    display: block;
    margin: 0;
    padding: 24px 20px 28px;
}

.voter-footer h2 {
    font-size: 20px;
    margin: 0 0 4px;
}

.voter-footer h3 {
    border-bottom: 2px solid #b15389;
    display: inline-block;
    font-size: 13px;
    letter-spacing: 4px;
    margin: 20px 0 10px;
    padding-bottom: 4px;
    text-transform: uppercase;
}

.voter-footer p {
    margin: 4px 0;
}

.footer-email {
    align-items: center;
    display: flex;
    gap: 10px;
}

.footer-email img {
    height: auto;
    width: 18px;
}

@media (max-width: 680px) {
    .voter-nav {
        align-items: center;
        background: #7793aa;
        min-height: 64px;
        padding: 8px 14px;
    }

    .voter-brand img {
        content: url('../images/voter/logo_ansattesvalg-hvit.png');
        width: 92px;
    }

    .voter-nav-links {
        gap: 6px 10px;
        max-width: 70%;
    }

    .voter-nav-links span {
        color: #fff;
        flex-basis: 100%;
        font-size: 12px;
        text-align: right;
    }

    .voter-nav-links a,
    .voter-nav-links .link-button {
        color: #fff;
        font-size: 13px;
    }

    .voter-nav-links a + a::before,
    .voter-nav-links form::before {
        color: rgba(255, 255, 255, .7);
        margin-right: 8px;
    }

    .voter-content {
        padding: 24px 16px 36px;
    }

    .voter-content h1 {
        font-size: 21px;
    }

    .election-list {
        grid-template-columns: 1fr;
    }

    .election-list li {
        min-height: 0;
    }

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