.staf-native-preview,
.staf-native-form,
.staf-native-form__notice,
.staf-native-form__preview-notice {
    --staf-primary: #0b6b3a;
    --staf-primary-hover: #07502c;
    --staf-primary-soft: #eef8f2;
    --staf-accent: #b42318;
    --staf-text: #243746;
    --staf-muted: #667782;
    --staf-border: #dbe5df;
    --staf-surface: #ffffff;
    --staf-surface-soft: #f7faf8;
    --staf-danger: #b42318;
    --staf-focus: #b9dfcf;
}

.staf-native-preview {
    min-height: 100vh;
    padding: 24px;
    background: var(--staf-surface-soft);
    color: var(--staf-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.staf-native-form,
.staf-native-form * {
    box-sizing: border-box;
}

.staf-native-form {
    width: min(100%, 1160px);
    margin: 24px auto 48px;
    padding: clamp(20px, 4vw, 40px);
    overflow-wrap: anywhere;
    background: var(--staf-surface);
    border: 1px solid var(--staf-border);
    border-radius: 12px;
    color: var(--staf-text);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
}

.staf-native-form__header {
    margin: 0 0 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--staf-border);
}

.staf-native-form__header h1 {
    margin: 0 0 8px;
    color: var(--staf-primary);
    font-size: clamp(26px, 4vw, 36px);
    line-height: 1.2;
}

.staf-native-form__header p,
.staf-native-form__description {
    margin: 0;
    color: var(--staf-muted);
}

.staf-native-form__progress {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 16px;
    margin: 0 0 24px;
    color: var(--staf-primary-hover);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
}

.staf-native-form__progress strong {
    font-size: 14px;
    letter-spacing: 0;
}

.staf-native-form__progress > div {
    grid-column: 1 / -1;
    height: 8px;
    overflow: hidden;
    background: var(--staf-border);
    border-radius: 999px;
}

.staf-native-form__progress i {
    display: block;
    width: 0;
    height: 100%;
    background: var(--staf-primary);
    border-radius: inherit;
    transition: width .15s ease;
}

.staf-native-form__sections {
    display: grid;
    gap: 20px;
}

.staf-native-form fieldset {
    min-width: 0;
    margin: 0;
    padding: clamp(18px, 3vw, 28px);
    background: var(--staf-surface);
    border: 1px solid var(--staf-border);
    border-top: 3px solid var(--staf-primary-soft);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(23, 43, 77, .05);
}

.staf-native-form legend {
    max-width: 100%;
    padding: 0 8px;
    color: var(--staf-primary);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.staf-native-form__description {
    margin-bottom: 16px;
    font-size: 14px;
}

.staf-native-form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 24px;
}

.staf-native-form__field {
    display: grid;
    min-width: 0;
    align-content: start;
    gap: 6px;
    margin: 0;
}

.staf-native-form__field--full {
    grid-column: 1 / -1;
}

.staf-native-form__label,
.staf-native-form__checkbox {
    color: var(--staf-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.staf-native-form__required {
    color: var(--staf-accent);
}

.staf-native-form input:not([type="radio"]):not([type="checkbox"]),
.staf-native-form select,
.staf-native-form textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 9px 12px;
    background: var(--staf-surface);
    border: 1px solid var(--staf-border);
    border-radius: 6px;
    color: var(--staf-text);
    font: inherit;
    line-height: 1.35;
}

.staf-native-form textarea {
    min-height: 112px;
    resize: vertical;
}

.staf-native-form input:not([type="radio"]):not([type="checkbox"]):focus,
.staf-native-form select:focus,
.staf-native-form textarea:focus,
.staf-native-form input[type="radio"]:focus-visible,
.staf-native-form input[type="checkbox"]:focus-visible {
    border-color: var(--staf-primary);
    outline: 2px solid var(--staf-focus);
    outline-offset: 1px;
    box-shadow: none;
}

.staf-native-form__choices {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px 18px;
    padding-top: 2px;
}

.staf-native-form__choices--compact {
    gap: 10px 24px;
}

.staf-native-form__choices label,
.staf-native-form__checkbox {
    display: inline-flex;
    width: auto;
    max-width: 100%;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
}

.staf-native-form__choices label {
    padding: 7px 11px;
    background: var(--staf-surface-soft);
    border: 1px solid var(--staf-border);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

.staf-native-form input[type="radio"],
.staf-native-form input[type="checkbox"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 1px 0 0;
    accent-color: var(--staf-primary);
}

.staf-native-form__checkbox {
    padding: 14px 16px;
    background: var(--staf-surface-soft);
    border: 1px solid var(--staf-border);
    border-radius: 8px;
}

.staf-native-form small {
    display: block;
    color: var(--staf-muted);
    font-size: 13px;
    line-height: 1.4;
}

.staf-native-form__field-error {
    min-height: 18px;
    color: var(--staf-danger);
    font-size: 13px;
    line-height: 1.35;
}

.staf-native-form__field--invalid input,
.staf-native-form__field--invalid select,
.staf-native-form__field--invalid textarea,
.staf-native-form [aria-invalid="true"] {
    border-color: var(--staf-danger);
    box-shadow: 0 0 0 1px var(--staf-danger);
}

.staf-native-form > button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    margin-top: 24px;
    padding: 10px 20px;
    background: var(--staf-primary);
    border: 1px solid var(--staf-primary);
    border-radius: 6px;
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.staf-native-form > button:focus-visible {
    outline: 3px solid var(--staf-focus);
    outline-offset: 2px;
}

.staf-native-form > button:not(:disabled):hover {
    background: var(--staf-primary-hover);
    border-color: var(--staf-primary-hover);
}

.staf-native-form > button:disabled {
    cursor: wait;
    opacity: .68;
}

.staf-native-form--preview > button:disabled {
    background: var(--staf-muted);
    border-color: var(--staf-muted);
    cursor: not-allowed;
}

.staf-native-form__trap {
    position: absolute !important;
    left: -10000px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.staf-native-form__notice,
.staf-native-form__preview-notice {
    width: min(calc(100% - 32px), 1160px);
    margin: 16px auto;
    padding: 12px 16px;
    border: 1px solid;
    border-left-width: 4px;
    border-radius: 8px;
    font-family: inherit;
}

.staf-native-form__preview-notice {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    background: var(--staf-primary-soft);
    border-color: var(--staf-focus);
    color: var(--staf-primary-hover);
}

.staf-native-form__notice--success {
    background: var(--staf-primary-soft);
    border-color: var(--staf-primary);
    color: var(--staf-primary-hover);
}

.staf-native-form__notice--error {
    background: #fff5f5;
    border-color: var(--staf-danger);
    color: var(--staf-danger);
}

.staf-native-form__antispam,
.staf-native-form__antispam-placeholder {
    margin: 16px 0;
}

.staf-native-form__antispam-placeholder {
    padding: 12px;
    background: var(--staf-surface-soft);
    border-radius: 6px;
    color: var(--staf-muted);
}

@media (max-width: 782px) {
    .staf-native-preview {
        padding: 16px;
    }

    .staf-native-form {
        margin: 16px auto 32px;
        padding: 20px;
    }

    .staf-native-form__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .staf-native-form__field,
    .staf-native-form__field--full {
        grid-column: 1;
    }
}

@media (max-width: 480px) {
    .staf-native-preview {
        padding: 0;
    }

    .staf-native-form {
        width: 100%;
        margin: 0;
        padding: 16px;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .staf-native-form fieldset {
        padding: 16px;
    }

    .staf-native-form legend {
        font-size: 18px;
    }

    .staf-native-form__preview-notice {
        display: grid;
        width: calc(100% - 24px);
        gap: 4px;
    }

    .staf-native-form__choices {
        gap: 8px;
    }

    .staf-native-form__choices label {
        max-width: 100%;
    }

    .staf-native-form > button {
        width: 100%;
    }
}
