/* =========================================
   Start Project — flow hero section
========================================= */
.sp-hero {
    position: relative;
    overflow: hidden;
    padding: 140px 0 120px;
}

.sp-inner {
    position: relative;
    z-index: 5;
}

/* Decorative floating orbs — desktop only, see mobile override at bottom (no blur on mobile) */
.sp-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
    transition: transform 0.3s ease-out;
}

.sp-orb-1 {
    width: 420px;
    height: 420px;
    top: -120px;
    right: -80px;
    background: radial-gradient(circle, var(--color-copper) 0%, transparent 70%);
}

.sp-orb-2 {
    width: 360px;
    height: 360px;
    bottom: -100px;
    left: -60px;
    background: radial-gradient(circle, var(--color-gold) 0%, transparent 70%);
    opacity: 0.25;
}

.sp-grid-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 46px 46px;
    -webkit-mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 75%);
}

/* --- Head --- */
.sp-head {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.sp-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: bold;
    color: var(--accent-secondary);
    background: rgba(245, 214, 143, 0.1);
    border: 1px solid rgba(245, 214, 143, 0.25);
    padding: 6px 18px;
    border-radius: var(--pill-radius);
}

.sp-title {
    font-size: 44px;
    margin: 0;
}

.sp-subtitle {
    margin: 0;
    font-size: 16px;
}

/* --- Progress stepper --- */
.sp-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 560px;
    margin: 0 auto 60px;
}

.sp-progress-step {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sp-progress-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-family: 'gofteh', sans-serif;
    font-size: 14px;
    transition: all var(--transition-fast);
}

.sp-progress-label {
    font-size: 13px;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
    white-space: nowrap;
}

.sp-progress-step.is-active .sp-progress-num {
    border-color: var(--accent-secondary);
    background: var(--accent-secondary);
    color: var(--color-navy);
}

.sp-progress-step.is-active .sp-progress-label {
    color: var(--text-primary);
    font-weight: bold;
}

.sp-progress-step.is-done .sp-progress-num {
    border-color: var(--accent-primary);
    background: transparent;
    color: var(--accent-primary);
}

.sp-progress-line {
    width: 60px;
    height: 1px;
    background: var(--border-color);
}

.sp-progress-step.is-clickable {
    cursor: pointer;
    border-radius: var(--pill-radius);
    transition: background var(--transition-fast);
}

.sp-progress-step.is-clickable:hover {
    background: rgba(245, 214, 143, 0.08);
}

.sp-progress-step.is-clickable:focus-visible {
    outline: 2px solid var(--accent-secondary);
    outline-offset: 3px;
}

/* --- Step transition animation --- */
.sp-step-anim {
    animation: spStepIn 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes spStepIn {
    from {
        opacity: 0;
        transform: translateY(26px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- Step 1: service choice cards --- */
.sp-choice-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1160px;
    margin: 0 auto;
}

.sp-choice-card {
    position: relative;
    perspective: 1000px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: right;
    font-family: inherit;
}

.sp-choice-card-inner {
    position: relative;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    padding: 40px 32px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    min-height: 260px;
    transform-style: preserve-3d;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), border-color var(--transition-fast), background var(--transition-fast);
    will-change: transform;
}

.sp-choice-card:hover .sp-choice-card-inner,
.sp-choice-card:focus-visible .sp-choice-card-inner {
    border-color: var(--accent-secondary);
    background: rgba(255, 255, 255, 0.07);
}

.sp-choice-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: rgba(245, 214, 143, 0.12);
    color: var(--accent-secondary);
    font-size: 22px;
    transform: translateZ(30px);
}

.sp-choice-title {
    margin: 0;
    font-size: 24px;
    transform: translateZ(20px);
}

.sp-choice-desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.8;
    transform: translateZ(15px);
}

.sp-choice-arrow {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    transform: translateZ(25px);
}

.sp-choice-card:hover .sp-choice-arrow {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    color: var(--color-navy);
    transform: translateZ(25px) translateX(-4px);
}

/* --- Step 2: forms --- */
.sp-form-stage {
    perspective: 1200px;
    display: flex;
    justify-content: center;
}

.sp-form-3d-wrapper {
    width: 100%;
    max-width: 720px;
    transform-style: preserve-3d;
}

.sp-glass-form {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 44px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
}

.sp-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 0;
    margin-bottom: 24px;
    color: var(--text-secondary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.sp-back-btn:hover {
    color: var(--accent-secondary);
}

.sp-form-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.sp-form-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(245, 214, 143, 0.12);
    color: var(--accent-secondary);
    font-size: 18px;
    flex-shrink: 0;
}

