/* ========================================================================== 
   WordForm Frontend Custom Styles
   --------------------------------------------------------------------------
   Adds responsive, theme-friendly styling for WordForm generated forms while
   keeping the markup compatible with all WordPress themes.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Layout foundation and design tokens
   -------------------------------------------------------------------------- */
.sc-wordform-built-form-frontend-outermost-div-wrapper {
    --wf-font-family: inherit;
    --wf-text-color: inherit;
    --wf-field-bg: #ffffff;
    --wf-field-color: #1f2937;
    --wf-field-border: #c6ccd6;
    --wf-field-border-hover: #9aa3b5;
    --wf-field-border-focus: #1d4ed8;
    --wf-field-shadow-focus: 0 0 0 3px rgba(29, 78, 216, 0.18);
    --wf-field-radius: 6px;
    --wf-field-padding-y: 0.65rem;
    --wf-field-padding-x: 0.85rem;
    --wf-muted-color: #6b7280;
    --wf-error-color: #d62d30;
    --wf-success-color: #2f9d5c;
    --wf-warning-color: #f59e0b;
    --wf-space-xs: 0.35rem;
    --wf-space-sm: 0.6rem;
    --wf-space-md: 0.95rem;
    --wf-space-lg: 1.35rem;
    --wf-transition: 0.2s ease;
    width: 100%;
    max-width: 100%;
    font-family: var(--wf-font-family, inherit);
    color: var(--wf-text-color, inherit);
    line-height: 1.5;
    background: transparent;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper *,
.sc-wordform-built-form-frontend-outermost-div-wrapper *::before,
.sc-wordform-built-form-frontend-outermost-div-wrapper *::after {
    box-sizing: border-box;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper form {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    display: block;
    background: inherit;
}

@media (max-width: 768px) {
    /* Force full-width layout on smaller viewports even when custom width is applied */
    .sc-wordform-built-form-frontend-outermost-div-wrapper form {
        width: 100% !important;
        max-width: 100% !important;
    }
}

.sc-wordform-built-form-frontend-outermost-div-wrapper form.small,
.sc-wordform-built-form-frontend-outermost-div-wrapper form.medium,
.sc-wordform-built-form-frontend-outermost-div-wrapper form.large {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper form.small {
    max-width: 32rem;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper form.medium {
    max-width: 44rem;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper form.large {
    max-width: 56rem;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper fieldset {
    border: 0;
    margin: 0 0 var(--wf-space-lg);
    padding: 0;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper legend {
    font-weight: 600;
    margin-bottom: var(--wf-space-sm);
}

.sc-wordform-built-select-wrapper,
.sc-wordform-built-radio-wrapper,
.sc-wordform-built-checkbox-wrapper,
.sc-wordform-built-textarea-wrapper,
.sc-wordform-built-captcha-wrapper,
.sc-wordform-built-number-wrapper,
.sc-wordform-built-range-wrapper,
.sc-wordform-built-upload-wrapper,
.sc-wordform-built-text-wrapper,
.sc-wordform-built-email-wrapper,
.sc-wordform-built-url-wrapper,
.sc-wordform-built-tel-wrapper,
.sc-wordform-built-date-wrapper,
.sc-wordform-built-time-wrapper,
.sc-wordform-built-week-wrapper,
.sc-wordform-built-month-wrapper,
.sc-wordform-built-datetime-wrapper,
.sc-wordform-built-datetime-local-wrapper,
.sc-wordform-built-color-wrapper,
.sc-wordform-built-password-wrapper,
.sc-wordform-built-search-wrapper {
    margin-bottom: var(--wf-space-lg);
}

.sc-wordform-built-select-element-label-wrapper,
.sc-wordform-built-checkbox-element-label-wrapper,
.sc-wordform-built-radio-element-label-wrapper,
.sc-wordform-built-textarea-element-label-wrapper,
.sc-wordform-built-upload-element-label-wrapper,
.sc-wordform-built-email-wrapper {
    margin-bottom: var(--wf-space-xs);
}

.sc-wordform-built-upload-wrapper {
    margin-top: var(--wf-space-lg);
    margin-bottom: var(--wf-space-xs);
}

.sc-wordform-built-form-frontend-outermost-div-wrapper label {
    display: inline-block;
    font-weight: 600;
    color: inherit;
    margin-bottom: var(--wf-space-xs);
}

/* --------------------------------------------------------------------------
   2. Text inputs, selects, and textareas
   -------------------------------------------------------------------------- */
.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="text"],
.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="email"],
.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="number"],
.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="password"],
.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="search"],
.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="tel"],
.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="url"],
.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="date"],
.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="datetime"],
.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="datetime-local"],
.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="month"],
.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="week"],
.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="time"],
.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="color"],
.sc-wordform-built-form-frontend-outermost-div-wrapper input:not([type]) {
    display: block;
    width: 100%;
    min-height: 40px;
    padding: var(--wf-field-padding-y) var(--wf-field-padding-x);
    border: 1px solid var(--wf-field-border);
    border-radius: var(--wf-field-radius);
    background-color: var(--wf-field-bg);
    color: var(--wf-field-color);
    font-size: 1rem;
    line-height: 1.45;
    margin-top: var(--wf-space-xs);
    margin-bottom: var(--wf-space-xs);
    transition: border-color var(--wf-transition), box-shadow var(--wf-transition), background-color var(--wf-transition);
    appearance: none;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper textarea {
    display: block;
    width: 100%;
    min-height: 8.5rem;
    padding: var(--wf-field-padding-y) var(--wf-field-padding-x);
    border: 1px solid var(--wf-field-border);
    border-radius: var(--wf-field-radius);
    background-color: var(--wf-field-bg);
    color: var(--wf-field-color);
    font-size: 1rem;
    line-height: 1.55;
    margin-top: var(--wf-space-xs);
    margin-bottom: var(--wf-space-xs);
    resize: vertical;
    transition: border-color var(--wf-transition), box-shadow var(--wf-transition), background-color var(--wf-transition);
}

.sc-wordform-built-form-frontend-outermost-div-wrapper select {
    display: block;
    width: 100%;
    min-height: 40px;
    padding: var(--wf-field-padding-y) calc(var(--wf-field-padding-x) + 1.75rem) var(--wf-field-padding-y) var(--wf-field-padding-x);
    border: 1px solid var(--wf-field-border);
    border-radius: var(--wf-field-radius);
    background-color: var(--wf-field-bg);
    background-image:
        linear-gradient(45deg, transparent 50%, var(--wf-muted-color) 50%),
        linear-gradient(135deg, var(--wf-muted-color) 50%, transparent 50%),
        linear-gradient(to right, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.08));
    background-position:
        calc(100% - 1.2rem) 50%,
        calc(100% - 0.75rem) 50%,
        calc(100% - 2.5rem) 50%;
    background-size:
        7px 7px,
        7px 7px,
        1px 60%;
    background-repeat: no-repeat;
    font-size: 1rem;
    line-height: 1.4;
    color: var(--wf-field-color);
    margin-top: var(--wf-space-xs);
    margin-bottom: var(--wf-space-xs);
    transition: border-color var(--wf-transition), box-shadow var(--wf-transition), background-color var(--wf-transition);
    appearance: none;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper select::-ms-expand {
    display: none;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="file"] {
    display: block;
    width: 100%;
    padding: var(--wf-field-padding-y) var(--wf-field-padding-x);
    border: 1px solid var(--wf-field-border);
    border-radius: var(--wf-field-radius);
    background-color: var(--wf-field-bg);
    color: var(--wf-field-color);
    font-size: 1rem;
    line-height: 1.45;
    margin-top: var(--wf-space-xs);
    margin-bottom: var(--wf-space-xs);
    transition: border-color var(--wf-transition), box-shadow var(--wf-transition), background-color var(--wf-transition);
    appearance: none;
    border-style: solid;
    cursor: pointer;
    box-sizing: border-box;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="file"]::file-selector-button {
    margin-right: 1rem;
    padding: 0.45rem 1rem;
    border: 0;
    border-radius: calc(var(--wf-field-radius) - 2px);
    background-color: var(--wf-field-border-focus);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="file"]::file-selector-button:hover,
.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="file"]::file-selector-button:focus-visible {
    background-color: #0f3fb8;
    transform: translateY(-1px);
    outline: none;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="file"]::-webkit-file-upload-button {
    margin-right: 1rem;
    padding: 0.45rem 1rem;
    border: 0;
    border-radius: calc(var(--wf-field-radius) - 2px);
    background-color: var(--wf-field-border-focus);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="color"] {
    width: 3rem;
    padding: 0.1rem;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="range"] {
    width: 100%;
    margin-top: var(--wf-space-xs);
    margin-bottom: var(--wf-space-xs);
    background: transparent;
    height: 1.5rem;
    padding: 0;
    appearance: none;
    accent-color: var(--wf-field-border-focus);
    cursor: pointer;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="range"]:active {
    cursor: grabbing;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="range"]:focus {
    outline: none;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    background-color: var(--wf-field-border-hover);
    border-radius: 999px;
    transition: background-color 0.2s ease;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="range"]::-webkit-slider-thumb {
    height: 18px;
    width: 18px;
    margin-top: -6px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    background-color: var(--wf-field-border-focus);
    box-shadow: -999px 0 0 995px rgba(34, 113, 177, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2);
    appearance: none;
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.05);
    cursor: grabbing;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="range"]::-moz-range-track {
    height: 6px;
    background-color: var(--wf-field-border-hover);
    border-radius: 999px;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="range"]::-moz-range-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    background-color: var(--wf-field-border-focus);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: grab;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="range"]::-moz-range-progress {
    height: 6px;
    border-radius: 999px 0 0 999px;
    background-color: var(--wf-field-border-focus);
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="range"]::-ms-track {
    height: 6px;
    border-color: transparent;
    color: transparent;
    background: transparent;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="range"]::-ms-fill-lower {
    background-color: var(--wf-field-border-focus);
    border-radius: 999px;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="range"]::-ms-fill-upper {
    background-color: var(--wf-field-border-hover);
    border-radius: 999px;
}

