/* ==========================================================================
   1. Isolated Form Card Container (No Global Body Elements)
   ========================================================================== */
.form-wrapper {
    background-color: #ffffff;
    padding: 12px 24px 24px 24px; /* Reduced top padding to move header up */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    width: 100%;
    max-width: 900px;
    box-sizing: border-box;
    margin: 5px auto; /* Small margin footprint perfect for blog middle-includes */
    font-family: 'Poppins', sans-serif;
}

/* ==========================================================================
   2. Header & Structure Spacing
   ========================================================================== */
.form-header {
    text-align: center;
    margin-bottom: 20px;
}

.form-header h2 {
    font-size: 1.35rem; 
    font-weight: 700;
    color: #0b1a30;
    margin: 0 0 6px 0; /* Clears default browser margins pushing layout down */
}

.form-header p {
    font-size: 0.85rem; 
    color: #64748b;
    margin: 0;
}

/* Form Layout Grid */
.lead-form {
    display: flex;
    flex-direction: column;
    gap: 14px; 
    width: 100%;
    box-sizing: border-box;
}

/* Flexbox Row System */
.form-row {
    display: flex;
    gap: 14px; 
    flex-wrap: wrap;
}

/* Reusable Form Field Group */
.form-group {
    flex: 1;
    min-width: 240px;
    box-sizing: border-box;
}

.form-group.full-width {
    width: 100%;
}

/* Explicitly hides hidden fallback labels to preserve compact sizing */
.lead-form label {
    display: none; 
}

/* ==========================================================================
   3. Form Inputs & Typography Contrast
   ========================================================================== */
.lead-form input[type="text"],
.lead-form input[type="email"],
.lead-form input[type="tel"],
.lead-form select,
.lead-form textarea {
    width: 100%;
    padding: 12px 14px; 
    border: 1px solid #94a3b8; /* Darker, crisper border gray for readability */
    border-radius: 6px;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: #0b1a30; /* Crisp dark navy active input text */
    background-color: #ffffff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Custom placeholder visibility overrides */
.lead-form input::placeholder,
.lead-form textarea::placeholder {
    color: #475569 !important; /* Clearly readable charcoal gray placeholders */
    opacity: 1 !important; 
}

/* Active Editing State */
.lead-form input:focus,
.lead-form select:focus,
.lead-form textarea:focus {
    border-color: #0b1a30;
    box-shadow: 0 0 0 1px #0b1a30; /* Enhances structural definition on active typing */
}

/* Custom Dropdown Arrow Mechanics */
.lead-form select {
    background-color: #ffffff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://w3.org' viewBox='0 0 24 24' fill='none' stroke='%230b1a30' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px;
    padding-right: 35px;
    color: #475569; /* Matches input text placeholder appearance precisely */
}

/* Textarea handling */
.lead-form textarea {
    resize: vertical;
    min-height: 80px; 
}

/* Anti-spam Honeypot Field Hidden */
.lead-form .honeypot {
    display: none !important;
}

/* ==========================================================================
   4. Action Buttons
   ========================================================================== */
.lead-form .submit-btn {
    width: 100%;
    background: #0b1a30;
    color: #ffffff;
    padding: 14px 20px; 
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    transition: background 0.2s ease-in-out;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.lead-form .submit-btn:hover {
    background: #122543;
}

.lead-form .submit-btn:disabled {
    background: #64748b;
    cursor: not-allowed;
}

/* ==========================================================================
   5. Dynamic Response Success/Error Cards
   ========================================================================== */
.response-box {
    padding: 35px 20px;
    border-radius: 8px; /* Smooth card matching edge curves */
    text-align: center;
    font-family: 'Poppins', sans-serif;
    animation: fadeIn 0.4s ease-in-out;
}

.response-box h3 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.response-box p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Success Card - Filled Slate-Gray Variant */
.response-box.success {
    background-color: #f1f5f9; /* Slate-gray card structure background */
    border: 1px solid #cbd5e1; /* Clear structural card barrier */
    color: #334155; 
}

.response-box.success h3 {
    color: #0b1a30; /* Title color matching primary corporate branding colors */
}

/* Error Card Container */
.response-box.error {
    background-color: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
    border-radius: 6px;
    margin-bottom: 15px;
    padding: 15px;
}

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

/* ==========================================================================
   6. Comprehensive Media Queries (Mobile & Tablet Responsiveness)
   ========================================================================== */

/* Tablet & Smaller Screen Breakpoint */
@media (max-width: 768px) {
    .form-wrapper {
        padding: 12px 20px 20px 20px; /* Slight scaling padding deduction */
    }
    
    .form-header h2 {
        font-size: 1.25rem; /* Scales text down comfortably for smaller views */
    }
}

/* Smartphone / Compact Mobile Breakpoint */
@media (max-width: 480px) {
    .form-wrapper {
        padding: 10px 14px 16px 14px; /* Tighter padding optimization for mobile displays */
        border-radius: 6px;
    }
    
    .form-header {
        margin-bottom: 16px;
    }

    .form-header h2 {
        font-size: 1.15rem;
    }

    .form-header p {
        font-size: 0.8rem;
    }

    /* Collapse side-by-side elements down to neat single columns */
    .form-row {
        flex-direction: column;
        gap: 12px;
    }

    .lead-form {
        gap: 12px;
    }

    .form-group {
        min-width: 100%; /* Spans full horizontal bounds on mobile viewports */
    }

    .lead-form input[type="text"],
    .lead-form input[type="email"],
    .lead-form input[type="tel"],
    .lead-form select,
    .lead-form textarea {
        padding: 10px 12px; /* Tighter internal layout input grids */
        font-size: 0.85rem;
    }

    .lead-form .submit-btn {
        padding: 12px 16px;
        font-size: 0.8rem;
    }

    .response-box {
        padding: 25px 15px;
    }

    .response-box h3 {
        font-size: 1.25rem;
    }

    .response-box p {
        font-size: 0.85rem;
    }
}
