:root {
    color-scheme: light;
    --bg: #f4f6f5;
    --panel: #ffffff;
    --text: #17211d;
    --muted: #65746d;
    --line: #dce4df;
    --primary: #0d7a5f;
    --primary-dark: #075d48;
    --danger: #b3261e;
    --danger-bg: #fff0ee;
    --success: #146c43;
    --success-bg: #edf8f2;
    --shadow: 0 18px 50px rgba(15, 35, 28, 0.11);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    background: linear-gradient(180deg, #eaf4ef 0%, var(--bg) 42%, #ffffff 100%);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

a {
    color: var(--primary-dark);
}

.page {
    width: 100%;
    min-height: 100vh;
    padding: 18px 12px 34px;
}

.panel {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 22px 16px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.panel-wide {
    width: min(100%, 1040px);
}

.heading {
    margin-bottom: 22px;
}

.eyebrow {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

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

h1 {
    margin-bottom: 10px;
    font-size: 1.7rem;
    line-height: 1.15;
}

h2 {
    margin-bottom: 4px;
    font-size: 1.1rem;
    line-height: 1.25;
}

p {
    margin-bottom: 0;
    color: var(--muted);
}

.form {
    display: grid;
    gap: 16px;
}

.field,
.field-group {
    min-width: 0;
}

.field-group {
    display: grid;
    gap: 16px;
}

label {
    font-weight: 700;
}

.field label {
    display: block;
    margin-bottom: 7px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 48px;
    border: 1px solid #c9d5cf;
    border-radius: 8px;
    padding: 12px 13px;
    background: #ffffff;
    color: var(--text);
    font: inherit;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

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

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 122, 95, 0.16);
}

.consent {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f9fbfa;
    color: #33423c;
    font-weight: 400;
}

.consent input {
    width: 20px;
    min-height: 20px;
    height: 20px;
    margin: 2px 0 0;
    accent-color: var(--primary);
}

.button {
    display: inline-flex;
    width: 100%;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    padding: 13px 18px;
    background: var(--primary);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.button:hover,
.button:focus {
    background: var(--primary-dark);
}

.button:active {
    transform: translateY(1px);
}

.button-secondary {
    background: #263a33;
}

.button-secondary:hover,
.button-secondary:focus {
    background: #17211d;
}

.alert {
    margin-bottom: 18px;
    border-radius: 8px;
    padding: 12px 14px;
    font-weight: 700;
}

.alert ul {
    margin: 8px 0 0;
    padding-left: 20px;
    font-weight: 400;
}

.alert-success {
    border: 1px solid #b7e1ca;
    background: var(--success-bg);
    color: var(--success);
}

.alert-error {
    border: 1px solid #fac5bd;
    background: var(--danger-bg);
    color: var(--danger);
}

.admin-header {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}

.cards-list {
    display: grid;
    gap: 14px;
}

.candidate-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.candidate-top {
    display: grid;
    gap: 4px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
    background: #f8fbf9;
}

.candidate-top span {
    color: var(--muted);
    font-size: 0.92rem;
}

.candidate-data {
    display: grid;
    gap: 0;
    margin: 0;
}

.candidate-data div {
    min-width: 0;
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
}

.candidate-data div:last-child {
    border-bottom: 0;
}

.candidate-data dt {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.candidate-data dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.empty {
    border: 1px dashed #b9c8c1;
    border-radius: 8px;
    padding: 24px 14px;
    color: var(--muted);
    text-align: center;
}

@media (min-width: 680px) {
    .page {
        padding: 36px 22px;
    }

    .panel {
        padding: 34px;
    }

    h1 {
        font-size: 2.2rem;
    }

    .field-group,
    .candidate-data {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .candidate-data .full {
        grid-column: 1 / -1;
    }

    .candidate-data div:nth-last-child(2) {
        border-bottom: 1px solid var(--line);
    }

    .button {
        width: auto;
        justify-self: start;
        min-width: 190px;
    }

    .admin-header {
        grid-template-columns: 1fr auto;
        align-items: start;
    }
}
