/* ==========================================================================
   Lester Contact Form Styles (Frontend) - Premium V4.1
   Overriding Theme Constraints with Extreme Specificity
   ========================================================================== */

/* Wrapper & Reset */
.lester-contact-form-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    font-family: inherit;
    color: var(--lf-text, #1a1a1a);
    box-sizing: border-box;
    position: relative;
    z-index: 99;
}

.lester-contact-form-wrapper * {
    box-sizing: border-box !important;
}

.lester-contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Base Grid Layout */
.lester-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
    grid-auto-flow: row dense;
}

.field-left {
    grid-column: span 1;
}

.field-right {
    grid-column: span 1;
}

.field-full {
    grid-column: span 2;
}

@media (max-width: 768px) {
    .lester-form-grid {
        grid-template-columns: 1fr;
    }

    .field-left,
    .field-right,
    .field-full {
        grid-column: 1 / -1;
    }
}

/* Input Group (The Fake Input Container) */
.lester-contact-form-wrapper .lester-input-group {
    background-color: var(--lf-bg, #ffffff) !important;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 14px 16px !important;
    min-height: 0 !important;
    position: relative;
    border: 1px solid #e2e8f0 !important;
    border-radius: 0 !important;
    /* No radius requested */
    transition: all 0.3s ease !important;
    width: 100% !important;
    cursor: text;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02) !important;
    z-index: 1;
    gap: 8px;
}

.lester-contact-form-wrapper .lester-input-group:focus-within {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/* Textarea Group Specifics */
.lester-contact-form-wrapper .lester-textarea-group {
    align-items: stretch !important;
}

/* Label (Prefix Text) */
.lester-contact-form-wrapper .lester-input-group>label {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: var(--lf-text, #111827) !important;
    margin: 0 !important;
    display: block !important;
    line-height: 1.2 !important;
    padding: 0 !important;
}

.lester-contact-form-wrapper .lester-textarea-group>label {
    line-height: 1.5 !important;
}

/* The actual inputs */
.lester-contact-form-wrapper .lester-input-group input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
.lester-contact-form-wrapper .lester-input-group textarea,
.lester-contact-form-wrapper .lester-input-group select {
    flex: 0 0 auto !important;
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 1.25rem !important;
    font-family: inherit !important;
    color: var(--lf-text, #111827) !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    min-width: 50px !important;
    line-height: 1.5 !important;
    height: auto !important;
    position: relative !important;
    z-index: 10 !important;
    pointer-events: auto !important;
}

/* Remove default webkit styles */
.lester-contact-form-wrapper .lester-input-group input[type="text"],
.lester-contact-form-wrapper .lester-input-group input[type="email"],
.lester-contact-form-wrapper .lester-input-group input[type="tel"],
.lester-contact-form-wrapper .lester-input-group input[type="number"] {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* Textarea adjustment */
.lester-contact-form-wrapper .lester-textarea-group textarea {
    resize: vertical !important;
    min-height: 120px !important;
}

/* Ensure consistent height for single-line inputs across columns */
.lester-contact-form-wrapper .lester-input-group input[type="text"],
.lester-contact-form-wrapper .lester-input-group input[type="email"],
.lester-contact-form-wrapper .lester-input-group input[type="tel"],
.lester-contact-form-wrapper .lester-input-group input[type="number"],
.lester-contact-form-wrapper .lester-input-group select {
    min-height: 32px !important;
}

/* Placeholders - Ultra Specific */
.lester-contact-form-wrapper .lester-input-group input::-webkit-input-placeholder {
    color: var(--lf-pl, #9ca3af) !important;
    opacity: 1 !important;
    font-weight: 400 !important;
}

.lester-contact-form-wrapper .lester-input-group input::-moz-placeholder {
    color: var(--lf-pl, #9ca3af) !important;
    opacity: 1 !important;
    font-weight: 400 !important;
}

.lester-contact-form-wrapper .lester-input-group input:-ms-input-placeholder {
    color: var(--lf-pl, #9ca3af) !important;
    opacity: 1 !important;
    font-weight: 400 !important;
}

.lester-contact-form-wrapper .lester-input-group input::-ms-input-placeholder {
    color: var(--lf-pl, #9ca3af) !important;
    opacity: 1 !important;
    font-weight: 400 !important;
}

.lester-contact-form-wrapper .lester-input-group input::placeholder {
    color: var(--lf-pl, #9ca3af) !important;
    opacity: 1 !important;
    font-weight: 400 !important;
}

.lester-contact-form-wrapper .lester-input-group textarea::-webkit-input-placeholder {
    color: var(--lf-pl, #9ca3af) !important;
    opacity: 1 !important;
    font-weight: 400 !important;
}

.lester-contact-form-wrapper .lester-input-group textarea::-moz-placeholder {
    color: var(--lf-pl, #9ca3af) !important;
    opacity: 1 !important;
    font-weight: 400 !important;
}

.lester-contact-form-wrapper .lester-input-group textarea:-ms-input-placeholder {
    color: var(--lf-pl, #9ca3af) !important;
    opacity: 1 !important;
    font-weight: 400 !important;
}

.lester-contact-form-wrapper .lester-input-group textarea::-ms-input-placeholder {
    color: var(--lf-pl, #9ca3af) !important;
    opacity: 1 !important;
    font-weight: 400 !important;
}

.lester-contact-form-wrapper .lester-input-group textarea::placeholder {
    color: var(--lf-pl, #9ca3af) !important;
    opacity: 1 !important;
    font-weight: 400 !important;
}

/* Captcha Fallback & ReCAPTCHA Box */
.lester-contact-form-wrapper .lester-recaptcha-wrap {
    background-color: transparent !important;
    display: flex;
    align-items: center;
}

.lester-contact-form-wrapper .lester-recaptcha-wrap.placeholder-empty {
    display: none;
}

/* Submit Wrapper & Button */
.lester-contact-form-wrapper .lester-submit-wrap {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
}

/* Text Button (Fallbacks to Theme Style) */
/* The user asked to let the Ollie theme and is-style-button-light take over */
.lester-contact-form-wrapper .lester-submit-btn {
    transition: all 0.3s ease;
}

.lester-contact-form-wrapper .lester-submit-btn.loading {
    animation: lesterPulse 1s infinite alternate;
    pointer-events: none;
}

@keyframes lesterPulse {
    0% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

/* Feedback Messages */
.lester-form-feedback {
    padding: 16px 20px !important;
    margin-top: 20px !important;
    font-size: 1.1rem !important;
    font-weight: 500 !important;
    border-radius: 0 !important;
    display: none;
}

.lester-form-feedback.success {
    background-color: #ecfdf5 !important;
    color: #065f46 !important;
    border: 1px solid #a7f3d0 !important;
}

.lester-form-feedback.error {
    background-color: #fef2f2 !important;
    color: #991b1b !important;
    border: 1px solid #fecaca !important;
}