.sp-form-title {
    margin: 0;
    font-size: 22px;
}

.sp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

.sp-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sp-col-full {
    grid-column: 1 / -1;
}

.sp-field label {
    font-size: 13px;
    color: var(--text-secondary);
}

.sp-req {
    color: var(--accent-primary);
}

.sp-field input,
.sp-field select,
.sp-field textarea {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 14px;
    font-family: inherit;
    transition: all var(--transition-fast);
    outline: none;
    box-sizing: border-box;
}

.sp-field textarea {
    resize: vertical;
    min-height: 90px;
}

.sp-field select option {
    background: var(--color-navy);
    color: #fff;
}

.sp-field input:focus,
.sp-field select:focus,
.sp-field textarea:focus {
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 4px rgba(245, 214, 143, 0.12);
}

.sp-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
}

/* --- wptech sub-choice (bigger boxed radios, shown before the rest of the form) --- */
.sp-wptech-subchoice {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}

.sp-choice-boxed {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 18px 14px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.sp-choice-boxed:has(input:checked) {
    border-color: var(--accent-secondary);
    background: rgba(245, 214, 143, 0.08);
}

.sp-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin: -4px 0 0;
    line-height: 1.8;
}

/* --- File upload --- */
.sp-file-input {
    padding: 10px 14px !important;
}

.sp-file-input::file-selector-button {
    margin-inline-end: 12px;
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    background: var(--accent-primary);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}

.sp-choice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    /* A sane flex-basis is what makes flex-wrap actually wrap to a new line when
       there isn't room — WITHOUT it (or with min-width:0 on the label text) the
       browser instead shrinks the item down arbitrarily, wrapping the Persian text
       one character per line. Never remove this basis without re-testing at narrow
       widths with 3 choices on one row. */
    flex: 1 1 200px;
    max-width: 100%;
}

.sp-choice input {
    flex-shrink: 0;
    margin-top: 3px;
    accent-color: var(--accent-secondary);
}

.sp-submit-wrapper {
    display: block;
    width: 100%;
}

.sp-submit-btn {
    width: 100%;
}

/* dm-forms shortcode skin ([dm_form id="4"], SEO panel) — matches the .sp-glass-form
   look (dark, translucent inputs) + the global .btn-shine CTA. !important required:
   the plugin's own dmf-form.css ties on specificity with these selectors and its
   enqueue order isn't guaranteed to lose (same pattern as front-page/contact-us/about-us
   skins — see project memory for the reuse pattern). ⚠ Future conditional-field logic
   (per user request) will need the ACTUAL name/id attributes dm-forms assigns to each
   field once form id 4 is built in wp-admin — these aren't knowable from the theme side
   until then. */
.sp-dmf-wrap .dmf-form {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
}

.sp-dmf-wrap .dmf-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
}

