/* ═══════════════════════════════════════════════
   Multi Step Form Widget v3.1
   Author: Abdul Moiz Nisar
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ── Reset ── */
.msfw-outer *, .msfw-outer *::before, .msfw-outer *::after { box-sizing: border-box; }
.msfw-outer { font-family: 'Poppins', sans-serif; border: 1px solid #e5e7eb; overflow: hidden; }

/* ─────────────────────────────────────────────
   POPUP / MODAL SYSTEM
───────────────────────────────────────────── */
.msfw-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: msfw-fade-in 0.2s ease;
}
.msfw-popup-overlay.open { display: flex; }
.msfw-popup-inner {
    position: relative;
    width: 100%;
    max-width: 960px;
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 16px;
    animation: msfw-scale-in 0.25s cubic-bezier(.34,1.56,.64,1);
    box-shadow: 0 25px 60px rgba(0,0,0,0.35);
}
.msfw-popup-close {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 10;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    transition: background .15s;
    line-height: 1;
}
.msfw-popup-close:hover { background: #fff; }

.msfw-popup-inner .msfw-outer {
    border: none;
    border-radius: 0;
}

@keyframes msfw-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes msfw-scale-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }

/* ─────────────────────────────────────────────
   STEP TRIGGER CARDS (click to open popup with that step)
───────────────────────────────────────────── */
.msfw-step-triggers {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
    background: #fff;
    font-family: 'Poppins', sans-serif;
}

.msfw-step-trigger-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    background: #fff;
    font-family: 'Poppins', sans-serif;
    transition: border-color .2s, box-shadow .2s, background .2s;
    text-align: left;
    width: 100%;
}
.msfw-step-trigger-card:hover {
    border-color: #1a56db;
    background: #f8faff;
    box-shadow: 0 2px 12px rgba(26,86,219,.10);
}
.msfw-step-trigger-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #eff6ff;
    color: #1a56db;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: 'Poppins', sans-serif;
}
.msfw-step-trigger-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    font-family: 'Poppins', sans-serif;
    flex: 1;
}
.msfw-step-trigger-arrow {
    color: #9ca3af;
    font-size: 16px;
}

/* ─────────────────────────────────────────────
   LAYOUTS
───────────────────────────────────────────── */
.msfw-layout-single .msfw-step-wrap         { display: none; flex-direction: column; }
.msfw-layout-single .msfw-step-wrap.active  { display: flex; }
.msfw-layout-single .msfw-img-panel         { display: none; }
.msfw-layout-single .msfw-form-panel        { width: 100%; max-width: 560px; margin: 0 auto; }

.msfw-layout-split .msfw-step-wrap          { display: none; flex-direction: row; }
.msfw-layout-split .msfw-step-wrap.active   { display: flex; }

.msfw-ty-wrap { display: none !important; }
.msfw-ty-wrap.active { display: flex !important; }

/* ─────────────────────────────────────────────
   FORM PANEL
───────────────────────────────────────────── */
.msfw-form-panel {
    flex: 1;
    background: #fff;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
}

.msfw-logo { display: flex; align-items: center; justify-content: flex-start; margin-bottom: 24px; }
.msfw-logo img { width: 120px; height: auto; display: block; }

