/**
 * Custom application Lead Capture Form Styling
 * Completely namespace insulated to prevent WordPress theme class overrides
 */

.wplm-form-container {
    width: 100%;
    max-width: 860px;
    margin: 28px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", sans-serif;
    color: #0f172a;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 28px;
    box-shadow: 0 30px 72px rgba(15, 23, 42, 0.14);
    overflow: visible;
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    position: relative;
}

.wplm-form-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 30%), radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.12), transparent 24%);
    pointer-events: none;
}

.wplm-lead-form {
    position: relative;
    z-index: 1;
    padding: 40px 42px;
}

@media (max-width: 1024px) {
    .wplm-lead-form {
        padding: 34px 30px;
    }
}

@media (max-width: 860px) {
    .wplm-form-row-2,
    .wplm-form-row-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 740px) {
    .wplm-lead-form {
        padding: 26px 20px;
    }

    .wplm-form-container {
        margin: 18px auto;
    }

    .wplm-section-main-title {
        font-size: 22px;
    }

    .wplm-section-desc,
    .wplm-intro-card-text {
        font-size: 14px;
    }

    .wplm-legend {
        font-size: 12px;
        padding: 7px 12px;
    }

    .wplm-label {
        padding-left: 38px;
    }

    .wplm-label::before {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .wplm-input,
    .wplm-select {
        min-height: 56px;
        padding: 15px 14px;
    }

    .wplm-select {
        background-position: right 14px center;
        padding-right: 44px;
    }

    input.wplm-input[type="date"] {
        padding-right: 14px;
    }
}

@media (max-width: 560px) {
    .wplm-lead-form {
        padding: 20px 16px;
    }

    .wplm-section-main-title {
        gap: 10px;
        font-size: 20px;
    }

    .wplm-legend {
        gap: 8px;
        padding: 8px 10px;
    }

    .wplm-input,
    .wplm-select {
        min-height: 60px;
        padding: 16px 14px;
    }

    .wplm-btn-icon {
        margin-left: 10px;
    }
}

.wplm-section-main-title {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 10px 0;
    letter-spacing: -0.6px;
    line-height: 1.08;
}

.wplm-section-main-title::before {
    content: attr(data-icon);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: rgba(59, 130, 246, 0.14);
    color: #2563eb;
    font-size: 20px;
}

.wplm-section-desc {
    font-size: 15px;
    color: #475569;
    margin: 0 0 26px 0;
    line-height: 1.8;
    max-width: 760px;
}

.wplm-intro-card {
    border: 1px solid rgba(37, 99, 235, 0.18);
    background: rgba(236, 248, 255, 0.86);
    border-radius: 16px;
    padding: 22px 24px;
    margin-bottom: 30px;
}

.wplm-intro-card-text {
    margin: 0;
    color: #0f172a;
    font-size: 15px;
    line-height: 1.8;
}

.wplm-fieldset {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 22px;
    padding: 28px 26px 30px;
    margin: 0 0 30px 0;
    background: rgba(255, 255, 255, 0.72);
}

.wplm-legend {
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #2563eb;
    margin-bottom: 20px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
}

.wplm-legend::before {
    content: attr(data-icon);
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.14);
    color: #1d4ed8;
    font-size: 14px;
}

.wplm-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.wplm-form-row-2,
.wplm-form-row-3 {
    display: grid;
    gap: 18px;
}

.wplm-form-row-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wplm-form-row-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 860px) {
    .wplm-form-row-2,
    .wplm-form-row-3 {
        grid-template-columns: 1fr;
    }
}

.wplm-field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.wplm-label {
    position: relative;
    padding-left: 44px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 10px;
}

.wplm-label::before {
    content: attr(data-icon);
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
    font-size: 16px;
}

