/* Customer Form Pro - Public Styles */
:root {
    --cfp-primary:      #6366f1;
    --cfp-primary-rgb:  99, 102, 241;
    --cfp-text-color:   #1e293b;
    --cfp-label-color:  #475569;
    --cfp-input-bg:     #f8fafc;
    --cfp-border-color: #e2e8f0;
    --cfp-form-bg:      #ffffff;
    --cfp-radius:       12px;
    --cfp-font:         Tahoma, 'Segoe UI', sans-serif;
    --cfp-transition:   all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Base ──────────────────────────────────────────────────────── */
.cfp-wrapper {
    direction: rtl;
    font-family: var(--cfp-font);
    color: var(--cfp-text-color);
}
.cfp-wrapper *, .cfp-wrapper *::before, .cfp-wrapper *::after {
    box-sizing: border-box;
}

/* ── Trigger Button ────────────────────────────────────────────── */
.cfp-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--cfp-radius);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--cfp-transition);
    font-family: var(--cfp-font);
    border: none;
    letter-spacing: 0.01em;
}
.cfp-open-btn:hover { transform: translateY(-2px); }

/* ── Button Style Variants ─────────────────────────────────────── */
.cfp-btn-glass {
    background: rgba(var(--cfp-primary-rgb), 0.12);
    color: var(--cfp-primary);
    border: 1px solid rgba(var(--cfp-primary-rgb), 0.3) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(var(--cfp-primary-rgb), 0.15), inset 0 1px 0 rgba(255,255,255,0.5);
}
.cfp-btn-glass:hover {
    background: rgba(var(--cfp-primary-rgb), 0.2);
    box-shadow: 0 6px 20px rgba(var(--cfp-primary-rgb), 0.25);
}
.cfp-btn-solid {
    background: var(--cfp-primary);
    color: #fff;
    border: 2px solid var(--cfp-primary) !important;
    box-shadow: 0 4px 14px rgba(var(--cfp-primary-rgb), 0.35);
}
.cfp-btn-solid:hover { filter: brightness(1.08); box-shadow: 0 6px 20px rgba(var(--cfp-primary-rgb), 0.45); }
.cfp-btn-outline {
    background: transparent;
    color: var(--cfp-primary);
    border: 2px solid var(--cfp-primary) !important;
}
.cfp-btn-outline:hover { background: rgba(var(--cfp-primary-rgb), 0.06); }
.cfp-btn-ghost {
    background: transparent;
    color: var(--cfp-primary);
    border: 2px solid transparent !important;
    text-decoration: underline;
    text-underline-offset: 4px;
}
.cfp-btn-ghost:hover { background: rgba(var(--cfp-primary-rgb), 0.06); }

/* ── Modal Overlay ─────────────────────────────────────────────── */
.cfp-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    animation: cfpFadeIn 0.2s ease;
}
.cfp-overlay[hidden] { display: none !important; }
@keyframes cfpFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Modal Box ─────────────────────────────────────────────────── */
.cfp-modal {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 20px;
    padding: 36px 32px;
    animation: cfpSlideUp 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
}
@keyframes cfpSlideUp {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Modal style variants */
[data-style="glass"] .cfp-modal {
    background: rgba(255,255,255,0.22) !important;
    backdrop-filter: blur(32px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.5) !important;
    box-shadow: 0 24px 80px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.7) !important;
    color: #0f172a;
}
[data-style="minimal"] .cfp-modal {
    background: var(--cfp-form-bg) !important;
    border: 1.5px solid var(--cfp-border-color) !important;
    box-shadow: 0 4px 10px rgba(15,23,42,0.06), 0 24px 60px rgba(15,23,42,0.16) !important;
    color: var(--cfp-text-color);
}
[data-style="elevated"] .cfp-modal {
    background: var(--cfp-form-bg) !important;
    border: none !important;
    border-radius: 22px !important;
    box-shadow: 0 30px 70px rgba(15,23,42,0.28), 0 10px 24px rgba(15,23,42,0.14) !important;
    color: var(--cfp-text-color);
}
[data-style="bordered"] .cfp-modal {
    background: var(--cfp-form-bg) !important;
    border: 2.5px solid var(--cfp-primary) !important;
    border-radius: 14px !important;
    box-shadow: 0 16px 50px rgba(0,0,0,0.14) !important;
    color: var(--cfp-text-color);
}
[data-style="flat"] .cfp-modal {
    background: var(--cfp-form-bg) !important;
    border: none !important;
    box-shadow: 0 18px 50px rgba(0,0,0,0.12) !important;
    color: var(--cfp-text-color);
}
[data-style="gradient"] .cfp-modal {
    background:
        linear-gradient(var(--cfp-form-bg), var(--cfp-form-bg)) padding-box,
        linear-gradient(135deg, var(--cfp-primary), rgba(var(--cfp-primary-rgb), 0.35)) border-box !important;
    border: 2.5px solid transparent !important;
    border-radius: 22px !important;
    box-shadow: 0 20px 60px rgba(15,23,42,0.18) !important;
    color: var(--cfp-text-color);
}

