:root {
    --bg: #fff7fc;
    --panel: #ffffff;
    --text: #24172f;
    --muted: #75677d;
    --line: #eadcec;
    --primary: #6d4a9c;
    --primary-dark: #4b2c73;
    --accent: #e3007d;
    --accent-soft: #ffe4f3;
    --danger: #ad2f5b;
    --success: #6d4a9c;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(227, 0, 125, .12), transparent 34rem),
        linear-gradient(180deg, #fff7fc 0%, #f8f3fb 100%);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

.page {
    width: min(100%, 980px);
    margin: 0 auto;
    padding: 18px;
}

.page.admin-page {
    width: min(100%, 1500px);
}

.topbar {
    margin-bottom: 18px;
    padding: 18px;
    background: #ffffff;
    color: var(--text);
    border: 1px solid var(--line);
    border-top: 5px solid var(--accent);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(75, 44, 115, .08);
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.brand-logo {
    width: min(100%, 360px);
    height: auto;
}

.brand-copy {
    border-left: 4px solid var(--accent);
    padding-left: 14px;
}

.topbar h1 {
    margin: 0 0 6px;
    font-size: 1.45rem;
    color: var(--primary-dark);
}

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

@media (min-width: 720px) {
    .brand {
        align-items: center;
        flex-direction: row;
        justify-content: space-between;
    }

    .brand-copy {
        max-width: 380px;
    }
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: 0 8px 22px rgba(75, 44, 115, .05);
}

.section-title {
    margin: 0 0 14px;
    font-size: 1.05rem;
    color: var(--primary-dark);
}

.question-title {
    margin: 0 0 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: var(--primary-dark);
    font-size: 1.05rem;
}

.question-number {
    flex: 0 0 auto;
    min-width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 6px 14px rgba(227, 0, 125, .22);
}

.question-text {
    padding-top: 4px;
}

.grid {
    display: grid;
    gap: 14px;
}

@media (min-width: 720px) {
    .grid.two {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid.three {
        grid-template-columns: repeat(3, 1fr);
    }
}

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

.hint {
    display: block;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 400;
}

input[type="text"],
input[type="tel"],
input[type="password"],
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 11px 12px;
    font: inherit;
    background: #ffffff;
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid {
    border-color: var(--danger);
    background: #fff8fb;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(227, 0, 125, .14);
    outline: none;
}

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

.choices {
    display: grid;
    gap: 10px;
}

.choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fffafd;
    font-weight: 400;
}

.choice input {
    margin-top: 4px;
    accent-color: var(--accent);
}

.choice:has(input:checked) {
    border-color: rgba(227, 0, 125, .45);
    background: var(--accent-soft);
}

.field-error {
    margin: 6px 0 0;
    color: var(--danger);
    font-size: .9rem;
    font-weight: 700;
}

.form-alert {
    border-color: #efb3ca;
    background: #fff3f8;
    color: var(--danger);
}

.form-alert h2 {
    margin: 0 0 6px;
    font-size: 1rem;
}

.form-alert p {
    margin: 0;
}

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

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 0;
    border-radius: 6px;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.button:hover {
    background: linear-gradient(135deg, #c90070, var(--primary-dark));
}

.button.secondary {
    background: #f1e8f5;
    color: var(--text);
}

.button.secondary:hover {
    background: #e8d9f0;
}

.errors {
    border-color: #e0aaa5;
    background: #fff7f6;
    color: var(--danger);
}

.success {
    border-color: #d8c7e8;
    background: #fbf5ff;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1400px;
    background: #ffffff;
}

th,
td {
    border: 1px solid var(--line);
    padding: 9px;
    text-align: left;
    vertical-align: top;
    font-size: .92rem;
}

th {
    background: #f3e8f7;
    color: var(--primary-dark);
    white-space: nowrap;
}

.admin-login {
    max-width: 420px;
    margin: 36px auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--primary-dark);
    font-weight: 700;
    text-decoration: none;
}

.back-link::before {
    content: "‹";
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 1.45rem;
    line-height: 1;
}

.back-link:hover {
    color: var(--accent);
}

.site-footer {
    margin-top: 26px;
}

.footer-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 8px;
    background: linear-gradient(135deg, #201326, #4b2c73);
    color: #ffffff;
    box-shadow: 0 14px 34px rgba(75, 44, 115, .18);
    text-align: left;
}

.footer-logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
    padding: 6px;
    border-radius: 50%;
    background: #000000;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .16);
}

.footer-kicker {
    margin: 0 0 2px;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.footer-link {
    color: #f0d9a8;
    font-weight: 700;
    text-decoration: none;
}

.footer-link:hover {
    text-decoration: underline;
}

@media (max-width: 460px) {
    .footer-card {
        align-items: center;
        flex-direction: column;
        text-align: center;
    }
}
