/**
 * Lowe Callback Popup v2.0
 * Matches quote/contact form styling: Navy #0f172a, Red #c9302c, Outfit
 * All selectors scoped to #lw-callback-overlay for high specificity
 */

/* ── Overlay ── */
#lw-callback-overlay.lw-cb-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-family: 'Outfit', 'DM Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
    line-height: 1.5;
    color: #cbd5e1;
}
#lw-callback-overlay.lw-cb-overlay.active { display: flex; }
#lw-callback-overlay.lw-cb-overlay.visible { opacity: 1; }

/* ── Container ── */
#lw-callback-overlay .lw-cb-container {
    background: #0f172a;
    border-radius: 12px;
    max-width: 480px;
    width: 92%;
    margin: 20px;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid #1e293b;
}
#lw-callback-overlay.visible .lw-cb-container {
    transform: scale(1) translateY(0);
}

/* ── Close (div not button to avoid theme conflicts) ── */
#lw-callback-overlay .lw-cb-close {
    position: absolute;
    top: 14px; right: 14px;
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: #64748b;
    font-size: 20px;
    line-height: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
    padding: 0;
    margin: 0;
    text-align: center;
    text-decoration: none;
    box-shadow: none;
    text-transform: none;
    letter-spacing: 0;
    font-family: inherit;
}
#lw-callback-overlay .lw-cb-close:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-color: rgba(255,255,255,0.15);
}

/* ── Header ── */
#lw-callback-overlay .lw-cb-header {
    padding: 32px 28px 24px;
    text-align: center;
    border-bottom: 1px solid #1e293b;
}
#lw-callback-overlay .lw-cb-icon {
    width: 56px; height: 56px;
    background: rgba(201, 48, 44, 0.08);
    border: 1px solid rgba(201, 48, 44, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #e03e3a;
}
#lw-callback-overlay .lw-cb-title {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 6px;
    padding: 0;
    border: none;
    background: none;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.3;
}
#lw-callback-overlay .lw-cb-subtitle {
    font-size: 14px;
    color: #94a3b8;
    margin: 0;
    padding: 0;
    line-height: 1.4;
}

/* ── Section title (matching .lw-form-section-title style) ── */
#lw-callback-overlay .lw-cb-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 18px;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    background: none;
    line-height: 1.4;
}
#lw-callback-overlay .lw-cb-section-title svg {
    color: #e03e3a;
    flex-shrink: 0;
}
#lw-callback-overlay .lw-cb-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #334155;
}

/* ── Body / Form ── */
#lw-callback-overlay .lw-cb-body { padding: 24px 28px; }

/* Grid (2-col for email/phone) */
#lw-callback-overlay .lw-cb-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* Fields */
#lw-callback-overlay .lw-cb-field { margin-bottom: 14px; }
#lw-callback-overlay .lw-cb-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 6px;
    padding: 0;
    line-height: 1.4;
}
#lw-callback-overlay .lw-cb-field .lw-req { color: #c9302c; }
#lw-callback-overlay .lw-cb-field .lw-cb-optional {
    font-weight: 400;
    color: #64748b;
    font-size: 12px;
}

#lw-callback-overlay .lw-cb-field input[type="text"],
#lw-callback-overlay .lw-cb-field input[type="email"],
#lw-callback-overlay .lw-cb-field input[type="tel"],
#lw-callback-overlay .lw-cb-field select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #1e293b;
    color: #ffffff;
    font-size: 14px;
    font-family: 'Outfit', 'DM Sans', sans-serif;
    transition: all 0.2s ease;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    box-shadow: none;
    line-height: 1.5;
}
#lw-callback-overlay .lw-cb-field input::placeholder { color: #64748b; }
#lw-callback-overlay .lw-cb-field input:focus,
#lw-callback-overlay .lw-cb-field select:focus {
    outline: none;
    border-color: #c9302c;
    box-shadow: 0 0 0 3px rgba(201,48,44,0.12);
    background: #253347;
}
#lw-callback-overlay .lw-cb-field input.lw-field-error,
#lw-callback-overlay .lw-cb-field select.lw-field-error {
    border-color: #c9302c;
    background: rgba(201,48,44,0.04);
}

/* Select dropdown arrow */
#lw-callback-overlay .lw-cb-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* ── Error ── */
#lw-callback-overlay .lw-cb-error {
    padding: 10px 14px;
    background: rgba(201,48,44,0.08);
    border: 1px solid rgba(201,48,44,0.25);
    border-radius: 8px;
    color: #e03e3a;
    font-size: 13px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Submit (div not button) ── */
#lw-callback-overlay .lw-cb-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: #c9302c;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-family: 'Outfit', 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.4;
    box-shadow: none;
    text-decoration: none;
    margin: 0;
    box-sizing: border-box;
    user-select: none;
}
#lw-callback-overlay .lw-cb-submit:hover { background: #e03e3a; }
#lw-callback-overlay .lw-cb-submit.disabled { opacity: 0.6; cursor: not-allowed; pointer-events: none; }
#lw-callback-overlay .lw-cb-submit svg { flex-shrink: 0; }

/* ── Privacy ── */
#lw-callback-overlay .lw-cb-privacy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    font-size: 11px;
    color: #64748b;
    margin: 14px 0 0;
    padding: 0;
}
#lw-callback-overlay .lw-cb-privacy svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* ── Success ── */
#lw-callback-overlay .lw-cb-success { text-align: center; padding: 48px 28px; }
#lw-callback-overlay .lw-cb-success-icon { margin-bottom: 16px; }
#lw-callback-overlay .lw-cb-success h3 {
    font-size: 22px; font-weight: 700; color: #ffffff;
    margin: 0 0 8px; padding: 0; border: none; background: none; text-transform: none;
}
#lw-callback-overlay .lw-cb-success p {
    font-size: 14px; color: #94a3b8; margin: 0;
}
#lw-callback-overlay .lw-cb-success-ref {
    font-size: 12px;
    color: #64748b;
    margin: 12px 0 0;
    font-weight: 600;
}

/* ── Responsive ── */
@media (max-width: 520px) {
    #lw-callback-overlay .lw-cb-container { margin: 10px; width: calc(100% - 20px); }
    #lw-callback-overlay .lw-cb-header { padding: 24px 20px 20px; }
    #lw-callback-overlay .lw-cb-body { padding: 20px; }
    #lw-callback-overlay .lw-cb-title { font-size: 20px; }
    #lw-callback-overlay .lw-cb-grid { grid-template-columns: 1fr; }
}