/* Close Button */
.cfp-close-btn {
    position: absolute;
    top: 14px; left: 14px;
    width: 30px; height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(100,116,139,0.12);
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--cfp-transition);
}
.cfp-close-btn:hover { background: rgba(100,116,139,0.22); transform: rotate(90deg); }

/* ── Inline Mode ───────────────────────────────────────────────── */
.cfp-inline {
    width: 100%;
    margin: 8px 0;
    background: var(--cfp-form-bg) !important;
    border: 1.5px solid var(--cfp-border-color) !important;
    border-radius: 18px !important;
    padding: 36px 40px;
    box-shadow:
        0 4px 10px rgba(15,23,42,0.05),
        0 20px 50px rgba(15,23,42,0.12) !important;
    color: var(--cfp-text-color);
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

@media (max-width: 600px) {
    .cfp-inline { padding: 24px 18px; }
}

/* ── Inline Style Variants ──────────────────────────────────────
   These rules give the whole form its own visually separated
   "card" that stands out from the website's background.
   !important is used here on purpose: many themes/page-builders
   apply their own generic background/border resets to wrapper
   divs, which would otherwise silently override these styles and
   make the form blend into the page instead of standing apart.
   Options: glass | minimal | elevated | bordered | flat | gradient
─────────────────────────────────────────────────────────────────*/

/* Glass — frosted, translucent panel */
[data-style="glass"].cfp-inline {
    background: rgba(255,255,255,0.18) !important;
    backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.45) !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.6) !important;
}
[data-style="glass"].cfp-inline .cfp-input {
    background: rgba(255,255,255,0.45);
    border: 1px solid rgba(255,255,255,0.65);
    color: #0f172a;
}
[data-style="glass"].cfp-inline .cfp-input::placeholder { color: rgba(15,23,42,0.38); }
[data-style="glass"].cfp-inline .cfp-input:focus {
    background: rgba(255,255,255,0.7);
    border-color: var(--cfp-primary);
    box-shadow: 0 0 0 3px rgba(var(--cfp-primary-rgb), 0.18);
}

/* Minimal (default) — clean card, clearly lifted off the page background
   with a visible border + soft shadow. This is the "separated but
   understated" look. */
[data-style="minimal"].cfp-inline {
    background: var(--cfp-form-bg) !important;
    border: 1.5px solid var(--cfp-border-color) !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 10px rgba(15,23,42,0.06), 0 24px 48px rgba(15,23,42,0.13) !important;
}

/* Elevated — floating card with a generous shadow, no border at all */
[data-style="elevated"].cfp-inline {
    background: var(--cfp-form-bg) !important;
    border: none !important;
    border-radius: 22px !important;
    box-shadow: 0 28px 64px rgba(15,23,42,0.2), 0 8px 20px rgba(15,23,42,0.1) !important;
}

/* Bordered — flat background, crisp accent-colored frame, no shadow */
[data-style="bordered"].cfp-inline {
    background: var(--cfp-form-bg) !important;
    border: 2.5px solid var(--cfp-primary) !important;
    border-radius: 14px !important;
    box-shadow: none !important;
}

/* Flat — no card at all, blends directly into the page/site background */
[data-style="flat"].cfp-inline {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0;
}

/* Gradient — soft card wrapped in a colorful gradient ring */
[data-style="gradient"].cfp-inline {
    background:
        linear-gradient(var(--cfp-form-bg), var(--cfp-form-bg)) padding-box,
        linear-gradient(135deg, var(--cfp-primary), rgba(var(--cfp-primary-rgb), 0.35)) border-box !important;
    border: 2.5px solid transparent !important;
    border-radius: 22px !important;
    box-shadow: 0 18px 48px rgba(15,23,42,0.15) !important;
}