.msfw-progress { height: 4px; background: #e5e7eb; border-radius: 4px; overflow: hidden; }
.msfw-progress-fill { height: 4px; background: #1a56db; border-radius: 4px; transition: width 0.45s cubic-bezier(.4,0,.2,1); }

/* ── Combined Progress Nav Row — back | bar | close ── */
.msfw-progress-nav-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.msfw-pnr-bar {
    flex: 1;
    margin: 0;
}
.msfw-pnr-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 50%;
    cursor: pointer;
    color: #9ca3af;
    padding: 0;
    transition: background .15s, color .15s;
    outline: none;
}
.msfw-pnr-btn:hover,
.msfw-pnr-btn:focus,
.msfw-pnr-btn:active {
    background: #f3f4f6 !important;
    background-color: #f3f4f6 !important;
    color: #374151;
    box-shadow: none !important;
}
.msfw-pnr-placeholder { cursor: default; pointer-events: none; visibility: hidden; }

/* counter row */
.msfw-counter-row { margin-bottom: 8px; }
.msfw-counter  { font-size: 12px; color: #9ca3af; font-family: 'Poppins', sans-serif; }
/* keep old nav-row in case referenced elsewhere */
.msfw-nav-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; min-height: 32px; }
.msfw-step-summary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 22px;
    margin-bottom: 6px;
    align-items: center;
}
.msfw-step-summary-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-family: 'Poppins', sans-serif;
    color: #6b7280;
    background: #f3f4f6;
    border-radius: 20px;
    padding: 2px 10px;
    line-height: 1.5;
}
.msfw-step-summary-item strong {
    color: #1a56db;
    font-weight: 600;
}
.msfw-step-summary-item .msfw-sum-sep {
    color: #d1d5db;
    font-size: 10px;
    margin: 0 2px;
}