/* Placeholder styling */
.sc-wordform-built-form-frontend-outermost-div-wrapper input::placeholder,
.sc-wordform-built-form-frontend-outermost-div-wrapper textarea::placeholder {
    color: var(--wf-muted-color);
    opacity: 1;
    transition: color var(--wf-transition), transform var(--wf-transition);
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input:focus::placeholder,
.sc-wordform-built-form-frontend-outermost-div-wrapper textarea:focus::placeholder {
    color: rgba(107, 114, 128, 0.65);
    transform: translateX(4px);
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input::-webkit-input-placeholder,
.sc-wordform-built-form-frontend-outermost-div-wrapper textarea::-webkit-input-placeholder {
    color: var(--wf-muted-color);
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input:-ms-input-placeholder,
.sc-wordform-built-form-frontend-outermost-div-wrapper textarea:-ms-input-placeholder {
    color: var(--wf-muted-color);
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input::-ms-input-placeholder,
.sc-wordform-built-form-frontend-outermost-div-wrapper textarea::-ms-input-placeholder {
    color: var(--wf-muted-color);
}

/* Shared hover/focus/disabled states */
.sc-wordform-built-form-frontend-outermost-div-wrapper :is(
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="password"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    input[type="date"],
    input[type="datetime"],
    input[type="datetime-local"],
    input[type="month"],
    input[type="week"],
    input[type="time"],
    input[type="file"],
    input[type="color"],
    input:not([type]),
    select,
    textarea
):hover {
    border-color: var(--wf-field-border-hover) !important;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper :is(
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="password"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    input[type="date"],
    input[type="datetime"],
    input[type="datetime-local"],
    input[type="month"],
    input[type="week"],
    input[type="time"],
    input[type="file"],
    input[type="color"],
    input:not([type]),
    select,
    textarea
):focus,
.sc-wordform-built-form-frontend-outermost-div-wrapper :is(
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="password"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    input[type="date"],
    input[type="datetime"],
    input[type="datetime-local"],
    input[type="month"],
    input[type="week"],
    input[type="time"],
    input[type="file"],
    input[type="color"],
    input:not([type]),
    select,
    textarea
):focus-visible {
    border: 2px solid var(--wf-field-border-focus) !important;
    box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.25);
    outline: none;
    background-color: #ffffff;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="range"]:focus-visible {
    box-shadow: none;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper :is(
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="password"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    input[type="date"],
    input[type="datetime"],
    input[type="datetime-local"],
    input[type="month"],
    input[type="week"],
    input[type="time"],
    input[type="file"],
    input[type="color"],
    input:not([type]),
    select,
    textarea
):disabled {
    cursor: not-allowed;
    background-color: #f5f5f7;
    color: var(--wf-muted-color);
    border-color: #d4d7dd;
    box-shadow: none;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper :is(
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="password"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    input[type="date"],
    input[type="datetime"],
    input[type="datetime-local"],
    input[type="month"],
    input[type="week"],
    input[type="time"],
    input[type="file"],
    input[type="color"],
    input:not([type]),
    textarea
)[readonly] {
    background-color: #f9fafb;
    color: var(--wf-muted-color);
}

/* --------------------------------------------------------------------------
   3. Checkbox and radio controls
   -------------------------------------------------------------------------- */
.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="checkbox"],
.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="radio"] {
    width: 1.05rem;
    height: 1.05rem;
    margin: 0;
    margin-right: var(--wf-space-sm);
    border: 1px solid var(--wf-field-border);
    border-radius: 0.25rem;
    background-color: #ffffff;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    accent-color: var(--wf-field-border-focus);
    cursor: pointer;
    vertical-align: middle;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="radio"] {
    border-radius: 50%;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="checkbox"]:hover,
.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="radio"]:hover {
    border-color: var(--wf-field-border-hover);
    transform: translateY(-1px);
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="checkbox"]:focus-visible,
.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="radio"]:focus-visible {
    outline: 2px solid var(--wf-field-border-focus);
    outline-offset: 2px;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="checkbox"]:disabled,
.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="radio"]:disabled {
    cursor: not-allowed;
    border-color: #d4d7dd;
    background-color: #f5f5f7;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="checkbox"] + label,
.sc-wordform-built-form-frontend-outermost-div-wrapper input[type="radio"] + label {
    display: inline-flex;
    align-items: center;
    gap: var(--wf-space-xs);
    margin: 0;
    font-weight: 500;
    cursor: pointer;
    color: inherit;
}
.sc-wordform-built-terms-conditions-text-label {
    vertical-align: middle;
}
/* --------------------------------------------------------------------------
   4. Structured field groups
   -------------------------------------------------------------------------- */
.sc-wordform-built-firstlastname-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--wf-space-md);
    margin-bottom: var(--wf-space-lg);
}