/* ── Title ─────────────────────────────────────────────────────── */
.cfp-title {
    margin: 0 0 28px;
    font-size: 20px;
    font-weight: 700;
    color: var(--cfp-text-color);
    text-align: center;
    letter-spacing: -0.01em;
}
.cfp-inline-title {
    text-align: right;
    font-size: 18px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--cfp-border-color);
}
[data-style="glass"] .cfp-title,
[data-style="glass"] .cfp-inline-title {
    color: #0f172a;
}

/* ── Fields ─────────────────────────────────────────────────────── */
.cfp-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* Two-column grid for text-type fields in inline mode on wider screens */
@media (min-width: 600px) {
    .cfp-inline .cfp-fields {
        grid-template-columns: 1fr 1fr;
    }
    .cfp-inline .cfp-field-type-textarea,
    .cfp-inline .cfp-field-type-select {
        grid-column: 1 / -1;
    }
}

.cfp-field-wrap { display: flex; flex-direction: column; gap: 5px; }

.cfp-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--cfp-label-color);
    display: flex;
    align-items: center;
    gap: 3px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
[data-style="glass"] .cfp-label { color: rgba(15,23,42,0.6); }

.cfp-required { color: #ef4444; font-size: 14px; }

/* Input base */
.cfp-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 9px;
    font-size: 14px;
    font-family: var(--cfp-font);
    transition: var(--cfp-transition);
    outline: none;
    direction: rtl;
    background: var(--cfp-input-bg);
    border: 1.5px solid var(--cfp-border-color);
    color: var(--cfp-text-color);
}
.cfp-input::placeholder { color: rgba(100,116,139,0.5); }
.cfp-input:focus {
    background: #fff;
    border-color: var(--cfp-primary);
    box-shadow: 0 0 0 3px rgba(var(--cfp-primary-rgb), 0.12);
}

/* Modal-specific inputs */
[data-style="glass"] .cfp-modal .cfp-input {
    background: rgba(255,255,255,0.38);
    border: 1px solid rgba(255,255,255,0.6);
    color: #0f172a;
}
[data-style="glass"] .cfp-modal .cfp-input:focus {
    background: rgba(255,255,255,0.65);
    border-color: var(--cfp-primary);
    box-shadow: 0 0 0 3px rgba(var(--cfp-primary-rgb), 0.2);
}
[data-style="glass"] .cfp-modal .cfp-input::placeholder { color: rgba(15,23,42,0.38); }

.cfp-textarea { resize: vertical; min-height: 100px; }
.cfp-select {
    appearance: none;
    cursor: pointer;
    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='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 36px;
}

/* Checkbox */
.cfp-checkbox-wrap { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.cfp-checkbox {
    width: 17px; height: 17px;
    border-radius: 5px;
    accent-color: var(--cfp-primary);
    cursor: pointer; flex-shrink: 0;
}
.cfp-checkbox-label { font-size: 14px; cursor: pointer; color: var(--cfp-text-color); }

/* Error */
.cfp-error-msg { font-size: 11.5px; color: #ef4444; min-height: 15px; }
.cfp-field-wrap.has-error .cfp-input { border-color: #ef4444 !important; box-shadow: 0 0 0 3px rgba(239,68,68,0.1) !important; }

/* ── Submit Button ──────────────────────────────────────────────── */
.cfp-submit-btn {
    width: 100%;
    margin-top: 8px;
    padding: 13px;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--cfp-font);
    border-radius: var(--cfp-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--cfp-transition);
    border: none;
    letter-spacing: 0.01em;
}
.cfp-inline .cfp-submit-btn {
    margin-top: 20px;
    grid-column: 1 / -1;
}
.cfp-submit-btn:disabled { opacity: 0.65; cursor: not-allowed; transform: none !important; }
.cfp-submit-btn:hover:not(:disabled) { transform: translateY(-1px); }

/* ── Messages ───────────────────────────────────────────────────── */
.cfp-messages { margin-bottom: 14px; }
.cfp-msg {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
    margin-bottom: 10px;
    font-weight: 600;
}
.cfp-msg-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.cfp-msg-error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

/* ── Spinner ────────────────────────────────────────────────────── */
.cfp-spinner {
    width: 17px; height: 17px;
    animation: cfpSpin 0.75s linear infinite;
    flex-shrink: 0;
}
@keyframes cfpSpin { to { transform: rotate(360deg); } }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 560px) {
    .cfp-modal { padding: 26px 18px; border-radius: 16px; }
    .cfp-title { font-size: 17px; }
}
