/* ============================================================
 * Simple Feedback Form — accessible styling
 * - Visible focus states (WCAG 2.4.7)
 * - Large touch targets (44x44 min, WCAG 2.5.5)
 * - High contrast (WCAG 1.4.3 / 1.4.11)
 * - Honors prefers-reduced-motion / forced-colors
 * ============================================================ */

.sff-wrapper {
    max-width: 640px;
    margin: 0 auto;
    padding: 1rem;
    /* Force light rendering for native form controls + scrollbars,
       even when the rest of the site / OS is in dark mode. */
    color-scheme: light;
}

.sff-form {
    background: #ffffff;
    color: #111;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    padding: 1.75rem;
    font-family: inherit;
    line-height: 1.5;
    /* Belt-and-braces: re-assert light surface in case a parent
       theme paints the form dark via descendant selectors. */
    color-scheme: light;
}

.sff-form-heading {
    margin: 0 0 .5rem;
    font-size: 1.5rem;
    line-height: 1.25;
}

.sff-form-description {
    margin: 0 0 1.25rem;
    color: #4b5563;
    font-size: 1rem;
}

.sff-field {
    margin-bottom: 1.25rem;
}

.sff-label {
    display: block;
    font-weight: 600;
    margin-bottom: .375rem;
    color: #111;
}

.sff-required {
    color: #b42318;
    margin-left: 2px;
}

.sff-input,
.sff-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: .75rem .875rem;
    font: inherit;
    color: #111;
    background: #fff;
    border: 1px solid #98a2b3;
    border-radius: 8px;
    min-height: 44px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.sff-textarea {
    resize: vertical;
    min-height: 140px;
    line-height: 1.5;
}

.sff-input:hover,
.sff-textarea:hover {
    border-color: #475467;
}

.sff-input:focus,
.sff-textarea:focus {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
    border-color: #2563eb;
}

.sff-input[aria-invalid="true"],
.sff-textarea[aria-invalid="true"] {
    border-color: #b42318;
    background-color: #fff5f5;
}

.sff-hint {
    display: block;
    font-size: .875rem;
    color: #475467;
    margin-top: .375rem;
}

.sff-error {
    display: block;
    color: #b42318;
    font-size: .9375rem;
    font-weight: 500;
    margin-top: .375rem;
    min-height: 0;
}

.sff-error:not(:empty)::before {
    content: "⚠ ";
    margin-right: 4px;
}

/* Honeypot — visually & semantically hidden from real users. */
.sff-hp {
    position: absolute !important;
    left: -10000px !important;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Error summary box. */
.sff-error-summary {
    border: 2px solid #b42318;
    background: #fff5f5;
    color: #7a271a;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
}

.sff-error-summary:focus {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}

.sff-error-summary h3 {
    margin: 0 0 .5rem;
    font-size: 1.0625rem;
    color: #7a271a;
}

.sff-error-summary ul {
    margin: 0;
    padding-left: 1.25rem;
}

.sff-error-summary a {
    color: #7a271a;
    text-decoration: underline;
    font-weight: 600;
}

.sff-error-summary a:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Status (success / generic). */
.sff-status {
    margin-bottom: 0;
}

.sff-status:not(:empty) {
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    border: 2px solid #027a48;
    background: #ecfdf3;
    color: #054f31;
    font-weight: 500;
}

.sff-status.is-error:not(:empty) {
    border-color: #b42318;
    background: #fff5f5;
    color: #7a271a;
}

/* Submit button. */
.sff-actions {
    margin-top: 1.5rem;
}

.sff-submit {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    border: 2px solid #2563eb;
    padding: .75rem 1.5rem;
    font: inherit;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
    transition: background .15s ease, border-color .15s ease, transform .05s ease;
}

.sff-submit:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.sff-submit:focus {
    outline: 3px solid #1d4ed8;
    outline-offset: 2px;
}

.sff-submit:active {
    transform: translateY(1px);
}

.sff-submit[disabled] {
    background: #98a2b3;
    border-color: #98a2b3;
    cursor: not-allowed;
}

/* Reduced motion. */
@media (prefers-reduced-motion: reduce) {
    .sff-input,
    .sff-textarea,
    .sff-submit {
        transition: none;
    }
}

/* High-contrast / forced-colors mode. */
@media (forced-colors: active) {
    .sff-input,
    .sff-textarea,
    .sff-submit,
    .sff-error-summary,
    .sff-status:not(:empty) {
        border: 2px solid CanvasText;
    }
    .sff-input:focus,
    .sff-textarea:focus,
    .sff-submit:focus,
    .sff-error-summary:focus {
        outline: 3px solid Highlight;
    }
}