.sc-wordform-built-first-name-wrapper,
.sc-wordform-built-last-name-wrapper {
    display: flex;
    flex-direction: column;
    gap: var(--wf-space-xs);
}

.sc-wordform-built-first-name,
.sc-wordform-built-last-name {
    width: 100%;
}

.wordform-tel-element-phone-hints,
.wordform-datetime-element-format-hints {
    color: var(--wf-muted-color);
    font-size: 0.9rem;
    margin-top: var(--wf-space-xs);
}

/* --------------------------------------------------------------------------
   5. Status messaging and helper text
   -------------------------------------------------------------------------- */
span.sc-wordform-required-field {
    color: var(--wf-error-color);
    font-weight: 700;
    margin-left: 0.25rem;
}

.sc-wordform-error-input {
    border-color: var(--wf-error-color) !important;
    box-shadow: 0 0 0 3px rgba(214, 45, 48, 0.15) !important;
}

.sc-wordform-error-msg {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: var(--wf-space-xs);
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--wf-error-color);
    font-weight: 600;
    opacity: 0;
    animation: wordformErrorReveal 0.3s ease forwards;
}

@keyframes wordformErrorReveal {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sc-wordform-submission-success-msg-div-wrapper {
    text-align: center;
    color: var(--wf-success-color);
    font-weight: 600;
    padding: var(--wf-space-lg) 0 var(--wf-space-md);
}

.sc-wordform-submisson-fail-msg-div-wrapper {
    text-align: center;
    color: var(--wf-error-color);
    font-weight: 600;
    padding: var(--wf-space-lg) 0 var(--wf-space-md);
}

/* --------------------------------------------------------------------------
   6. File upload customisations
   -------------------------------------------------------------------------- */
.sc-wordform-built-upload-element {
    opacity: 0;
    height: 1%;
}

.wordform-file-upload-label-wrapper {
    display: inline-flex;
    align-items: center;
    gap: var(--wf-space-sm);
    cursor: pointer;
    font-weight: 600;
    color: var(--wf-field-border-focus);
}

.wordform-frontend-fileupload-icon {
    font-size: 1.8rem;
    color: var(--wf-field-border-focus);
    line-height: 1;
    padding-right:  var(--wf-space-sm);
}

ul.wordform-selected-file-names-list {
    margin: var(--wf-space-xs) 0 0;
    padding: 0;
    list-style: none;
}

.wordform-file-list-item {
    display: flex;
    align-items: center;
    gap: var(--wf-space-xs);
    padding: 0.25rem 0;
    animation: wordformFadeIn 0.3s ease-in-out;
    font-size: 0.95rem;
}

.wordform-remove-selected-file {
    color: var(--wf-error-color);
    margin-left: 0.5%;
    cursor: pointer !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    font-size: 1.1rem;
    line-height: 1;
    transition: transform 0.25s ease, color 0.25s ease;
}

.wordform-remove-selected-file:hover,
.wordform-remove-selected-file:focus,
.wordform-remove-selected-file:active {
    color: #b2080c;
    transform: scale(1.2);
}

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

/* --------------------------------------------------------------------------
   7. Range displays and progress indicators
   -------------------------------------------------------------------------- */
.sc-wordform-built-range-wrapper {
    position: relative;    
}

.wordform-range-element-selected-value {
    position: absolute;
    top: calc(100% - 3.8rem);
    right: calc(-1 * clamp(1.2rem, 2.75vw, 2.5rem));
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--wf-muted-color);
    white-space: nowrap;
    text-align: right;
}