.sp-dmf-wrap .dmf-field-wrap {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

.sp-dmf-wrap .dmf-col-full {
    grid-column: 1 / -1 !important;
}

.sp-dmf-wrap .dmf-field-wrap label {
    font-size: 13px !important;
    color: var(--text-secondary) !important;
    font-weight: normal !important;
    margin: 0 !important;
}

.sp-dmf-wrap .dmf-req {
    color: var(--accent-primary) !important;
}

/* ⚠ MUST exclude radio/checkbox: a bare `.dmf-field-wrap input` also matches the radio
   inputs dm-forms renders inside .dmf-choices, and width:100%+padding+border turns each
   radio dot into a full-width bordered box (shipped bug, fixed here). */
.sp-dmf-wrap .dmf-field-wrap input:not([type="radio"]):not([type="checkbox"]),
.sp-dmf-wrap .dmf-field-wrap select,
.sp-dmf-wrap .dmf-field-wrap textarea {
    width: 100% !important;
    background-color: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    padding: 14px 18px !important;
    border-radius: 14px !important;
    font-size: 14px !important;
    font-family: inherit !important;
    transition: all var(--transition-fast) !important;
    outline: none !important;
    box-sizing: border-box !important;
}

.sp-dmf-wrap .dmf-field-wrap textarea {
    resize: vertical !important;
    min-height: 90px !important;
}

.sp-dmf-wrap .dmf-field-wrap select option {
    background: var(--color-navy) !important;
    color: #fff !important;
}

.sp-dmf-wrap .dmf-field-wrap input:not([type="radio"]):not([type="checkbox"]):focus,
.sp-dmf-wrap .dmf-field-wrap select:focus,
.sp-dmf-wrap .dmf-field-wrap textarea:focus {
    border-color: var(--accent-secondary) !important;
    box-shadow: 0 0 0 4px rgba(245, 214, 143, 0.12) !important;
}

/* Radio/checkbox options rendered as clean boxed pills.
   ⚠ GRID, not flex-wrap: dm-forms puts the option text as a BARE TEXT NODE inside the
   label (`<label><input> بله</label>`, no <span>), which in a flex row becomes an
   anonymous flex item with no min-width protection — it shrinks to near-zero and wraps
   the Persian text one character per line (shipped bug). Grid tracks have a definite
   width, so that can't happen. */
.sp-dmf-wrap .dmf-choices {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
    gap: 10px !important;
}

.sp-dmf-wrap .dmf-choice {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 12px 16px !important;
    box-sizing: border-box !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    font-weight: normal !important;
    font-size: 14px !important;
    line-height: 1.7 !important;
    color: var(--text-primary) !important;
    cursor: pointer !important;
    transition: border-color var(--transition-fast), background var(--transition-fast) !important;
}

.sp-dmf-wrap .dmf-choice:hover {
    border-color: rgba(245, 214, 143, 0.45) !important;
}

.sp-dmf-wrap .dmf-choice:has(input:checked) {
    border-color: var(--accent-secondary) !important;
    background: rgba(245, 214, 143, 0.08) !important;
}

.sp-dmf-wrap .dmf-choice input[type="radio"],
.sp-dmf-wrap .dmf-choice input[type="checkbox"] {
    flex: 0 0 auto !important;
    width: 17px !important;
    height: 17px !important;
    margin: 0 !important;
    padding: 0 !important;
    accent-color: var(--accent-secondary) !important;
    cursor: pointer !important;
}

.sp-dmf-wrap .dmf-form-msg {
    border-radius: 12px !important;
    padding: 12px 16px !important;
    margin-bottom: 0 !important;
    font-size: 14px !important;
}

.sp-dmf-wrap .dmf-form-msg.dmf-ok {
    background: rgba(46, 160, 67, 0.12) !important;
    border: 1px solid rgba(46, 160, 67, 0.4) !important;
    color: var(--text-primary) !important;
}

.sp-dmf-wrap .dmf-form-msg.dmf-err {
    background: rgba(214, 54, 56, 0.1) !important;
    border: 1px solid rgba(214, 54, 56, 0.4) !important;
    color: #d63638 !important;
}

.sp-dmf-wrap .dmf-hp {
    display: none !important;
}

.sp-dmf-wrap .dmf-actions {
    margin-top: 4px !important;
}

.sp-dmf-wrap .dmf-submit {
    position: relative !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 15px !important;
    outline: none !important;
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    cursor: pointer !important;
    background-color: transparent !important;
    border: 1px solid var(--accent-primary) !important;
    border-radius: var(--pill-radius) !important;
    color: var(--text-primary) !important;
    font-size: 15px !important;
    font-weight: bold !important;
    font-family: inherit !important;
    letter-spacing: 0.5px !important;
    z-index: 1 !important;
    overflow: hidden !important;
    transition: all 0.3s cubic-bezier(0.02, 0.01, 0.47, 1) !important;
}

.sp-dmf-wrap .dmf-submit:after {
    background: var(--accent-secondary) !important;
    content: "" !important;
    height: 155px !important;
    right: -75px !important;
    opacity: 0.3 !important;
    position: absolute !important;
    top: -50px !important;
    transform: rotate(35deg) !important;
    transition: all 550ms cubic-bezier(0.19, 1, 0.22, 1) !important;
    width: 50px !important;
    z-index: 0 !important;
}

.sp-dmf-wrap .dmf-submit:hover:not(:disabled) {
    animation: rotate624 0.7s ease-in-out both;
    border-color: var(--accent-secondary) !important;
    color: var(--accent-secondary) !important;
}

.sp-dmf-wrap .dmf-submit:hover:not(:disabled):after {
    right: 120% !important;
    transition: all 550ms cubic-bezier(0.19, 1, 0.22, 1) !important;
}

.sp-dmf-wrap .dmf-submit:disabled,
.sp-dmf-wrap .dmf-submit.dmf-loading {
    opacity: 0.55 !important;
    cursor: not-allowed !important;
}

/* ⚠ REQUIRED for the conditional logic to work at all: the skin above sets
   `display:flex !important` on .dmf-field-wrap, which out-specifies the plain `hidden`
   ATTRIBUTE (0-1-0) — a JS-hidden field would stay fully visible with no error anywhere.
   This global override inside the wrapper is what makes `el.hidden = true` effective. */
.sp-dmf-wrap [hidden] {
    display: none !important;
}

/* --- Conditional blocks injected/relocated by start-project.js --- */
.sp-cond-notice {
    grid-column: 1 / -1;
    background: rgba(245, 214, 143, 0.08);
    border: 1px solid rgba(245, 214, 143, 0.3);
    border-radius: 16px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sp-cond-notice p {
    margin: 0;
    font-size: 14px;
    line-height: 1.9;
    color: var(--text-primary);
}

.sp-cond-btn {
    align-self: flex-start;
    background: var(--accent-secondary);
    color: var(--color-navy);
    border: none;
    padding: 10px 20px;
    border-radius: var(--pill-radius);
    font-family: inherit;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
}

.sp-cond-copy {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px 18px;
}

.sp-cond-copy > label {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.sp-copy-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.sp-copy-row input {
    flex: 1;
    min-width: 0;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    direction: ltr;
    text-align: left;
    box-sizing: border-box;
}

.sp-copy-btn {
    flex-shrink: 0;
    background: var(--accent-primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0 20px;
    font-family: inherit;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.sp-copy-btn.is-copied {
    background: #2ea043;
}

@media (max-width: 768px) {
    .sp-dmf-wrap .dmf-grid {
        grid-template-columns: 1fr !important;
    }

    .sp-dmf-wrap .dmf-choices {
        grid-template-columns: 1fr !important;
    }
}

/* --- Step 3: done --- */
.sp-step-done {
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 40px 0;
}

.sp-done-icon {
    font-size: 56px;
    color: var(--accent-secondary);
    margin-bottom: 6px;
}

.sp-done-title {
    margin: 0;
    font-size: 26px;
}

.sp-done-desc {
    margin: 0;
}

.sp-done-link {
    margin-top: 10px;
    font-weight: bold;
    color: var(--accent-secondary);
    text-decoration: underline;
}

/* =========================================
   Responsive
========================================= */
@media (max-width: 992px) {
    .sp-hero {
        padding: 90px 0 70px;
    }

    .sp-title {
        font-size: 30px;
    }

    .sp-head {
        margin-bottom: 40px;
    }

    .sp-progress {
        margin-bottom: 40px;
    }

    .sp-progress-line {
        width: 30px;
    }

    .sp-progress-label {
        display: none;
    }

    .sp-choice-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .sp-choice-card-inner {
        min-height: auto;
        padding: 28px 24px;
    }

    .sp-glass-form {
        padding: 28px 20px;
        border-radius: 22px;
    }

    .sp-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .sp-wptech-subchoice {
        grid-template-columns: 1fr;
    }

    /* No blur on mobile: swap glass/backdrop-blur surfaces for a plain solid panel
       instead of hiding content behind an unreliable blurred layer. */
    .sp-choice-card-inner,
    .sp-glass-form {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--bg-secondary);
    }

    /* The actual cause of blurry TEXT on mobile isn't backdrop-filter at all — it's
       transform-style:preserve-3d/perspective forcing these elements onto their own
       GPU-rasterized layer, which mobile Safari/Chrome commonly render with soft/blurred
       text even with zero rotation applied. The tilt effect is desktop-only anyway
       (gated in JS), so drop the 3D context entirely on mobile. */
    .sp-choice-card {
        perspective: none;
    }

    .sp-choice-card-inner {
        transform-style: flat;
        will-change: auto;
    }

    .sp-form-stage {
        perspective: none;
    }

    .sp-form-3d-wrapper {
        transform-style: flat;
    }

    /* Decorative blurred orbs are pure background noise on mobile — drop them entirely
       rather than risk a blur filter smudging content on lower-powered GPUs. */
    .sp-orb {
        display: none;
    }

    /* --- Budget/timeline radio choices: stack as full-width rows instead of a cramped
       multi-column wrap where the radio dot overlapped wrapped label text. --- */
    .sp-choices {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 10px;
    }

    .sp-choice {
        /* flex-basis applies to the main axis, which is now vertical (column) — the
           desktop "1 1 200px" basis would otherwise force each row 200px TALL. */
        flex: 0 1 auto;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 12px 14px;
        border: 1px solid var(--border-color);
        border-radius: 12px;
        transition: border-color var(--transition-fast), background var(--transition-fast);
    }

    .sp-choice:has(input:checked) {
        border-color: var(--accent-secondary);
        background: rgba(245, 214, 143, 0.08);
    }
}
