/* Sidestreet Forms — front-end. Deliberately light so the theme's type and colors come through. */
.ssf-form-wrap {
    --ssf-gap: 1.25rem;
    --ssf-border: color-mix(in srgb, currentColor 30%, transparent);
    --ssf-focus: #2563eb;
    --ssf-error: #b42318;
    --ssf-radius: 6px;
    max-width: 100%;
}

.ssf-form {
    display: grid;
    gap: var(--ssf-gap);
}

.ssf-field {
    border: 0;
    margin: 0;
    min-width: 0;
    padding: 0;
}

.ssf-label {
    display: block;
    font-weight: 600;
    margin: 0 0 0.4rem;
    padding: 0;
}

.ssf-required {
    color: var(--ssf-error);
}

.ssf-input {
    background: #fff;
    border: 1px solid var(--ssf-border);
    border-radius: var(--ssf-radius);
    box-sizing: border-box;
    color: #111;
    display: block;
    font: inherit;
    line-height: 1.4;
    max-width: 100%;
    padding: 0.65rem 0.75rem;
    width: 100%;
}

textarea.ssf-input {
    min-height: 8rem;
    resize: vertical;
}

.ssf-input:focus-visible,
.ssf-choice input:focus-visible {
    border-color: var(--ssf-focus);
    outline: 2px solid var(--ssf-focus);
    outline-offset: 1px;
}

.ssf-name {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ssf-sublabel {
    display: block;
    font-size: 0.8em;
    margin-top: 0.25rem;
    opacity: 0.75;
}

.ssf-choices {
    display: grid;
    gap: 0.45rem;
}

.ssf-choice {
    align-items: flex-start;
    cursor: pointer;
    display: flex;
    gap: 0.55rem;
}

.ssf-choice input {
    flex: none;
    margin: 0.3em 0 0;
}

.ssf-description {
    font-size: 0.875em;
    margin: 0.35rem 0 0;
    opacity: 0.8;
}

.ssf-section-title {
    border-bottom: 1px solid var(--ssf-border);
    margin: 0.5rem 0 0;
    padding-bottom: 0.4rem;
}

.ssf-error {
    color: var(--ssf-error);
    font-size: 0.875em;
    font-weight: 600;
    margin: 0.35rem 0 0;
}

.ssf-field--has-error .ssf-input {
    border-color: var(--ssf-error);
}

.ssf-form-error {
    background: #fef3f2;
    border: 1px solid #fda29b;
    border-radius: var(--ssf-radius);
    color: var(--ssf-error);
    padding: 0.75rem 1rem;
}

.ssf-form-error[hidden],
.ssf-error[hidden] {
    display: none;
}

.ssf-submit {
    cursor: pointer;
}

.ssf-form--busy .ssf-submit {
    cursor: progress;
    opacity: 0.6;
}

.ssf-confirmation {
    background: #ecfdf3;
    border: 1px solid #a6f4c5;
    border-radius: var(--ssf-radius);
    color: #054f31;
    padding: 1rem 1.25rem;
}

.ssf-confirmation > :first-child {
    margin-top: 0;
}

.ssf-confirmation > :last-child {
    margin-bottom: 0;
}

.ssf-notice {
    background: #fffaeb;
    border: 1px dashed #f79009;
    border-radius: var(--ssf-radius);
    color: #7a2e0e;
    font-size: 0.875em;
    margin: 0;
    padding: 0.6rem 0.8rem;
}

/* Honeypot: off-screen rather than display:none, which some bots skip. */
.ssf-hp {
    height: 1px;
    left: -9999px;
    overflow: hidden;
    position: absolute;
    width: 1px;
}

@media (max-width: 480px) {
    .ssf-name {
        grid-template-columns: 1fr;
    }
}

/* The hidden attribute must win over the grid/flex display rules above. */
.ssf-form [hidden] {
    display: none !important;
}

/* Multi-page forms */
.ssf-page {
    display: grid;
    gap: var(--ssf-gap);
}

.ssf-page-title {
    margin: 0;
}

.ssf-page-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.ssf-prev,
.ssf-next {
    cursor: pointer;
}

/* Secondary look, so the way forward is the obvious button. */
.ssf-prev {
    background: transparent;
    border: 1px solid currentColor;
    border-radius: var(--ssf-radius);
    color: inherit;
    font: inherit;
    padding: calc(0.667em + 1px) calc(1.333em + 1px);
}

.ssf-prev:focus-visible {
    outline: 2px solid var(--ssf-focus);
    outline-offset: 2px;
}

.ssf-page-title {
    font-size: 1.25em;
}

/* Without JavaScript every page shows at once, so step buttons would do nothing. */
.ssf-form:not(.ssf-js) [data-ssf-nav] {
    display: none;
}

.ssf-form:not(.ssf-js) .ssf-page + .ssf-page {
    border-top: 1px solid var(--ssf-border);
    padding-top: var(--ssf-gap);
}

.ssf-progress__text {
    font-size: 0.875em;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.ssf-progress__bar {
    background: color-mix(in srgb, currentColor 12%, transparent);
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.ssf-progress__bar span {
    background: var(--ssf-focus);
    border-radius: 999px;
    display: block;
    height: 100%;
    transition: width 0.2s ease;
    width: 0;
}

/* File upload and calculation fields */
.ssf-file {
    display: block;
    font: inherit;
    max-width: 100%;
}

.ssf-calc {
    background: color-mix(in srgb, currentColor 6%, #fff);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
    .ssf-progress__bar span {
        transition: none;
    }
}