.progress-bar {
    width: 0%;
    margin-top: var(--wf-space-md);
    border-radius: 999px;
    color: #ffffff;
    text-align: center;
    font-size: 0.85rem;
    line-height: 1.8;
    background: var(--wf-field-border-focus);
    transition: width 0.4s ease;
}

/* --------------------------------------------------------------------------
   8. Captcha and imagery
   -------------------------------------------------------------------------- */
.sc-wordform-captcha-container-wrapper {
    margin-top: var(--wf-space-md);
    text-align: left;
}

.sc-wordform-captcha-container-wrapper.center {
    text-align: center;
}

.sc-wordform-captcha-container-wrapper.right {
    text-align: right;
}

.sc-wordform-captcha-container-wrapper img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 10px 10px 15px #bebebe, -10px -10px 10px #ffffff;
}

.g-recaptcha {
    margin-top: var(--wf-space-sm);
}

.sc-wordform-captcha-container-wrapper,
.sc-wordform-captcha-container-wrapper.left {
    text-align: left;    
}
.sc-wordform-captcha-container-wrapper.center {
    text-align: center;
}
.sc-wordform-captcha-container-wrapper.right {
    text-align: right; 
}

/* --------------------------------------------------------------------------
   9. Buttons and alignment
   -------------------------------------------------------------------------- */
