/* ==========================================================================
   1. VARIABLES & BASE SETUP
   ========================================================================== */
:root {
    --brand:      #004aad;
    --brand-dark: #003480;
    --brand-lite: #e8f0ff;
    --accent:     #f5a623;
    --surface:    #ffffff;
    --bg:         #f0f4fb;
    --border:     #dde4f0;
    --text:       #1a2340;
    --muted:      #6b7694;
    --error:      #ef4444;
    --success:    #22c55e;
    --radius-sm:  8px;
    --radius-md:  14px;
    --radius-lg:  20px;
    --shadow-sm:  0 2px 8px rgba(0,74,173,.07);
    --shadow-md:  0 8px 32px rgba(0,74,173,.12);
    --shadow-lg:  0 20px 60px rgba(0,74,173,.15);
    --transition: .25s cubic-bezier(.4,0,.2,1);
}

.pm-lang-ar {
    direction: rtl;
    text-align: right;
}

/* ==========================================================================
   2. ELEMENTOR POPUP OVERFLOW FIXES
   ========================================================================== */
.pm-service-form,
.pm-service-form .form-inner,
.pm-service-form .pm-step-panel,
.pm-service-form .pm-fields-grid,
.pm-service-form .pm-field,
.pm-service-form .pm-phone-wrap {
    overflow: visible !important;
}

/* ==========================================================================
   3. MAIN FORM CONTAINER
   ========================================================================== */
#pm-service-form {
    max-width: 660px;
    width: 100%;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    margin: 40px auto;
}

.form-inner { 
/*     padding: 44px 48px 48px;  */
}

.pm-form-header { margin-bottom: 28px; }
.pm-form-header h2 { font-size: 24px; font-weight: 800; color: var(--text); margin-bottom: 6px; line-height: 1.2; }
.pm-form-header h2 span { color: var(--brand); }
.pm-form-header p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; }

/* ==========================================================================
   4. STEPPER UI
   ========================================================================== */
.pm-stepper { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 40px; padding: 0 4px; }
.pm-step { position: relative; flex-shrink: 0; z-index: 1; }
.step-bubble { width: 36px; height: 36px; border-radius: 50%; background: var(--border); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: var(--muted); transition: all var(--transition); }
.pm-step.active .step-bubble { background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(0,74,173,.35); transform: scale(1.08); }
.pm-step.done .step-bubble { background: var(--brand); color: #fff; }

.pm-step-track { flex: 1; height: 3px; background: var(--border); position: relative; border-radius: 3px; overflow: hidden; min-width: 60px; max-width: 140px; }

/* ✅ Progress bar line style */
.pm-step-fill { 
    position: absolute; 
    left: 0; /* Default LTR */
    top: 0; 
    height: 100%; 
    width: 0%; 
    background: var(--brand); 
    border-radius: 3px; 
    transition: width .5s cubic-bezier(.4,0,.2,1); 
}

/* ✅ Flip starting point for Arabic RTL */
html[lang^=ar] .pm-step-fill {
    left: auto;
    right: 0; 
}


/* ==========================================================================
   5. PANELS VISIBILITY
   ========================================================================== */
.pm-step-panel { display: none; }
.pm-step-panel.active { display: block !important; animation: pmFadeUp .35s ease forwards; }

@keyframes pmFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

/* ==========================================================================
   6. STEP 1: CATEGORY CARDS
   ========================================================================== */
.pm-categories { display: flex; flex-direction: column; gap: 12px; }
.pm-radio-card { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border: 2px solid var(--border); border-radius: var(--radius-md); cursor: pointer; transition: all var(--transition); background: var(--surface); user-select: none; position: relative; }
.pm-radio-card:hover, .pm-radio-card.selected { border-color: var(--brand); background: var(--brand-lite); box-shadow: var(--shadow-sm); }
.pm-radio-card:hover { transform: translateY(-1px); }
.pm-radio-card input[type="radio"] { display: none; }

.card-icon { width: 44px; height: 44px; border-radius: var(--radius-sm); background: var(--brand-lite); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--brand); transition: all var(--transition); }
.pm-radio-card:hover .card-icon, .pm-radio-card.selected .card-icon { background: var(--brand); color: #fff; }

.card-body { flex: 1; }
.card-body strong { display: block; font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.card-body small { color: var(--muted); font-size: 13px; line-height: 1.5; }

.card-check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all var(--transition); }
.pm-radio-card.selected .card-check { border-color: var(--brand); background: var(--brand); }
.card-check::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: 0; transition: opacity var(--transition); }
.pm-radio-card.selected .card-check::after { opacity: 1; }

/* ==========================================================================
   7. STEP 2: SERVICES GRID
   ========================================================================== */
.pm-services-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }

.pm-check-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 2px solid var(--border); border-radius: var(--radius-md); cursor: pointer; transition: all var(--transition); background: var(--surface); user-select: none; }
.pm-check-card:hover, .pm-check-card.checked { border-color: var(--brand); background: var(--brand-lite); }
.pm-check-card input[type="checkbox"] { display: none; }

.check-box { width: 20px; height: 20px; border-radius: 5px; border: 2px solid var(--border); background: var(--surface); flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all var(--transition); }
.pm-check-card.checked .check-box { background: var(--brand); border-color: var(--brand); }
.check-box svg { opacity: 0; transition: opacity var(--transition); }
.pm-check-card.checked .check-box svg { opacity: 1; }
.check-label { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.4; }

/* ==========================================================================
   8. STEP 3: CONTACT FIELDS & PHONE DROPDOWN
   ========================================================================== */
.pm-fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pm-field { position: relative; }
.pm-field.full { grid-column: 1 / -1; }
.pm-field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.pm-field label .req { color: var(--accent); margin-left: 2px; }

