/* Нүүр хуудасны hero-ийн урсгалын анимаци (js/flow-demo.js).
   600px өргөнөөр зохиосон, жижиг дэлгэцэнд JS --fd-k коэффициентээр пропорциор нь багасгана.
   Бүх класс fd- угтвартай — сайтын .btn гэх мэт ерөнхий нэртэй мөргөлдөхгүй. */

.fd-fit {
    position: relative;
    width: 100%;
    height: calc(395px * var(--fd-k, 1)); /* JS бодит өндрөөр дарна */
}

.fd {
    --fd-success: var(--success, #15803D);
    --fd-success-soft: var(--success-soft, #F0FDF4);
    --fd-grad: linear-gradient(135deg, #FF0099, #FF2200, #FF9900);
    position: absolute;
    top: 0;
    left: 0;
    width: 600px;
    transform: scale(var(--fd-k, 1));
    transform-origin: top left;
    font: 400 13px/1.35 var(--font-body, Inter, system-ui, sans-serif);
    color: #1a1a1a;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #ececf0;
    overflow: hidden;
    box-shadow: 0 30px 60px -30px rgba(200, 0, 120, .28), 0 12px 24px -12px rgba(26, 26, 26, .12);
}

.fd button {
    font: inherit;
}

/* timeline */
.fd-tl {
    position: relative;
    display: flex;
    justify-content: space-between;
    padding: 16px 22px 12px;
    border-bottom: 1px solid #f0f0f3;
}

.fd-tl::before {
    content: '';
    position: absolute;
    left: 52px;
    right: 52px;
    top: 25px;
    height: 2px;
    background: #ececf0;
}

.fd-tl-fill {
    position: absolute;
    left: 52px;
    top: 25px;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, #FF0099, #FF2200, #FF9900);
    transition: width .6s ease;
}

.fd-step {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 62px;
    padding: 0;
    border: 0;
    background: none;
    font-size: 11px !important;
    color: #9a9aa2;
    text-align: center;
    cursor: pointer;
    border-radius: 8px;
}

.fd-step:focus-visible {
    outline: 2px solid var(--focus, #6A45F5);
    outline-offset: 2px;
}

.fd-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #ececf0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #9a9aa2;
    transition: all .3s;
}

.fd-step:hover .fd-dot {
    border-color: #FF9900;
}

.fd-step.is-on {
    color: #1a1a1a;
    font-weight: 600;
}

.fd-step.is-on .fd-dot {
    border-color: #FF2200;
    color: #FF2200;
    box-shadow: 0 0 0 4px rgba(255, 34, 0, .12);
}

.fd-step.is-done .fd-dot {
    background: var(--fd-grad);
    border-color: transparent;
    color: #fff;
}

.fd-step.is-done {
    color: #6b6b6b;
}

/* апп */
.fd-app {
    position: relative;
    height: 340px;
    background: #fafafc;
}

.fd-bar {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
    padding: 9px 10px;
    background: #fff;
    border-bottom: 1px solid #f0f0f3;
}

.fd-btn {
    font: 600 10.5px var(--font-body, Inter, sans-serif) !important;
    padding: 6px 7px;
    border-radius: 7px;
    border: 1px solid #e2e2e8;
    background: #fff;
    color: #1a1a1a;
    white-space: nowrap;
    transition: transform .1s, opacity .3s;
}

.fd-btn.is-primary {
    border-color: transparent;
    color: #fff;
    background: var(--fd-grad);
}

.fd-btn.is-press {
    transform: scale(.93);
}

.fd-tbl {
    padding: 10px 12px;
}

.fd-hdr,
.fd-ln {
    display: grid;
    grid-template-columns: 1fr 34px 1fr;
    align-items: center;
}

.fd-hdr {
    font-size: 11px;
    color: #6b6b6b;
    font-weight: 600;
    margin-bottom: 6px;
}

.fd-ln {
    margin-bottom: 7px;
}

.fd-cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    padding: 7px 9px;
    border: 1px solid #ececf0;
    border-radius: 8px;
    background: #fff;
    opacity: 0;
    transform: translateY(6px);
    transition: all .35s;
}

.fd-cell.is-in {
    opacity: 1;
    transform: none;
}

.fd-ln.is-ok .fd-cell {
    border-color: #86d3a3;
    background: var(--fd-success-soft);
}

.fd-cell b {
    font-weight: 600;
    white-space: nowrap;
}

.fd-tag {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #EFEAFF;
    color: #6A45F5;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    transition: all .35s;
    white-space: nowrap;
}

.fd-ln.is-ok .fd-tag {
    max-width: 140px;
    opacity: 1;
}

/* гинж */
.fd-chain {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fd-chain::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    background: var(--fd-success);
    transform: scaleX(0);
    transition: transform .35s;
}

.fd-ln.is-ok .fd-chain::before {
    transform: scaleX(1);
}

.fd-chain svg {
    position: relative;
    width: 22px;
    height: 22px;
    background: #fafafc;
    border-radius: 50%;
    padding: 2px;
    opacity: 0;
    transition: opacity .25s, transform .35s;
}

.fd-ln.is-both .fd-chain svg {
    opacity: 1;
}

.fd-chain .fd-broken {
    color: #c4c4c8;
}

.fd-chain .fd-linked {
    display: none;
    color: var(--fd-success);
}

.fd-ln.is-ok .fd-broken {
    display: none;
}

.fd-ln.is-ok .fd-linked {
    display: block;
    transform: scale(1.15);
}

/* тайлан */
.fd-ov {
    position: absolute;
    inset: 0;
    background: #fafafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 26px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .4s;
    z-index: 4;
}

.fd-ov.is-in {
    opacity: 1;
}

.fd-covers {
    position: relative;
    width: 200px;
    height: 230px;
}

.fd-cover {
    position: absolute;
    width: 150px;
    height: 200px;
    background: #fff;
    border: 1px solid #e2e2e8;
    border-radius: 6px;
    box-shadow: 0 14px 30px -14px rgba(26, 26, 26, .3);
    padding: 14px 12px;
    transform: translateY(14px) scale(.96);
    transition: transform .45s;
}

.fd-ov.is-in .fd-tax {
    transform: rotate(-4deg);
}

.fd-ov.is-in .fd-bal {
    transform: translate(44px, 26px) rotate(3deg);
}

.fd-cover i.fd-mark {
    display: block;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--fd-grad);
}

.fd-cover h6 {
    margin: 14px 0 2px;
    font: 700 13px/1.2 var(--font-display, Onest, sans-serif);
}

.fd-meta {
    font-size: 10px;
    color: #6b6b6b;
    line-height: 1.5;
}

.fd-lines {
    margin-top: 12px;
}

.fd-lines i {
    display: block;
    height: 6px;
    border-radius: 3px;
    background: #f0f0f3;
    margin-bottom: 6px;
}

.fd-note {
    position: absolute;
    inset: 40px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    opacity: 0;
    transform: scale(.9);
    transition: all .4s;
}

.fd-note span {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--fd-success);
    color: #fff;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fd-note b {
    font: 700 15px var(--font-display, Onest, sans-serif);
}