.msfw-nav-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; min-height: 32px; }
.msfw-counter  { font-size: 12px; color: #9ca3af; font-family: 'Poppins', sans-serif; }

.msfw-title    { font-size: 22px; font-weight: 700; color: #111827; text-align: center; margin: 0 0 6px; line-height: 1.3; font-family: 'Poppins', sans-serif; }
.msfw-subtitle { font-size: 13px; color: #6b7280; text-align: center; margin: 0 0 24px; line-height: 1.5; font-family: 'Poppins', sans-serif; }

/* ─────────────────────────────────────────────
   CHOICE GRID
───────────────────────────────────────────── */
/* Legacy grid (kept for compatibility) */
.msfw-grid { display: grid; gap: 8px; margin-bottom: 24px; }
/* New flexbox grid — used when alignment/width controls are active */
.msfw-grid.msfw-flex-grid { display: flex !important; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.msfw-grid.msfw-flex-grid .msfw-chip { flex-shrink: 0; }
.msfw-chip {
    padding: 12px 10px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    background: #fff;
    color: #374151;
    transition: border-color .15s, background .15s, color .15s, transform .1s;
    text-align: center;
    line-height: 1.4;
}
.msfw-chip:hover  { border-color: #1a56db; background: #eff6ff; color: #1a56db; }
.msfw-chip.selected { border-color: #1a56db; background: #eff6ff; color: #1a56db; font-weight: 500; }
.msfw-chip:active { transform: scale(.97); }

/* ─────────────────────────────────────────────
   INPUT FIELDS
───────────────────────────────────────────── */
.msfw-input {
    display: block;
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 7px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    color: #111827;
    background: #fff;
    margin-bottom: 10px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    appearance: none;
    -webkit-appearance: none;
    resize: vertical;
}
.msfw-input:focus { border-color: #1a56db; box-shadow: 0 0 0 3px rgba(26,86,219,.12); }
.msfw-input.error { border-color: #ef4444; }

/* ─────────────────────────────────────────────
   PHONE FIELD — FIXED:
   1. Width matches input field
   2. No pink/red hover color
   3. All countries included in PHP
───────────────────────────────────────────── */
.msfw-phone-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid #d1d5db;
    border-radius: 7px;
    overflow: visible;
    margin-bottom: 10px;
    position: relative;
    transition: border-color .15s, box-shadow .15s;
    background: #fff;
    width: 100%;
}
.msfw-phone-wrap:focus-within {
    border-color: #1a56db;
    box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
.msfw-country-selector { position: relative; flex-shrink: 0; }
.msfw-country-btn {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 10px 8px 10px 10px;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    border-right: 1.5px solid #e5e7eb !important;
    box-shadow: none !important;
    cursor: pointer;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    color: #374151;
    white-space: nowrap;
    transition: background .15s;
    outline: none;
    min-width: 0;
    border-radius: 0 !important;
}
.msfw-country-btn:hover,
.msfw-country-btn:focus,
.msfw-country-btn:active { background: transparent !important; background-color: transparent !important; box-shadow: none !important; }
.msfw-country-flag { font-size: 16px; line-height: 1; }
.msfw-country-code { font-weight: 600; color: #111827; font-family: 'Poppins', sans-serif; font-size: 13px; }
.msfw-country-arrow { font-size: 10px; color: #9ca3af; margin-left: 1px; transition: transform .2s; }
.msfw-country-btn[aria-expanded="true"] .msfw-country-arrow { transform: rotate(180deg); }

/* Dropdown — compact: flag + code only, no full country name */
.msfw-country-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 120px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
    z-index: 9999;
    max-height: 200px;
    overflow-y: auto;
    animation: msfw-fade-in .15s ease;
}
.msfw-country-dropdown::-webkit-scrollbar { width: 4px; }
.msfw-country-dropdown::-webkit-scrollbar-track { background: #f9fafb; }
.msfw-country-dropdown::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.msfw-country-dropdown div {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 12px;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    color: #374151;
    background: transparent;
}
.msfw-country-dropdown div:hover { background: #f9fafb !important; color: #374151 !important; }
.msfw-country-dropdown div.active { background: #eff6ff !important; color: #1a56db !important; font-weight: 600; }
/* Hide country full name (2nd span), show only flag (1st) and code (3rd) */
.msfw-country-dropdown div > span:first-child { display: inline !important; font-size: 15px; line-height: 1; }
.msfw-country-dropdown div > span:nth-child(2) { display: none !important; }
.msfw-country-dropdown div > span:nth-child(3) { color: #374151; font-size: 12px; font-family: 'Poppins', sans-serif; margin-left: auto; }

.msfw-phone-number {
    flex: 1;
    border: none;
    outline: none;
    padding: 11px 14px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    color: #111827;
    background: transparent;
    min-width: 0;
}
.msfw-phone-number::placeholder {
    color: #9ca3af;
    opacity: 1;
}

/* ─────────────────────────────────────────────
   IMAGE UPLOAD BOX
───────────────────────────────────────────── */
.msfw-img-upload {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    margin-bottom: 16px;
    transition: border-color .15s, background .15s;
    background: #f9fafb;
}
.msfw-img-upload:hover { border-color: #1a56db; background: #eff6ff; }
.msfw-img-upload-icon  { font-size: 28px; display: block; margin-bottom: 6px; }
.msfw-img-upload-label { font-size: 13px; color: #6b7280; display: block; font-family: 'Poppins', sans-serif; }
.msfw-img-preview      { max-width: 100%; border-radius: 8px; margin-top: 12px; display: none; }

.msfw-custom-content { margin-top: 16px; }

/* ─────────────────────────────────────────────
   FOOTER
───────────────────────────────────────────── */
.msfw-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

/* ─────────────────────────────────────────────
   NEXT / SUBMIT BUTTON
───────────────────────────────────────────── */
.msfw-btn-next {
    background: #1a56db;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 26px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: background .15s, color .15s, transform .1s;
    display: inline-block;
    text-decoration: none;
    line-height: 1.4;
}
.msfw-btn-next:hover  { background: #1648c0; color: #fff; }
.msfw-btn-next:active { transform: scale(.97); }
.msfw-btn-next.loading { opacity: .65; pointer-events: none; }

/* ─────────────────────────────────────────────
   BACK & SKIP BUTTONS
───────────────────────────────────────────── */
.msfw-btn-back,
.msfw-btn-skip {
    background: transparent;
    border: none;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background .15s, color .15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.msfw-btn-back:hover,
.msfw-btn-skip:hover { background: #f3f4f6; color: #111827; }

/* ─────────────────────────────────────────────
   IMAGE PANEL (right side)
───────────────────────────────────────────── */
.msfw-img-panel {
    flex: 0 0 42%;
    max-width: 42%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1a56db 0%, #7c3aed 100%);
}
.msfw-img-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.22);
    z-index: 1;
}
.msfw-overlay-card {
    position: absolute;
    bottom: 32px;
    left: 24px;
    right: 24px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 12px;
    padding: 20px;
    z-index: 2;
    color: #fff;
    animation: msfw-slideup 0.35s ease;
}
.msfw-overlay-icon  { font-size: 28px; margin-bottom: 8px; display: block; }
.msfw-overlay-title { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 4px; font-family: 'Poppins', sans-serif; }
.msfw-overlay-text  { font-size: 13px; color: rgba(255,255,255,.85); line-height: 1.4; font-family: 'Poppins', sans-serif; }

/* ─────────────────────────────────────────────
   THANK YOU SCREEN — matches screenshot exactly:
   Logo top-center, green check circle, "Thank you!"
   subtitle text, two card boxes (Connect/Website)
───────────────────────────────────────────── */
.msfw-ty-panel {
    width: 100%;
    padding: 48px 40px;
    font-family: 'Poppins', sans-serif;
}

.msfw-ty-layout-simple {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 520px;
    margin: 0 auto;
}
.msfw-ty-layout-simple .msfw-ty-icon { margin: 0 auto 20px; }

.msfw-ty-layout-card { display: flex; flex-direction: row; align-items: center; gap: 40px; max-width: 820px; margin: 0 auto; }
.msfw-ty-layout-card .msfw-ty-left  { flex: 1; }
.msfw-ty-layout-card .msfw-ty-right { flex: 0 0 260px; }
.msfw-ty-layout-card .msfw-ty-right img { width: 100%; border-radius: 12px; object-fit: cover; max-height: 340px; }

.msfw-ty-layout-fullsplit { display: flex; flex-direction: row; align-items: stretch; }
.msfw-ty-layout-fullsplit .msfw-ty-left  { flex: 1; padding-right: 40px; display: flex; flex-direction: column; justify-content: center; }
.msfw-ty-layout-fullsplit .msfw-ty-right { flex: 0 0 45%; }
.msfw-ty-layout-fullsplit .msfw-ty-img   { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 12px; }

/* Green check icon */
.msfw-ty-icon {
    width: 56px;
    height: 56px;
    background: #22c55e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 16px;
    flex-shrink: 0;
    color: #fff;
    box-shadow: 0 4px 16px rgba(34,197,94,.25);
}

.msfw-ty-title    { font-size: 26px; font-weight: 700; color: #111827; margin: 0 0 8px; line-height: 1.3; font-family: 'Poppins', sans-serif; }
.msfw-ty-subtitle { font-size: 14px; color: #6b7280; margin: 0 0 24px; line-height: 1.6; font-family: 'Poppins', sans-serif; }
.msfw-ty-badge {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 100px;
    margin-bottom: 20px;
    font-family: 'Poppins', sans-serif;
}
.msfw-ty-summary {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: #1e40af;
    margin-bottom: 20px;
    line-height: 1.7;
    font-family: 'Poppins', sans-serif;
}
.msfw-ty-btn { margin-top: 8px; }

/* Action cards row (matching screenshot) */
.msfw-ty-actions {
    display: flex;
    gap: 14px;
    margin-top: 16px;
    justify-content: center;
    flex-wrap: wrap;
}
.msfw-ty-action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    min-width: 150px;
    flex: 1;
    max-width: 210px;
    font-family: 'Poppins', sans-serif;
    transition: border-color .15s, box-shadow .15s;
    text-decoration: none;
    color: inherit;
}
.msfw-ty-action-card:hover {
    border-color: #1a56db;
    box-shadow: 0 2px 12px rgba(26,86,219,.10);
}
.msfw-ty-action-card-label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    text-align: center;
    font-family: 'Poppins', sans-serif;
}
.msfw-ty-action-card-icons {
    display: flex;
    gap: 10px;
    align-items: center;
}
.msfw-social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    text-decoration: none;
    transition: transform .2s, opacity .2s;
    color: #fff;
    flex-shrink: 0;
}
.msfw-social-icon:hover { transform: scale(1.12); opacity: .9; }
.msfw-social-icon svg { width: 18px; height: 18px; display: block; }
.msfw-social-fb { background: #1877f2; }
.msfw-social-ig { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.msfw-social-li { background: #0a66c2; }
.msfw-ty-action-card-btn {
    display: inline-block;
    background: #1a56db;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 18px;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    transition: background .15s;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}
.msfw-ty-action-card-btn:hover { background: #1648c0; color: #fff; }

.msfw-editor-notice { display: block; margin-bottom: 8px; }

/* ─────────────────────────────────────────────
   ANIMATIONS
───────────────────────────────────────────── */
@keyframes msfw-slideup {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.msfw-step-wrap.active .msfw-form-panel {
    animation: msfw-slideup 0.3s ease;
}

/* ─────────────────────────────────────────────
   RESPONSIVE — Mobile / Tablet / Desktop
───────────────────────────────────────────── */
@media (max-width: 768px) {
    .msfw-layout-split .msfw-step-wrap.active { flex-direction: column; }
    .msfw-img-panel { flex: none !important; max-width: 100% !important; width: 100%; min-height: 200px !important; }
    .msfw-form-panel { padding: 28px 20px; }
    .msfw-title { font-size: 18px; }
    .msfw-grid  { grid-template-columns: repeat(2, 1fr) !important; }
    .msfw-ty-layout-card    { flex-direction: column; }
    .msfw-ty-layout-fullsplit { flex-direction: column; }
    .msfw-ty-layout-fullsplit .msfw-ty-left { padding-right: 0; padding-bottom: 24px; }
    .msfw-ty-panel { padding: 28px 20px; }
    .msfw-country-dropdown { width: 120px; }
    .msfw-popup-inner { max-height: 95vh; border-radius: 12px; }
}

@media (max-width: 480px) {
    .msfw-form-panel { padding: 20px 16px; }
    .msfw-title { font-size: 16px; }
    .msfw-subtitle { font-size: 12px; }
    .msfw-grid { grid-template-columns: 1fr !important; }
    .msfw-btn-next { padding: 10px 18px; font-size: 13px; width: 100%; text-align: center; }
    .msfw-foot { flex-direction: column-reverse; align-items: stretch; }

    /* Mobile image-top: image upar aaye */
    .msfw-layout-split .msfw-step-wrap.active:has(.msfw-mobile-image-top) { flex-direction: column; }
    .msfw-layout-split .msfw-step-wrap.active .msfw-mobile-image-top { order: -1; }
    .msfw-layout-split .msfw-step-wrap.active:has(.msfw-mobile-image-top) .msfw-form-panel { order: 1; }

    /* Mobile image-bottom: image neche aaye (explicit) */
    .msfw-layout-split .msfw-step-wrap.active:has(.msfw-mobile-image-bottom) { flex-direction: column; }
    .msfw-layout-split .msfw-step-wrap.active .msfw-mobile-image-bottom { order: 2; }
    .msfw-layout-split .msfw-step-wrap.active:has(.msfw-mobile-image-bottom) .msfw-form-panel { order: 1; }
    .msfw-ty-panel { padding: 20px 16px; }
    .msfw-ty-title { font-size: 20px; }
    .msfw-ty-actions { flex-direction: column; align-items: center; }
    .msfw-ty-action-card { max-width: 100%; width: 100%; flex-direction: row; justify-content: space-between; padding: 14px 16px; }
    .msfw-country-dropdown { width: 120px; }
    .msfw-popup-inner { border-radius: 10px; }
    .msfw-step-trigger-card { padding: 12px 14px; }
}

@media (min-width: 1200px) {
    .msfw-title { font-size: 24px; }
    .msfw-ty-title { font-size: 30px; }
}

/* ═══ v4 additions ═══════════════════════════════════ */

/* Required star */
.msfw-required-star { color: #ef4444; margin-left: 2px; }

/* Field wrapper with label */
.msfw-chip-disabled,
.msfw-chip:disabled {
    opacity: 0.38 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}
.msfw-select-hint {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
    font-family: 'Poppins', sans-serif;
}
.msfw-fields-wrap .msfw-field-row {
    align-items: flex-start;
}
.msfw-fields-wrap .msfw-field-wrap {
    margin-bottom: 0;
}
.msfw-field-wrap { margin-bottom: 14px; }
.msfw-field-wrap:last-child { margin-bottom: 0; }
.msfw-field-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 5px;
    font-family: 'Poppins', sans-serif;
}

/* Custom containers */
/* Custom containers — layout controlled by inline styles from Elementor settings */
.msfw-custom-container {
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
}
.msfw-custom-container > div {
    box-sizing: border-box;
}

/* Skip button position: right */
.msfw-foot.msfw-skip-right {
    flex-direction: row-reverse;
}

/* Per-step layout — single column forces image panel to not show */
.msfw-step-wrap.msfw-step-layout-single .msfw-img-panel {
    display: none !important;
}
.msfw-step-wrap.msfw-step-layout-single .msfw-form-panel {
    flex: 1;
}

/* Hide image panel on mobile */
@media (max-width: 767px) {
    .msfw-img-panel.msfw-hide-mobile { display: none !important; }
}

/* Hide image panel on desktop */
@media (min-width: 768px) {
    .msfw-img-panel.msfw-hide-desktop { display: none !important; }
}

/* ─────────────────────────────────────────────
   TABLET IMAGE LAYOUT OPTIONS (480px – 1024px)
   ─────────────────────────────────────────────
   Default: image stacks below form (flex-direction: column on parent).
   image-top:    image comes FIRST (upar), form below.
   image-bottom: image comes LAST  (neche), form above. (default behavior)
   side-by-side: both panels shown side by side, shrunk to fit.
───────────────────────────────────────────── */
@media (max-width: 1024px) and (min-width: 481px) {

    /* IMAGE TOP — Image upar, form neche */
    .msfw-layout-split .msfw-step-wrap.active:has(.msfw-tablet-image-top) {
        flex-direction: column;
    }
    .msfw-layout-split .msfw-step-wrap.active .msfw-tablet-image-top {
        order: -1;
        width: 100% !important;
        flex: none !important;
        max-width: 100% !important;
        min-height: 220px;
    }
    .msfw-layout-split .msfw-step-wrap.active:has(.msfw-tablet-image-top) .msfw-form-panel {
        order: 1;
        width: 100%;
    }

    /* IMAGE BOTTOM — Image neche, form upar (explicit, same as default but clear) */
    .msfw-layout-split .msfw-step-wrap.active:has(.msfw-tablet-image-bottom) {
        flex-direction: column;
    }
    .msfw-layout-split .msfw-step-wrap.active .msfw-tablet-image-bottom {
        order: 2;
        width: 100% !important;
        flex: none !important;
        max-width: 100% !important;
        min-height: 220px;
    }
    .msfw-layout-split .msfw-step-wrap.active:has(.msfw-tablet-image-bottom) .msfw-form-panel {
        order: 1;
        width: 100%;
    }

    /* SIDE BY SIDE — Shrink kar ke dono ek line mein */
    .msfw-layout-split .msfw-step-wrap.active:has(.msfw-tablet-side-by-side) {
        flex-direction: row !important;
        align-items: stretch;
    }
    .msfw-layout-split .msfw-step-wrap.active .msfw-tablet-side-by-side {
        flex: 0 0 40% !important;
        max-width: 40% !important;
        min-height: 200px;
    }
    .msfw-layout-split .msfw-step-wrap.active:has(.msfw-tablet-side-by-side) .msfw-form-panel {
        flex: 1 !important;
        min-width: 0;
        padding: 24px 20px;
    }
}

/* ── Progress bar at bottom of form panel ── */
.msfw-progress-bottom {
    margin-top: auto;
    margin-bottom: 0;
    border-radius: 0;
}

/* ── Required choice grid shake animation ── */
@keyframes msfw-shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}
.msfw-grid.msfw-grid-error {
    animation: msfw-shake 0.5s ease;
    outline: 2px solid #ef4444;
    border-radius: 8px;
}