input.wplm-input,
textarea.wplm-input,
select.wplm-select,
input.wplm-input[type="text"],
input.wplm-input[type="email"],
input.wplm-input[type="tel"],
input.wplm-input[type="search"],
input.wplm-input[type="url"],
input.wplm-input[type="number"],
input.wplm-input[type="password"],
input.wplm-input[type="date"] {
    width: 100%;
    min-height: 52px;
    padding: 14px 16px;
    font-size: 15px;
    line-height: 1.4;
    color: #0f172a;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 18px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
    box-shadow: inset 0 2px 12px rgba(255, 255, 255, 0.9), 0 2px 14px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background-clip: padding-box;
    box-sizing: border-box;
}

input.wplm-input,
textarea.wplm-input,
select.wplm-select {
    appearance: none;
    -webkit-appearance: none;
}

input.wplm-input:hover,
textarea.wplm-input:hover,
select.wplm-select:hover {
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: inset 0 2px 14px rgba(255, 255, 255, 0.95), 0 0 0 1px rgba(37, 99, 235, 0.12);
}

input.wplm-input[type="date"] {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.72);
    border-radius: 18px;
    box-shadow: inset 0 2px 12px rgba(255, 255, 255, 0.9), 0 2px 14px rgba(15, 23, 42, 0.06);
}

input.wplm-input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: brightness(0.92);
    opacity: 0.95;
}

input.wplm-input[type="date"]::-webkit-clear-button,
input.wplm-input[type="date"]::-webkit-inner-spin-button {
    display: none;
}

.wplm-input::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.wplm-input:focus,
.wplm-select:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
    transform: translateY(-1px);
}

