/**
 * Static Forms - Front-end Styles
 *
 * Intentionally minimal for PageSpeed 99-100.
 * No animations, no web fonts, no bloat.
 */

.sf-wrap {
    max-width: 640px;
    margin: 0 auto;
}

.sf-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 1.5rem;
}

.sf-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Field widths */
.sf-field { width: 100%; }
.sf-field--half { width: calc(50% - 0.5rem); }
.sf-field--third { width: calc(33.333% - 0.667rem); }

.sf-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: #1a1a1a;
}

.sf-required {
    color: #dc2626;
    margin-left: 2px;
}

.sf-help {
    font-size: 0.8125rem;
    color: #6b7280;
    margin: 0 0 0.375rem;
}

.sf-input,
.sf-textarea,
.sf-select {
    display: block;
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-size: 0.9375rem;
    font-family: inherit;
    line-height: 1.5;
    color: #1a1a1a;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.sf-input:focus,
.sf-textarea:focus,
.sf-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.sf-input.sf-input--error,
.sf-textarea.sf-input--error,
.sf-select.sf-input--error {
    border-color: #dc2626;
}

.sf-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Options (radio/checkbox) */
.sf-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sf-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    cursor: pointer;
}

.sf-option input {
    margin: 0;
    accent-color: #2563eb;
}

.sf-option--single {
    padding: 0.5rem 0;
}

/* Rating stars */
.sf-rating {
    display: flex;
    gap: 4px;
}

.sf-rating__star {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #d1d5db;
    padding: 2px;
    line-height: 1;
    transition: color 0.1s;
}

.sf-rating__star.sf-rating__star--active,
.sf-rating__star:hover {
    color: #f59e0b;
}

/* Section + Divider */
.sf-section {
    padding-top: 0.5rem;
}

.sf-section__title {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.sf-section__desc {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.sf-divider {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 0.5rem 0;
}

/* Submit */
.sf-actions {
    width: 100%;
    padding-top: 0.5rem;
}

.sf-submit {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: #18181b;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.sf-submit:hover {
    background: #27272a;
}

/* File Upload */
.sf-file-wrap {
    position: relative;
}

.sf-file {
    display: block;
    width: 100%;
    padding: 12px 14px;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--sb-text, #374151);
    background: transparent;
    border: 2px dashed #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.sf-file:hover {
    border-color: #9ca3af;
    background: #f9fafb;
}

.sf-file:focus {
    outline: none;
    border-color: #6366f1;
    border-style: solid;
}

.sf-file::file-selector-button {
    padding: 6px 16px;
    margin-right: 12px;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: #374151;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}

.sf-file::file-selector-button:hover {
    background: #1f2937;
}

.sf-file-info {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 4px;
}

.sf-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sf-submit__loading {
    display: none;
}

.sf-form--submitting .sf-submit__text { display: none; }
.sf-form--submitting .sf-submit__loading {
    display: inline-flex;
    animation: sf-spin 0.8s linear infinite;
}

@keyframes sf-spin {
    to { transform: rotate(360deg); }
}

/* Messages */
.sf-message {
    width: 100%;
}

.sf-message:empty {
    display: none;
}

.sf-message--success {
    padding: 1rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    color: #166534;
    font-size: 0.9375rem;
}

.sf-message--error {
    padding: 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #991b1b;
    font-size: 0.9375rem;
}

.sf-field-error {
    font-size: 0.8125rem;
    color: #dc2626;
    margin-top: 0.25rem;
}

.sf-field-error:empty {
    display: none;
}

/* Honeypot - hidden from humans */
.sf-hp {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* Conditional hidden fields */
.sf-field[data-sf-hidden="true"] {
    display: none;
}

/* Inline layout variant */
.sf-form--inline .sf-field {
    width: auto;
    flex: 1;
}

.sf-form--inline .sf-actions {
    width: auto;
    padding-top: 0;
    align-self: flex-end;
}

/* Responsive */
@media (max-width: 600px) {
    .sf-field--half,
    .sf-field--third {
        width: 100%;
    }

    .sf-form--inline {
        flex-direction: column;
    }

    .sf-form--inline .sf-actions {
        width: 100%;
    }

    .sf-submit {
        width: 100%;
        justify-content: center;
    }
}
