.mofa-template-marketplace {
    --mofa-marketplace-bg: linear-gradient(180deg, #fbfcfe 0%, #f3f6fb 100%);
    --mofa-marketplace-border: #d6dde8;
    --mofa-marketplace-muted: #9099aa;
    --mofa-marketplace-link: #5f8dff;
    --mofa-marketplace-card-shadow: 0 24px 60px rgba(31, 41, 55, 0.1);
    background: var(--mofa-marketplace-bg);
    direction: rtl;
    min-height: 92vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px 120px;
}

.mofa-template-marketplace::before,
.mofa-template-marketplace::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.mofa-template-marketplace::before {
    display: none;
}

.mofa-template-marketplace::after {
    display: none;
}

.mofa-template-marketplace .mofa-marketplace-shell {
    width: 100%;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.mofa-template-marketplace .mofa-marketplace-card {
    position: relative;
    width: min(100%, 450px);
    background: var(--mofa-card-bg, #ffffff);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: var(--mofa-radius, 24px);
    box-shadow: var(--mofa-marketplace-card-shadow);
    padding: 22px 34px 28px;
    backdrop-filter: blur(6px);
    overflow: hidden;
    text-align: center;
}

.mofa-template-marketplace .mofa-marketplace-card__shape {
    position: absolute;
    border: 1px solid rgba(228, 233, 242, 0.85);
    border-radius: 20px;
    pointer-events: none;
}

.mofa-template-marketplace .mofa-marketplace-card__shape--a {
    inset: 18px auto auto -48px;
    width: 88px;
    height: 88px;
    transform: rotate(45deg);
    opacity: 0.35;
}

.mofa-template-marketplace .mofa-marketplace-card__shape--b {
    inset: auto -58px 24px auto;
    width: 96px;
    height: 96px;
    transform: rotate(18deg);
    opacity: 0.3;
}

.mofa-template-marketplace .mofa-marketplace-header {
    justify-content: flex-start;
    margin-bottom: 12px;
}

.mofa-template-marketplace .mofa-marketplace-back {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 4px;
    background: #ffffff;
    color: #393946;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    font-size: 24px;
    cursor: pointer;
}

.mofa-template-marketplace .mofa-marketplace-back svg {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px;
    min-height: 28px;
}

.mofa-template-marketplace .mofa-marketplace-back:hover {
    color: #393946;
    background: #ffffff;
}

.mofa-template-marketplace .mofa-marketplace-back:focus {
    box-shadow: 0 0 0 2px #66a6ff;
}

.mofa-template-marketplace .mofa-marketplace-security {
    position: relative;
    display: inline-flex;
}

.mofa-template-marketplace .mofa-marketplace-security summary {
    list-style: none;
}

.mofa-template-marketplace .mofa-marketplace-security summary::-webkit-details-marker {
    display: none;
}

.mofa-template-marketplace .mofa-marketplace-security__toggle {
    min-height: 32px;
    border: 0;
    border-radius: 8px;
    background: #8e97a6;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(82, 91, 108, 0.15);
}

.mofa-template-marketplace .mofa-marketplace-security__toggle:hover {
    background: #828c9d;
    color: #ffffff;
}

.mofa-template-marketplace .mofa-marketplace-security__label {
    line-height: 1;
}

.mofa-template-marketplace .mofa-marketplace-security__panel {
    position: absolute;
    bottom: calc(100% + 10px);
    inset-inline-end: 0;
    width: min(260px, calc(100vw - 48px));
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(214, 221, 232, 0.9);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    text-align: right;
    z-index: 4;
}

.mofa-template-marketplace .mofa-marketplace-security__title {
    color: #374151;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 8px;
}

.mofa-template-marketplace .mofa-marketplace-security__content {
    color: #6b7280;
    font-size: 12px;
    line-height: 1.9;
}

.mofa-template-marketplace .mofa-marketplace-security__content p {
    margin: 0;
}

.mofa-template-marketplace .mofa-marketplace-security__content p + p {
    margin-top: 8px;
}

.mofa-template-marketplace .mofa-marketplace-logo {
    margin: 10px 0 12px;
}

.mofa-template-marketplace .mofa-marketplace-logo img {
    max-width: 74px;
    max-height: 58px;
    object-fit: contain;
}

.mofa-template-marketplace .mofa-marketplace-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.mofa-template-marketplace .mofa-marketplace-title {
    text-align: center;
    font-size: 17px;
    font-weight: 800;
    color: #3b3f4a;
    margin-bottom: 4px;
}

.mofa-template-marketplace .mofa-marketplace-desc {
    text-align: center;
    color: #7b8496;
    font-size: 14px;
    line-height: 1.9;
    margin-bottom: 4px;
}

.mofa-template-marketplace .mofa-marketplace-field,
.mofa-template-marketplace .mofa-marketplace-stack {
    display: grid;
    gap: 12px;
}

.mofa-template-marketplace .mofa-marketplace-input-wrap {
    position: relative;
}

.mofa-template-marketplace .mofa-marketplace-input-wrap input,
.mofa-template-marketplace .mofa-marketplace-stack input,
.mofa-template-marketplace .mofa-register-name-fields input {
    width: 100%;
    min-height: 58px;
    border-radius: var(--mofa-input-radius, 12px);
    border: 1px solid var(--mofa-marketplace-border);
    background: #fff;
    padding: 0 18px;
    font-size: 15px;
    color: #404553;
    text-align: right;
    direction: rtl;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.mofa-template-marketplace .mofa-marketplace-input-wrap input {
    padding-inline-end: 54px;
}

.mofa-template-marketplace .mofa-marketplace-input-wrap input:focus,
.mofa-template-marketplace .mofa-marketplace-stack input:focus,
.mofa-template-marketplace .mofa-register-name-fields input:focus {
    outline: none;
    border-color: rgba(255, 174, 20, 0.75);
    box-shadow: 0 0 0 4px rgba(255, 174, 20, 0.14);
}

.mofa-template-marketplace .mofa-marketplace-input-icon {
    position: absolute;
    inset-inline-end: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa3b4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.mofa-template-marketplace .mofa-marketplace-submit {
    min-height: 60px;
    border-radius: var(--mofa-input-radius, 10px);
    font-size: 16px;
    font-weight: 800;
    box-shadow: 0 16px 24px rgba(var(--mofa-button-shadow-rgb, 255,174,20), 0.24);
}

.mofa-template-marketplace .mofa-marketplace-submit:hover {
    box-shadow: 0 20px 30px rgba(var(--mofa-button-shadow-rgb, 255,174,20), 0.28);
}

.mofa-template-marketplace .mofa-marketplace-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 13px;
}

.mofa-template-marketplace .mofa-marketplace-footer--spread {
    justify-content: space-between;
}

.mofa-template-marketplace .mofa-marketplace-link {
    color: var(--mofa-marketplace-link);
    font-weight: 700;
    text-decoration: none;
}

.mofa-template-marketplace .mofa-marketplace-link--muted {
    color: #7d8aa0;
    text-decoration: none;
    font-weight: 600;
}

.mofa-template-marketplace .mofa-marketplace-otp-row {
    display: flex;
}

.mofa-template-marketplace .mofa-marketplace-otp {
    width: 100%;
    min-height: 74px;
    border-radius: var(--mofa-input-radius, 14px);
    border: 1px solid #d2d9e4;
    background:
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent calc((100% / var(--mofa-otp-length, 5)) - 1px),
            rgba(209, 218, 232, 0.85) calc((100% / var(--mofa-otp-length, 5)) - 1px),
            rgba(209, 218, 232, 0.85) calc(100% / var(--mofa-otp-length, 5))
        );
    background-repeat: no-repeat;
    background-size: calc(100% - 36px) 58%;
    background-position: center;
    text-align: center;
    letter-spacing: 0.75em;
    text-indent: 0.75em;
    font-size: 30px;
    font-weight: 700;
    color: #4b5563;
    padding: 0 18px;
}

.mofa-template-marketplace .mofa-marketplace-otp:focus {
    outline: none;
    border-color: rgba(255, 174, 20, 0.75);
    box-shadow: 0 0 0 4px rgba(255, 174, 20, 0.14);
}

.mofa-template-marketplace .mofa-marketplace-timer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--mofa-marketplace-muted);
    font-size: 13px;
    font-weight: 700;
}

.mofa-template-marketplace .mofa-marketplace-timer .mofa-sms-login__timer-countdown,
.mofa-template-marketplace .mofa-marketplace-timer .mofa-sms-login__timer-resend {
    margin: 0;
    color: inherit;
    font: inherit;
}

.mofa-template-marketplace .mofa-sms-login__choice {
    background: #f8fafc;
    border-radius: 12px;
}

.mofa-template-marketplace .mofa-sms-login__hint,
.mofa-template-marketplace .mofa-sms-login__captcha-question,
.mofa-template-marketplace .mofa-sms-login__terms {
    color: #8b94a7;
}

.mofa-template-marketplace .mofa-sms-login__messages {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    width: min(calc(100% - 32px), 450px);
    z-index: 999999;
    pointer-events: none;
}

.mofa-template-marketplace .mofa-sms-login__messages .mofa-msg {
    margin: 0;
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 16px 36px rgba(17, 24, 39, 0.16);
}

.mofa-template-marketplace .mofa-msg--success {
    background: #7bd321;
    color: #fff;
}

.mofa-template-marketplace .mofa-msg--error {
    background: #ef4444;
    color: #fff;
}

.mofa-template-marketplace .mofa-invalid {
    border-color: #f04438 !important;
    box-shadow: 0 0 0 4px rgba(240, 68, 56, 0.12) !important;
}

.mofa-sms-login-modal .mofa-template-marketplace {
    min-height: auto;
    padding: 0;
    background: transparent;
}

.mofa-sms-login-modal .mofa-template-marketplace::before,
.mofa-sms-login-modal .mofa-template-marketplace::after {
    display: none;
}

.mofa-sms-login-modal .mofa-template-marketplace .mofa-marketplace-card__shape {
    display: none;
}

.mofa-sms-login-modal .mofa-template-marketplace .mofa-marketplace-card {
    border-radius: 28px;
    padding: 24px 30px 28px;
}

.mofa-sms-login-modal .mofa-template-marketplace .mofa-marketplace-back {
    width: 40px;
    height: 40px;
}

.mofa-sms-login-modal .mofa-template-marketplace .mofa-marketplace-back svg {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px;
    min-height: 28px;
}

@media (max-width: 640px) {
    .mofa-template-marketplace {
        min-height: auto;
        padding: 20px 12px 110px;
    }

    .mofa-template-marketplace .mofa-marketplace-card {
        width: 100%;
        padding: 18px 18px 24px;
        border-radius: 18px;
    }

    .mofa-template-marketplace .mofa-marketplace-otp {
        min-height: 64px;
        font-size: 24px;
        letter-spacing: 0.55em;
        text-indent: 0.55em;
    }

    .mofa-template-marketplace .mofa-marketplace-footer {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .mofa-template-marketplace .mofa-marketplace-security {
        justify-content: center;
    }

    .mofa-template-marketplace .mofa-marketplace-timer {
        justify-content: center;
    }

    .mofa-template-marketplace .mofa-marketplace-security__panel {
        inset-inline-end: auto;
        inset-inline-start: 0;
        width: min(280px, calc(100vw - 40px));
    }
}