.sc-wordform-built-form-frontend-outermost-div-wrapper .button {
    vertical-align: top;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper .button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--wf-space-xs);
    background: #2271b1;
    border: 1px solid #2271b1;
    color: #ffffff;
    text-decoration: none;
    text-shadow: none;
    border-radius: 4px;
    white-space: nowrap;
    box-sizing: border-box;
    font-size: 1rem;
    line-height: 1.2;
    padding: 0.75rem 1.75rem;
    min-height: 48px;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper .button-primary:hover {
    background: #006ba1;
    border-color: #006ba1;
    transform: translateY(-1px);
}

.sc-wordform-built-form-frontend-outermost-div-wrapper .button-primary:focus-visible {
    outline: 2px solid var(--wf-field-border-focus);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.2);
}

.sc-wordform-built-form-frontend-outermost-div-wrapper .button-primary:disabled {
    background-color: #9aa3b5;
    border-color: #9aa3b5;
    cursor: not-allowed;
    opacity: 0.8;
    transform: none;
}

.sc-wordform-built-form-frontend-outermost-div-wrapper .button-large {
    min-height: 48px;
    padding: 0 1.2rem;
    line-height: 1.4;
}

.sc-wordform-built-form-submit-button-wrapper,
.sc-wordform-built-form-formname-label-wrapper.left {
    text-align: left;
    margin: 5% 0;
}

