/* ============================================
   WP Swift Form - Frontend Styles
   ============================================ */

.wpsf-form-wrapper {
    max-width: 100%;
    margin: 0 auto;
}

.wpsf-form {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* --- Fields Layout --- */
.wpsf-fields-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0 20px;
}

.wpsf-field-wrap {
    margin-bottom: 20px;
    box-sizing: border-box;
}

.wpsf-field-wrap.wpsf-width-100 { width: 100%; }
.wpsf-field-wrap.wpsf-width-75 { width: calc(75% - 15px); }
.wpsf-field-wrap.wpsf-width-66 { width: calc(66.666% - 13px); }
.wpsf-field-wrap.wpsf-width-50 { width: calc(50% - 10px); }
.wpsf-field-wrap.wpsf-width-33 { width: calc(33.333% - 13px); }
.wpsf-field-wrap.wpsf-width-25 { width: calc(25% - 15px); }

/* --- Labels --- */
.wpsf-field-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    line-height: 1.4;
}

.wpsf-required-star {
    color: #dc3545;
    margin-left: 2px;
}

/* Label positions */
.wpsf-labels-left .wpsf-field-wrap {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.wpsf-labels-left .wpsf-field-label {
    min-width: 140px;
    padding-top: 8px;
    text-align: right;
}

.wpsf-labels-left .wpsf-field-input {
    flex: 1;
}

.wpsf-labels-hidden .wpsf-field-label {
    display: none;
}

/* --- Inputs --- */
.wpsf-field-input input[type="text"],
.wpsf-field-input input[type="email"],
.wpsf-field-input input[type="tel"],
.wpsf-field-input input[type="url"],
.wpsf-field-input input[type="number"],
.wpsf-field-input input[type="password"],
.wpsf-field-input input[type="date"],
.wpsf-field-input input[type="time"],
.wpsf-field-input select,
.wpsf-field-input textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}

.wpsf-field-input input:focus,
.wpsf-field-input select:focus,
.wpsf-field-input textarea:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15);
    outline: none;
}

.wpsf-field-input input::placeholder,
.wpsf-field-input textarea::placeholder {
    color: #999;
}

.wpsf-field-input textarea {
    resize: vertical;
    min-height: 80px;
}

.wpsf-field-input select {
    appearance: auto;
    cursor: pointer;
}

/* --- File Input --- */
.wpsf-file-input {
    position: relative;
}

.wpsf-field-input input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed #d0d5dd;
    border-radius: 6px;
    background: #fafafa;
    cursor: pointer;
    font-size: 14px;
}

.wpsf-field-input input[type="file"]:hover {
    border-color: #0073aa;
    background: #f0f6fc;
}

/* --- Radio & Checkbox --- */
.wpsf-options-list {
    list-style: none;
    padding: 0;
    margin: 5px 0 0 0;
}

.wpsf-options-list li {
    margin-bottom: 8px;
}

.wpsf-options-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
}

.wpsf-options-list input[type="radio"],
.wpsf-options-list input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    accent-color: #0073aa;
}

.wpsf-options-inline .wpsf-options-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 20px;
}

/* --- Name Field --- */
.wpsf-name-fields {
    display: flex;
    gap: 15px;
}

.wpsf-name-fields .wpsf-name-part {
    flex: 1;
}

.wpsf-name-part label,
.wpsf-address-part label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
}

.wpsf-name-part input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 15px;
    box-sizing: border-box;
}

/* --- Address Field --- */
.wpsf-address-fields {
    display: grid;
    gap: 12px;
}

.wpsf-address-row {
    display: flex;
    gap: 12px;
}

.wpsf-address-part {
    flex: 1;
}

.wpsf-address-part input,
.wpsf-address-part select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 15px;
    box-sizing: border-box;
}

.wpsf-address-full {
    width: 100%;
}

/* --- Section Heading --- */
.wpsf-section-heading {
    margin: 10px 0 5px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eee;
    color: #333;
}

/* --- Divider --- */
.wpsf-divider {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 15px 0;
}

/* --- HTML Content --- */
.wpsf-html-content {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

/* --- Honeypot --- */
.wpsf-hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
}

/* --- reCAPTCHA --- */
.wpsf-recaptcha-wrap {
    margin-bottom: 20px;
}

/* --- GDPR Consent --- */
.wpsf-gdpr-wrap {
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
}

.wpsf-gdpr-wrap label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    line-height: 1.5;
}

.wpsf-gdpr-wrap input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* --- Submit Button --- */
.wpsf-submit-wrap {
    margin-top: 10px;
}

.wpsf-submit-btn {
    display: inline-block;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background-color: #0073aa;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    font-family: inherit;
}

.wpsf-submit-btn:hover {
    background-color: #005a87;
}

.wpsf-submit-btn:active {
    transform: scale(0.98);
}

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

/* --- Messages --- */
.wpsf-message {
    padding: 14px 18px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.wpsf-message-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.wpsf-message-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* --- Field Errors --- */
.wpsf-field-error input,
.wpsf-field-error select,
.wpsf-field-error textarea {
    border-color: #dc3545;
}

.wpsf-field-error-msg {
    display: block;
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
}

/* --- Login / Unavailable --- */
.wpsf-login-required,
.wpsf-not-available {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    color: #666;
    font-size: 15px;
}

/* --- Loading Spinner --- */
.wpsf-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: wpsf-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

/* --- Two Column Layout --- */
.wpsf-layout-two .wpsf-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
}

.wpsf-layout-two .wpsf-field-wrap.wpsf-width-100 {
    grid-column: 1 / -1;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .wpsf-field-wrap.wpsf-width-75,
    .wpsf-field-wrap.wpsf-width-66,
    .wpsf-field-wrap.wpsf-width-50,
    .wpsf-field-wrap.wpsf-width-33,
    .wpsf-field-wrap.wpsf-width-25 {
        width: 100%;
    }

    .wpsf-name-fields {
        flex-direction: column;
    }

    .wpsf-address-row {
        flex-direction: column;
    }

    .wpsf-labels-left .wpsf-field-wrap {
        flex-direction: column;
    }

    .wpsf-labels-left .wpsf-field-label {
        text-align: left;
        min-width: 0;
        padding-top: 0;
    }

    .wpsf-layout-two .wpsf-fields-row {
        grid-template-columns: 1fr;
    }

    .wpsf-submit-btn {
        width: 100%;
    }
}