.pm-field input { width: 100%; padding: 13px 16px; border-radius: var(--radius-sm) !important; border: 2px solid var(--border) !important; background: var(--surface); font-size: 14px; color: var(--text); font-family: inherit; transition: border-color var(--transition), box-shadow var(--transition); outline: none; appearance: none; box-sizing: border-box; }
.pm-field input:focus { border-color: var(--brand) !important; box-shadow: 0 0 0 3px var(--brand-lite); }

/* --- PHONE FIELD WRAPPER --- */
.pm-phone-wrap {
    display: flex;
    align-items: stretch;
    width: 100%;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    position: relative;
    transition: border-color var(--transition), box-shadow var(--transition);
    box-sizing: border-box;
}
.pm-phone-wrap:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-lite);
}

.phone-country-btn {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 0 14px 0 16px;
    background: transparent;
    border-right: 1.5px solid var(--border);
    border-radius: 6px 0 0 6px;
    cursor: pointer;
    flex-shrink: 0;
    user-select: none;
    transition: background var(--transition);
    pointer-events: auto !important; 
    z-index: 10;
}
.phone-country-btn:hover { background: var(--brand-lite); }

.dial-code { display: block !important; font-size: 14px !important; font-weight: 700 !important; color: var(--text) !important; }

.flag-emoji { font-size: 18px; line-height: 1; }
/* WP Emoji Image Fix */
.flag-emoji img.emoji { width: 20px !important; height: 20px !important; display: inline-block !important; box-shadow: none !important; border: none !important; margin: 0 !important; padding: 0 !important; vertical-align: middle !important; }

.chevron { font-size: 10px; color: var(--muted); transition: transform var(--transition); margin-left: 2px; }
.phone-country-btn.open .chevron { transform: rotate(180deg); }

/* --- THE DROPDOWN LIST --- */
.country-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 280px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15) !important;
    z-index: 2147483647 !important;
    display: none; 
}
.country-dropdown.open { display: block !important; animation: pmFadeDown .2s ease forwards; }

.country-list { padding: 8px; display: flex; flex-direction: column; }

.country-option {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    font-size: 14px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.country-option:hover  { background: var(--brand-lite); }
.country-option.active { background: var(--brand-lite); }
.country-name { flex: 1 1 auto; color: var(--text) !important; font-weight: 500; }
.country-dial { font-size: 14px !important; font-weight: 700 !important; color: var(--brand) !important; flex-shrink: 0; }

.phone-input-field { flex: 1; padding: 13px 16px; border: none !important; box-shadow: none !important; background: transparent; font-size: 14px; font-family: inherit; color: var(--text); outline: none !important; min-width: 0; box-sizing: border-box; }
.phone-input-field::placeholder { color: #b0b8d0; }

/* ==========================================================================
   9. ERRORS & VALIDATION
   ========================================================================== */
.pm-err-msg { font-size: 12px; color: var(--error); margin-top: 5px; display: none; }
.pm-field.has-error .pm-err-msg { display: block; }
.pm-field.has-error input { border-color: var(--error) !important; }
.pm-field.has-error .pm-phone-wrap { border-color: var(--error); box-shadow: 0 0 0 3px rgba(239,68,68,.1); }

.pm-service-err { display: flex; align-items: flex-start; gap: 6px; margin-top: 10px; padding: 10px 14px; background: #fef2f2; border: 1px solid #fecaca; border-radius: var(--radius-sm); font-size: 13px; color: #ef4444; line-height: 1.5; }

@keyframes pmShake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
.pm-shake { animation: pmShake .45s ease; }

/* ==========================================================================
   10. BUTTONS & SUCCESS SCREEN
   ========================================================================== */
.pm-buttons { display: flex; justify-content: space-between; align-items: center; margin-top: 32px; gap: 12px; flex-wrap: wrap; }
.pm-buttons--end { justify-content: flex-end; }
.pm-liquid-wrap { display: inline-flex; }
.pm-liquid-wrap button:disabled, .pm-liquid-wrap button[disabled] { opacity: .45 !important; cursor: not-allowed !important; pointer-events: none !important; box-shadow: none !important; transform: none !important; }
.pm-liquid-wrap button:disabled .liquid-animation-stage { display: none; }

.pm-success { display: none; text-align: center; padding: 48px 24px 40px; }
.pm-success.active { display: block !important; animation: pmFadeUp .4s ease forwards; }
.success-icon { width: 72px; height: 72px; border-radius: 50%; background: #dcfce7; margin: 0 auto 24px; display: flex; align-items: center; justify-content: center; font-size: 30px; color: #16a34a; font-weight: 700; }
.pm-success h3 { font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 10px; }
.pm-success p { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 0; }

/* ==========================================================================
   11. RESPONSIVE
   ========================================================================== */
@media (max-width: 640px) {
    .form-inner { padding: 28px 20px 32px; }
    .pm-fields-grid { grid-template-columns: 1fr; }
    .pm-field.full { grid-column: 1; }
    .pm-services-grid { grid-template-columns: 1fr; }
    .pm-step-track { min-width: 32px; }
    .pm-buttons { flex-wrap: wrap; }
}

/* ==========================================================================
   12. RTL (ARABIC) OVERRIDES
   ========================================================================== */
html[lang^=ar] .form-inner div, html[lang^=ar] .form-inner p { line-height: 1.3em !important; }
html[lang^=ar] .pm-stepper { direction: rtl; }
html[lang^=ar] .pm-phone-wrap { direction: ltr; }
html[lang^=ar] .country-dropdown { right: 0; left: auto; }
html[lang^=ar] .form-inner .elementor-button-icon i { transform: rotate(180deg) !important; }
html[lang^=ar] .country-name { font-size: 13px; text-align: left; }
input.phone-input-field.inp-phone{
	border: none !important;
}