.sc-wordform-built-form-submit-button-wrapper.center,
.sc-wordform-built-form-formname-label-wrapper.center {
    text-align: center;
    margin: 5% 0;
}

.sc-wordform-built-form-submit-button-wrapper.right,
.sc-wordform-built-form-formname-label-wrapper.right {
    text-align: right;
    margin: 5% 0;
}

/* Full-width version of WordForm button */
.wordform-button-full-width {
	display: block;
	width: 100%;
	text-align: center;
	box-sizing: border-box;
	white-space: nowrap;
	transition: all 0.25s ease;
}

/* Optional: smooth hover size feel without color change */
.wordform-button-full-width:hover {
	transform: scale(1.02);
}

/* For small screens ensure it stays readable */
@media (max-width: 600px) {
	.wordform-button-full-width {
		font-size: 15px;
		padding: 10px 18px;
	}
}

/* --------------------------------------------------------------------------
   10. Date picker affordance
   -------------------------------------------------------------------------- */
.sc-wordform-built-date-wrapper {
    position: relative;
    width: 100%;
}

.sc-wordform-built-date-wrapper input.sc-wordform-built-date-element {
    width: 100%;
    padding-right: calc(var(--wf-field-padding-x) + 2.2rem);
    box-sizing: border-box;
    cursor: pointer;
}

.sc-wordform-built-date-wrapper .sc-wordform-built-date-element-input-icon {
    position: absolute;
    right: 0.25rem;
    top: 70%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    pointer-events: none;
    color: var(--wf-muted-color);
    transition: color 0.2s ease;
    line-height: 1;    
}

.sc-wordform-built-date-wrapper:hover .sc-wordform-built-date-element-input-icon {
    color: var(--wf-field-border-focus);
    transform: translateY(-50%) scale(1.1);
}

.sc-wordform-built-date-wrapper .sc-wordform-built-date-element-input-icon svg {
    display: block;
    width: 18px;
    height: 18px;    
}

/* --------------------------------------------------------------------------
   11. Preview & test interface
   -------------------------------------------------------------------------- */
.wordform-preview-n-test-form-wrapper {
    width: min(100%, 720px);
    margin: 3% auto;
    padding: 0 1.25rem;
    transition: width 0.5s ease, margin 0.5s ease, transform 0.3s ease;
    max-width: 100%;
    box-sizing: border-box;
}