.fd-note small {
    color: #6b6b6b;
    font-size: 11px;
}

.fd-ov.is-sent .fd-note {
    opacity: 1;
    transform: none;
}

.fd-ov.is-sent .fd-send {
    opacity: 0;
}

.fd-dest {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.fd-tgt {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 200px;
    min-height: 62px;
    padding: 8px 12px;
    border: 1.5px dashed #d6d6de;
    border-radius: 12px;
    background: #fff;
    transition: all .3s;
}

.fd-tgt b {
    display: block;
    font: 700 13px var(--font-display, Onest, sans-serif);
}

.fd-tgt small {
    color: #6b6b6b;
    font-size: 10px;
}

.fd-tgt img {
    flex-shrink: 0;
}

.fd-tgt .fd-chk {
    position: absolute;
    right: 10px;
    top: 50%;
    margin-top: -11px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--fd-success);
    color: #fff;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0);
    transition: transform .3s cubic-bezier(.3, 1.6, .6, 1);
}

.fd-tgt.is-ok {
    border: 1.5px solid var(--fd-success);
    background: var(--fd-success-soft);
}

.fd-tgt.is-ok .fd-chk {
    transform: scale(1);
}

.fd-tgt.is-hit {
    transform: scale(1.07);
    box-shadow: 0 0 0 6px rgba(21, 128, 61, .16);
}

/* заагч */
.fd-cursor {
    position: absolute;
    left: 0;
    top: 0;
    width: 22px;
    height: 22px;
    z-index: 9;
    pointer-events: none;
    transition: transform .7s cubic-bezier(.45, .05, .25, 1);
}

.fd-cursor svg {
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25));
}

.fd-rip {
    position: absolute;
    z-index: 8;
    width: 26px;
    height: 26px;
    margin: -13px 0 0 -13px;
    border-radius: 50%;
    border: 2px solid #FF2200;
    opacity: 0;
    pointer-events: none;
}

.fd-rip.is-go {
    animation: fd-rip .5s ease-out;
}

@keyframes fd-rip {
    from { opacity: .8; transform: scale(.4); }
    to { opacity: 0; transform: scale(1.6); }
}

/* бүртгэл */
.fd-sig {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafc;
    transition: opacity .4s;
    z-index: 5;
}

.fd-sig.is-hide {
    opacity: 0;
    pointer-events: none;
}

.fd-form {
    width: 250px;
    background: #fff;
    border: 1px solid #ececf0;
    border-radius: 12px;
    padding: 16px;
}

.fd-form h5 {
    margin: 0 0 10px;
    font: 700 15px var(--font-display, Onest, sans-serif);
}

.fd-fld {
    border: 1px solid #e2e2e8;
    border-radius: 7px;
    padding: 7px 9px;
    margin-bottom: 8px;
    min-height: 30px;
    font-size: 12px;
    color: #b5b5bd;
}

.fd-fld.is-typed {
    color: #1a1a1a;
}

/* Регистрээр автоматаар бөглөгдсөн нэр */
.fd-fld.is-auto {
    border-color: #86d3a3;
    background: var(--fd-success-soft);
    animation: fd-auto .5s ease-out;
}

@keyframes fd-auto {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

.fd-caret::after {
    content: '|';
    animation: fd-blink 1s steps(1) infinite;
    color: #FF2200;
}

@keyframes fd-blink {
    50% { opacity: 0; }
}

.fd-form .fd-btn {
    width: 100%;
    padding: 8px;
}

@media (prefers-reduced-motion: reduce) {
    .fd *,
    .fd *::before {
        transition: none !important;
        animation: none !important;
    }
}
