/**
 * Frontend Lead Capture Form Styling
 * Modern, responsive, clean Wix/Squarespace design.
 */

.wbd-lead-form-wrap {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
}

.wbd-lead-form-wrap *,
.wbd-lead-form-wrap *::before,
.wbd-lead-form-wrap *::after {
    box-sizing: border-box;
}

.wbd-lead-form {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.wbd-lead-form:hover {
    box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.08), 0 8px 12px -4px rgba(0, 0, 0, 0.03);
}

.wbd-form-header {
    margin-bottom: 24px;
    text-align: center;
}

.wbd-form-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
    letter-spacing: -0.02em;
}

.wbd-form-subtitle {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* Alerts */
.wbd-form-alert {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 0.925rem;
    font-weight: 500;
    margin-bottom: 20px;
    display: none;
    animation: wbdFadeIn 0.3s ease;
    line-height: 1.5;
}

.wbd-form-alert.is-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.wbd-form-alert.is-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

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

/* Grid System */
.wbd-form-grid {
    display: flex;
    flex-wrap: wrap;
    margin: -10px;
}

.wbd-form-group {
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.wbd-col-12 {
    width: 100%;
}

.wbd-col-6 {
    width: 50%;
}

@media (max-width: 640px) {
    .wbd-col-6 {
        width: 100%;
    }
    .wbd-lead-form {
        padding: 24px 18px;
    }
}

/* Form Labels */
.wbd-form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 7px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.wbd-req {
    color: #ef4444;
    font-weight: 700;
}

.wbd-opt {
    color: #94a3b8;
    font-weight: 400;
    font-size: 0.8rem;
}

/* Inputs & Wrappers */
.wbd-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.wbd-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    pointer-events: none;
    z-index: 2;
    transition: color 0.2s ease;
}

.wbd-input-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.wbd-lead-form input[type="text"].wbd-input,
.wbd-lead-form input[type="tel"].wbd-input,
.wbd-lead-form input[type="email"].wbd-input,
.wbd-lead-form select.wbd-select,
.wbd-input,
.wbd-select {
    width: 100% !important;
    font-family: inherit !important;
    font-size: 0.95rem !important;
    color: #0f172a !important;
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    padding-top: 13px !important;
    padding-bottom: 13px !important;
    padding-left: 48px !important;
    padding-right: 16px !important;
    outline: none !important;
    box-sizing: border-box !important;
    height: auto !important;
    min-height: 48px !important;
    line-height: 1.5 !important;
    transition: all 0.2s ease !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.wbd-lead-form select.wbd-select,
.wbd-select {
    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='%2364748b' 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") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 16px !important;
    padding-left: 48px !important;
    padding-right: 42px !important;
    cursor: pointer !important;
}

.wbd-lead-form textarea.wbd-textarea,
.wbd-textarea {
    width: 100% !important;
    font-family: inherit !important;
    font-size: 0.95rem !important;
    color: #0f172a !important;
    background-color: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 10px !important;
    padding: 12px 16px !important;
    min-height: 100px !important;
    resize: vertical !important;
    outline: none !important;
    box-sizing: border-box !important;
    line-height: 1.5 !important;
    transition: all 0.2s ease !important;
}

.wbd-input::placeholder,
.wbd-textarea::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.wbd-input:focus,
.wbd-select:focus,
.wbd-textarea:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.wbd-input:focus ~ .wbd-input-icon,
.wbd-input-wrap:focus-within .wbd-input-icon {
    color: #2563eb;
}

/* Category Accent Theme Overrides */
.wbd-cat-restaurant .wbd-input:focus,
.wbd-cat-restaurant .wbd-select:focus,
.wbd-cat-restaurant .wbd-textarea:focus {
    border-color: #ea580c;
    box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.14);
}
.wbd-cat-restaurant .wbd-input-wrap:focus-within .wbd-input-icon {
    color: #ea580c;
}
.wbd-cat-restaurant .wbd-submit-btn {
    background: linear-gradient(135deg, #ea580c, #c2410c);
    box-shadow: 0 6px 20px rgba(234, 88, 12, 0.35);
}
.wbd-cat-restaurant .wbd-submit-btn:hover {
    background: linear-gradient(135deg, #f97316, #ea580c);
    box-shadow: 0 8px 24px rgba(234, 88, 12, 0.45);
}

.wbd-cat-gym .wbd-input:focus,
.wbd-cat-gym .wbd-select:focus,
.wbd-cat-gym .wbd-textarea:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.14);
}
.wbd-cat-gym .wbd-input-wrap:focus-within .wbd-input-icon {
    color: #16a34a;
}
.wbd-cat-gym .wbd-submit-btn {
    background: linear-gradient(135deg, #16a34a, #15803d);
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.35);
}
.wbd-cat-gym .wbd-submit-btn:hover {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 8px 24px rgba(22, 163, 74, 0.45);
}

.wbd-cat-medical-store .wbd-input:focus,
.wbd-cat-medical-store .wbd-select:focus,
.wbd-cat-medical-store .wbd-textarea:focus {
    border-color: #0891b2;
    box-shadow: 0 0 0 4px rgba(8, 145, 178, 0.14);
}
.wbd-cat-medical-store .wbd-input-wrap:focus-within .wbd-input-icon {
    color: #0891b2;
}
.wbd-cat-medical-store .wbd-submit-btn {
    background: linear-gradient(135deg, #0891b2, #0e7490);
    box-shadow: 0 6px 20px rgba(8, 145, 178, 0.35);
}
.wbd-cat-medical-store .wbd-submit-btn:hover {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    box-shadow: 0 8px 24px rgba(8, 145, 178, 0.45);
}

/* Submit Button */
.wbd-submit-group {
    margin-top: 8px;
}

.wbd-submit-btn {
    width: 100%;
    padding: 14px 28px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.wbd-submit-btn:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.45);
}

.wbd-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.wbd-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.wbd-btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: wbdSpin 0.7s linear infinite;
}

@keyframes wbdSpin {
    to { transform: rotate(360deg); }
}

/* Auto Injected Lead Section (Rendered before footer on tenant sites) */
.wbd-auto-lead-section {
    padding: 70px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    width: 100%;
    clear: both;
}

.wbd-auto-lead-container {
    max-width: 680px;
    margin: 0 auto;
}