.wplm-select {
    width: 100%;
    min-height: 52px;
    padding: 14px 16px;
    padding-right: 46px;
    font-size: 15px;
    line-height: 1.4;
    color: #0f172a;
    background-color: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 18px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
    box-shadow: inset 0 2px 12px rgba(255, 255, 255, 0.9), 0 2px 14px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' 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 16px center;
    background-size: 18px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.wplm-select option {
    color: #0f172a;
    background: #ffffff;
}

.wplm-select::-ms-expand {
    display: none;
}

.wplm-select::-moz-focus-inner {
    border: 0;
}

.wplm-custom-select-wrapper {
    position: relative;
    width: 100%;
}

.wplm-custom-select-display {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 52px;
    padding: 14px 16px;
    padding-right: 46px;
    font-size: 15px;
    line-height: 1.4;
    color: #0f172a;
    background-color: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 18px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
    box-shadow: inset 0 2px 12px rgba(255, 255, 255, 0.9), 0 2px 14px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background-clip: padding-box;
    text-align: left;
    border-radius: 18px;
}

.wplm-custom-select-display::after {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-left: 12px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' 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: center;
}

/* Phone Input Group Styling */
.wplm-phone-input-group {
    display: flex;
    gap: 0;
    align-items: center;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: inset 0 2px 12px rgba(255, 255, 255, 0.9), 0 2px 14px rgba(15, 23, 42, 0.06);
    background: rgba(255, 255, 255, 0.72);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    min-height: 52px;
    padding: 0;
    width: 100%;
}

.wplm-phone-input-group:hover {
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: inset 0 2px 14px rgba(255, 255, 255, 0.95), 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.wplm-phone-input-group:focus-within {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.wplm-phone-input-group .wplm-country-code {
    flex: 0 0 auto;
    width: 88px;
    height: 52px;
    padding: 0 14px 0 10px;
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;
    background-color: transparent !important;
    border: none !important;
    border-right: 1px solid rgba(148, 163, 184, 0.35) !important;
    border-radius: 0;
    outline: none !important;
    transition: background 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
    text-align: center;
    box-shadow: none !important;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: none;
    background-position: right 10px center;
    background-repeat: no-repeat;
    line-height: 52px;
    position: relative;
}

.wplm-phone-input-group .wplm-country-code:hover {
    background-color: rgba(37, 99, 235, 0.03) !important;
}

.wplm-phone-input-group .wplm-country-code:focus {
    background-color: rgba(37, 99, 235, 0.05) !important;
}

.wplm-phone-input-group .wplm-country-code::after {
    content: '▾';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #64748b;
}

.wplm-phone-input-group .wplm-country-code option {
    color: #0f172a;
    background: #ffffff;
    padding: 8px;
}

.wplm-phone-input-group .wplm-phone-input {
    flex: 1 1 auto;
    width: 100%;
    height: 52px;
    border: none !important;
    border-radius: 0;
    margin: 0;
    padding: 0 16px;
    background-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    color: #0f172a;
    font-size: 15px;
    line-height: 52px;
}

.wplm-phone-input-group .wplm-phone-input:focus {
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

.wplm-phone-input-group .wplm-country-code:focus + .wplm-phone-input,
.wplm-phone-input-group .wplm-phone-input:focus {
    background-color: rgba(255, 255, 255, 0.92) !important;
}

.wplm-phone-input-group .wplm-phone-input::placeholder {
    color: #94a3b8;
}

@media (max-width: 560px) {
    .wplm-phone-input-group {
        min-height: 52px;
        flex-wrap: nowrap;
    }
    
    .wplm-phone-input-group .wplm-country-code {
        height: 52px;
        line-height: 52px;
        width: 85px;
        padding: 0 12px 0 8px;
        font-size: 13px;
        flex-shrink: 0;
    }
    
    .wplm-phone-input-group .wplm-phone-input {
        height: 52px;
        line-height: 52px;
        padding: 0 14px;
        font-size: 14px;
    }
}

.wplm-custom-select-display:hover {
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: inset 0 2px 14px rgba(255, 255, 255, 0.95), 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.wplm-custom-select-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.42);
    z-index: 9999;
    padding: 20px;
}

.wplm-custom-select-overlay.open {
    display: flex;
}

.wplm-custom-select-panel {
    width: min(480px, 100%);
    max-height: 90vh;
    overflow: hidden;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 24px 54px rgba(15, 23, 42, 0.18);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wplm-custom-select-close {
    align-self: flex-end;
    border: none;
    background: transparent;
    color: #475569;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.wplm-custom-select-header {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.wplm-custom-select-options {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 60vh;
}

.wplm-custom-select-option {
    padding: 14px 16px;
    border-radius: 14px;
    cursor: pointer;
    background: rgba(248, 250, 252, 0.95);
    color: #0f172a;
    border: 1px solid transparent;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.wplm-custom-select-option:hover,
.wplm-custom-select-option.active {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.28);
    transform: translateX(1px);
}

.wplm-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 56px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: 0 18px 32px rgba(37, 99, 235, 0.2);
}

[type=button]:focus, [type=button]:hover, [type=submit]:focus, [type=submit]:hover, button:focus, button:hover {
    transform: translateY(-1px);
    background-color: #33b7cc !important;
    color: #fff;
    text-decoration: none;
}

.wplm-cta-button:active {
    background-color: #2ca2b5;
}

.wplm-cta-button:disabled {
    background-color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

.wplm-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.24);
}

/* Inline Field Errors */
.wplm-field-error-msg {
    font-size: 12px;
    color: #ef4444;
    min-height: 16px;
    display: block;
    margin-top: 1px;
}

.wplm-input.wplm-error-border,
.wplm-select.wplm-error-border {
    border-color: #fca5a5;
    background-color: #fffafb;
}

/* Feedback Notifications banner */
.wplm-feedback-box {
    padding: 14px 16px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.45;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.wplm-feedback-box.wplm-success {
    color: #15803d;
    background-color: #f0fdf4;
    border-color: #bbf7d0;
}

.wplm-feedback-box.wplm-error {
    color: #b91c1c;
    background-color: #fef2f2;
    border-color: #fecaca;
}

.hidden {
    display: none !important;
}

/* Button Spinner Animation */
.wplm-btn-loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-left: 8px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spinner-spin 0.8s linear infinite;
}

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