:root {
    --color-black: #000000;
    --color-bg: #efefef;
    --color-bg-light: #efcfcfc;
    --color-white: #ffffff;
    --color-white-rgb: 255 255 255;
    --color-gray-dark: #333333;
    --color-gray-medium: #555555;
    --color-gray-light: #888888;
    --color-gray-hover: #f5f5f5;
    --color-error: #b04a4a;
    --color-warn: #f1c40f;

    --opacity-50: 0.5;
    --opacity-75: 0.75;

    --color-border: 1px solid var(--color-gray-dark);
}
html, body {
    margin: 0;
    padding: 0;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
    background-color: var(--color-bg);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 1rem;
    align-items: center;
    font-family: 'Roboto Mono', monospace;
    min-height: 100vh;
}

.selection-page {
    width: 100%;
    max-width: 640px;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0 1rem;
}

.selection-page div,
.selection-page h1,
.selection-page h2 {
    border-radius: 0.5rem;
    padding: 1rem;
}

.selection-page h1,
.selection-page h2 {
    color: var(--color-black);
    text-align: center;
    margin: 0;
}

.selection-page h1.selection-page__description {
    font-size: 1.5rem;
}

.selection-page h2.selection-page__description {
    font-size: 1rem;
}

.selection-page__hero {
    width: 66%;
    margin: 0 auto;
}

.selection-page__hero img {
    width: 100%;
}

.survey {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.survey__field {
    background-color: var(--color-bg-light);
    display: flex;
    flex-direction: column;
    justify-content: left;
    gap: 1rem;
    border: var(--color-border);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.survey__field:has([data-required]) .survey__label-text::after {
    content: " *";
    color: var(--color-error);
    font-weight: bold;
}

.survey__label-text--smaller {
    font-size: smaller;
}

.survey__label-hint {
    font-size: 0.8rem;
}

.survey__input {
    width: 50%;
    border: none;
    border-bottom: 2px solid var(--color-black);
    outline: none;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.75rem;
    padding: 0.5rem 0;
    background: transparent;
}

.survey__input:focus,
.survey__input:active {
    outline: none;
}

.survey__textarea {
    border: none;
    border-bottom: var(--color-border);
    outline: none;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.75rem;
    padding: 0.5rem 0;
    background: transparent;
    resize: none;
    overflow: hidden;
    min-height: 2.5rem;
    line-height: 1.4;
}

.survey__textarea:focus,
.survey__textarea:active {
    outline: none;
}

.survey__error {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--color-error);
    min-height: 1em;
    display: none;
}


.field-hp {
    display: none !important;
    visibility: hidden;
}

.survey__error.is-visible {
    display: block;
}

.survey__field--checkbox label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.2;
}

.survey__field--checkbox input[type="checkbox"],
.survey__field--checkbox input[type="radio"] {
    appearance: none;
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;

    border: 2px solid var(--color-gray-medium);
    background-color: var(--color-white);
    border-radius: 4px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin: 0;
    padding: 0;

    vertical-align: middle;
    box-sizing: border-box;
    cursor: pointer;
}


.survey__field--checkbox input[type="radio"] {
    border-radius: 50%;
}

.survey__field--checkbox input:hover {
    border-color: var(--color-black);
}

.survey__field--checkbox input:checked {
    background-color: var(--color-black);
    border-color: var(--color-black);
}

.survey__field--checkbox input[type="checkbox"]:checked::after {
    content: "✓";
    font-size: 12px;
    line-height: 1;
    color: #fff;
}

.survey__field--checkbox input[type="radio"]:checked::after {
    content: "";
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
}

.survey__field--checkbox label:hover {
    color: var(--color-black);
}

input[type="checkbox"].is-invalid,
input[type="radio"].is-invalid {
    border-color: var(--color-error);
    box-shadow: 0 0 0 2px rgb(176 74 74 / 20%);
}

.survey__field:has(.is-invalid) {
    background-color: rgba(176, 74, 74, 0.04);
    border-color: var(--color-error);
}

.selection-page .survey__actions {
    display: flex;
    justify-content: space-between;
    padding: 0;
}

.survey__btn {
    width: 30%;
    padding: 0.75rem;
    font-family: 'Roboto Mono', monospace;
    font-size: 1rem;
    cursor: pointer;
    border: var(--color-border);
    transition: all 0.2s;
    border-radius: 0.5rem;
}

.survey__btn--submit {
    background-color: var(--color-white);
    color: var(--color-black);
}

.survey__btn--clear {
    background-color: transparent;
    color: var(--color-gray-dark);
}

.survey__btn--submit:hover {
    background-color: var(--color-gray-light);
}

.survey__btn--clear:hover {
    background-color: var(--color-gray-light);
    color: var(--color-white);
}

.footer {
    width: 100%;
    max-width: 640px;
    text-align: left;
    padding: 2rem 1rem;
    margin: 2rem 0;
    border-top: 1px solid var(--color-gray-dark);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.footer-section p {
    margin: 0.5rem 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--color-gray-light);
}

.footer-section .section-title {
    color: var(--color-white);
    font-weight: bold;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer a {
    color: var(--color-white);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.footer a:hover {
    border-bottom-color: var(--color-white);
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.footer-icon {
    width: 1.2rem;
    height: 1.2rem;
    flex-shrink: 0;
    fill: var(--color-gray-light);
    color: var(--color-gray-light);
    transition: all 0.2s;
}

.footer-link:hover .footer-icon[viewBox*="24"] {
    color: var(--color-white);
}

.footer-link:hover .footer-icon[viewBox*="24"] path[d*="L12 2"] {
    color: var(--color-error);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid var(--color-gray-dark);
    color: var(--color-gray-dark);
    padding-top: 1.5rem;
}

.footer-bottom p {
    font-size: 0.75rem;
    opacity: 0.5;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal button {
    min-width: 7rem;
}

.modal.is-visible {
    display: flex;
}

.modal__content {
    background-color: rgb(var(--color-white-rgb) / var(--opacity-75));
    color: var(--color-black);
    padding: 1.5rem;
    border-radius: 0.5rem;
    width: 90%;
    max-width: 420px;
    text-align: center;
    animation: modalFadeIn 0.2s ease-out;
}

.modal__message {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.modal__buttons {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
}

.modal__close {
    border: none;
    background: var(--color-black);
    color: var(--color-white);
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-family: 'Roboto Mono', monospace;
}

.modal__close:hover {
    background: var(--color-gray-dark);
}

.modal--error .modal__content {
    border-left: 4px solid var(--color-error);
}

.modal-warn .modal__content {
    border-left: 4px solid var(--color-warn);
}

.modal--success .modal__content {
    border-left: var(--color-black);
}

.is-invalid {
    border-bottom-color: var(--color-error) !important;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 600px) {
    .selection-page h1.selection-page__description {
        font-size: 1.5rem;
    }

    .survey__field input {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
        gap: 1rem;
    }

    .form-actions button {
        width: 100%;
    }

    .footer {
        text-align: center;
    }

    .modal__buttons {
        flex-direction: column;
        gap: 1rem;
    }
}