.wordform-preview-n-test-form-wrapper.resizing {
    transform: scale(1.02);
}

.wordform-responsive-toolbar {
    position: fixed;
    top: 72px;
    right: 48px;
    z-index: 9999;
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.95);
    padding: 6px 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(4px);
}

.wordform-responsive-toolbar .res-btn {
    background: #007cba;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.wordform-responsive-toolbar .res-btn:hover {
    background: #005a87;
    transform: scale(1.1);
    box-shadow: 0 6px 14px rgba(0, 92, 141, 0.35);
}

.wordform-responsive-toolbar .res-btn:hover::after {
    content: attr(title);
    position: absolute;
    top: -35px;
    right: 50%;
    transform: translateX(50%);
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.2s ease;
    z-index: 10000;
}

.wordform-responsive-toolbar .res-btn.active {
    background: #ff9800;
    color: #ffffff;
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.35);
}

/* --------------------------------------------------------------------------
   12. Responsive adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .wordform-responsive-toolbar {
        right: 24px;
    }
}

@media (max-width: 768px) {
    .wordform-preview-n-test-form-wrapper {
        width: 100%;
        margin: 2% auto;
        padding: 0 1rem;
    }

    .sc-wordform-built-form-frontend-outermost-div-wrapper form.small,
    .sc-wordform-built-form-frontend-outermost-div-wrapper form.medium,
    .sc-wordform-built-form-frontend-outermost-div-wrapper form.large {
        max-width: 100%;
    }

    .sc-wordform-built-firstlastname-row {
        grid-template-columns: 1fr;
    }

    .wordform-responsive-toolbar {
        top: 64px;
        right: 16px;
    }

    /* .sc-wordform-built-form-frontend-outermost-div-wrapper .button-primary {
        width: 100%;
    } */

    .wordform-remove-selected-file {
        font-size: 1.25rem;
    }
}

@media (max-width: 600px) {
    .sc-wordform-built-form-frontend-outermost-div-wrapper input[type="checkbox"] + label,
    .sc-wordform-built-form-frontend-outermost-div-wrapper input[type="radio"] + label {
        align-items: flex-start;
        line-height: 1.4;
    }

    .sc-wordform-built-form-frontend-outermost-div-wrapper {
        padding-bottom: 80px;
    }
        
    .wordform-responsive-toolbar {
        top: auto;        
        bottom: 24px;
        right: 16px;           
    }

    .wordform-responsive-toolbar .res-btn:hover::after {
        top: auto;
        bottom: -35px;
    }
}

@media (max-width: 480px) {
    .wordform-preview-n-test-form-wrapper {
        padding: 0 0.75rem;
    }

    .sc-wordform-error-msg {
        font-size: 0.95rem;
    }

    .wordform-file-list-item {
        font-size: 0.9rem;
    }
}

/* --------------------------------------------------------------------------
   13. Reduced motion preference
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .sc-wordform-built-form-frontend-outermost-div-wrapper *,
    .sc-wordform-built-form-frontend-outermost-div-wrapper *::before,
    .sc-wordform-built-form-frontend-outermost-div-wrapper *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --------------------------------------------------------------------------
   14. Loading icon on Submit Button Click
   -------------------------------------------------------------------------- */
/* Loading icon beside submit text */
.wordform-users-form-submit-loading-icon {
	display: none; /* hidden by default */
	margin-left: 8px;
	vertical-align: middle;
	color: #ffffff; /* match WP primary button text */
	opacity: 0;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

/* When shown via jQuery .show() */
.wordform-users-form-submit-loading-icon[style*="display: inline"],
.wordform-users-form-submit-loading-icon[style*="display: block"],
.wordform-users-form-submit-loading-icon[style*="display:inline-block"] {
	opacity: 1;
	transform: scale(1.05);
}

/* Optional: modern subtle pulse for the spinning icon */
.wordform-users-form-submit-loading-icon i {
	animation: wordform-icon-pulse 1.2s ease-in-out infinite;
}

@keyframes wordform-icon-pulse {
	0%, 100% { transform: scale(1); opacity: 1; }
	50% { transform: scale(1.15); opacity: 0.85; }
}

/* --- WordForm Datetime Field UI Enhancements --- */
.datetime-format-hint {
	display: block;
	color: #777;
	font-size: 12px;
	margin-top: 3px;
	margin-left: 2px;
	font-style: italic;
	transition: color 0.3s ease;
}

.datetime-format-hint:hover {
	color: #50575e; /* WP gray tone */
	cursor: default;
}

.datetime-error-msg {
	display: none;
	color: #dc3232; /* WP error red */
	font-weight: 500;
	margin-left: 2px;
	margin-top: 2px;
	font-size: 12.5px;
	animation: fadeInError 0.3s ease;
}

@keyframes fadeInError {
	from { opacity: 0; transform: translateY(-2px); }
	to { opacity: 1; transform: translateY(0); }
}

/* ────────────────────────────────
   WordForm DateTime Field Styling
   ──────────────────────────────── */
.sc-wordform-built-datetime-wrapper {
	position: relative;
	display: inline-block;
	width: 100%;
}

/* Input styling */
.sc-wordform-built-datetime-element {
	width: 100%;
	padding-right: 55px; /* leave room for both icons */
	box-sizing: border-box;
	line-height: 1.4;
    cursor: pointer;
}

/* Shared base style for both icons */
.sc-wordform-built-datetime-element-input-calendar-icon,
.sc-wordform-built-datetime-element-input-clock-icon {
	position: absolute;
	top: 60px;
	transform: translateY(-50%);
	color: #777;
	cursor: pointer;
    pointer-events: none;
	transition: color 0.25s ease, transform 0.2s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Calendar icon slightly left of clock */
.sc-wordform-built-datetime-element-input-calendar-icon {
	right: 38px;
}

/* Clock icon stays at far right */
.sc-wordform-built-datetime-element-input-clock-icon {
	right: 10px;
}

/* Hover effect */
.sc-wordform-built-datetime-wrapper:hover .sc-wordform-built-datetime-element-input-calendar-icon,
.sc-wordform-built-datetime-wrapper:hover .sc-wordform-built-datetime-element-input-clock-icon {	
    color: var(--wf-field-border-focus);
	transform: translateY(-50%) scale(1.1);
}


/* Adjust spacing for small devices */
@media (max-width: 480px) {
	.sc-wordform-built-datetime-element {
		padding-right: 45px;
		font-size: 14px;
	}
	.sc-wordform-built-datetime-element-input-calendar-icon {
		right: 32px;
	}
	.sc-wordform-built-datetime-element-input-clock-icon {
		right: 8px;
	}
}

/* Prevent datetimepicker from getting hidden under top browser bar */
/* Smart visibility & layering for WordForm datetimepicker */
#ui-datepicker-div {
    position: absolute !important;
    z-index: 999999 !important;   /* above dialogs, tooltips, headers */
    margin: 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    background: #fff;
    transform: none !important;
    transition: top 0.15s ease, left 0.15s ease;
}

/* Slight gap from input field */
#ui-datepicker-div.show-below {
    margin-top: 6px !important;
}

#ui-datepicker-div.show-above {
    margin-bottom: 6px !important;
}


/* RTL compatibility */
body.rtl .sc-wordform-built-datetime-element-input-calendar-icon {
	left: 38px;
	right: auto;
}
body.rtl .sc-wordform-built-datetime-element-input-clock-icon {
	left: 10px;
	right: auto;
}

/* RTL support */
body.rtl .datetime-format-hint,
body.rtl .datetime-error-msg {
	margin-left: 0;
	margin-right: 4px;
	text-align: right;
}
